View on GitHub

Dig DC API Documentation

Download this project as a .zip file Download this project as a tar.gz file

Dig DC is the online home for the DC Public Library's Special Collections. If you visit it, you can find historical DC cartoons, photographs, maps, oral histories, postcards, and other ephemera, as well as extensive metadata about each item. Cool, right? The site uses a platform called CONTENTdm, which is used by many, many libraries across the country. ContentDM's API documentation is minimal, so this page covers what you need to see what collections are on Dig DC, view what they contain, and download collection files.

This documentation was created for the DC Public Library by Code For DC volunteer Emanuel Feld.

Get a list of the collections

Endpoint:

https://server16808.contentdm.oclc.org/dmwebservices/index.php?q=dmGetCollectionList/json

Example Query:

$ curl https://server16808.contentdm.oclc.org/dmwebservices/index.php?q=dmGetCollectionList/json | python -mjson.tool

Example Response:

[
    {
        "alias": "/p16808coll5",
        "name": "Clifford Berryman Cartoon Collection",
        "path": "/cdm/sites/16808/data/p16808coll5",
        "secondary_alias": "p16808coll5"
    },
    {
        "alias": "/p16808coll12",
        "name": "Darrell C. Crain, Jr. Photograph Collection",
        "path": "/cdm/sites/16808/data/p16808coll12",
        "secondary_alias": "7"
    },
    [...]
    {
        "alias": "/p16808coll15",
        "name": "Maps - City & Regional",
        "path": "/cdm/sites/16808/data/p16808coll15",
        "secondary_alias": "10"
    }
]

Get the items in a collection

Endpoint:

https://server16808.contentdm.oclc.org/dmwebservices/index.php?q=dmQuery/<collection_alias>/json

Example Query:

$ curl https://server16808.contentdm.oclc.org/dmwebservices/index.php\?q\=dmQuery/p16808coll5/json | python -mjson.tool

Example Response:

{
    "pager": {
        "maxrecs": null,
        "start": null,
        "total": 131
    },
    "records": [
        {
            "": "",
            "collection": "/p16808coll5",
            "filetype": "jp2",
            "find": "18.jp2",
            "parentobject": -1,
            "pointer": 17
        },
        [...]
        {
            "": "",
            "collection": "/p16808coll5",
            "filetype": "jp2",
            "find": "15.jp2",
            "parentobject": -1,
            "pointer": 14
        }
    ]
}

Get the details of a record in a collection:

Endpoint:

https://server16808.contentdm.oclc.org/dmwebservices/index.php?q=dmGetItemInfo/<collection_alias>/<record_pointer>/json

Example Query:

$ curl https://server16808.contentdm.oclc.org/dmwebservices/index.php?q=dmGetItemInfo/p16808coll5/17/json | python -mjson.tool

Example Response:

{
    "cdmfilesize": "17085567",
    "cdmfilesizeformatted": "16.29 MB",
    "cdmhasocr": "0",
    "cdmisnewspaper": "0",
    "cdmprintpdf": "0",
    "creato": "Berryman, Clifford Kennedy, 1869-1949",
    "date": {},
    "datea": "2013-09-13",
    "dateb": {},
    "descri": "Unfinished portrait of an unidentified man, partially scratched out.",
    "dmaccess": {},
    "dmcreated": "2014-01-04",
    "dmimage": {},
    "dmmodified": "2015-10-06",
    "dmoclcno": {},
    "dmrecord": "17",
    "file": "dcpl_p008_009p2",
    "find": "18.jp2",
    "format": "Image/jpeg",
    "fullrs": "Volume1/dcpl_p008_009p2.tif",
    "identi": "Clifford Berryman Cartoon Collection",
    "langua": "eng",
    "medium": "Drawings",
    "neighb": {},
    "notes": "Drawing is on the back of dcpl_p008_009p1; No title on drawing, title supplied by cataloger",
    "publis": "DC Public Library, Special Collections",
    "restrictionCode": "1",
    "rights": "Publication rights for this image can be granted by DC Public Library.",
    "source": "Original version: pen and ink drawing on poster board; DC Public Library, Special Collections, P8 Clifford Berryman Cartoon Collection, Series 1, Drawing 9, verso",
    "subjec": "Sketches",
    "techni": "Filename: dcpl_p008_009p2.tif; ByteOrder: little-endian; CompressionScheme: 1; ColorSpace: 1; FileSize: 34538590; Orientation: 1; ImageProducer: Backstage Library Works for DC Public Library; ScannerMake: Phase One; ScannerModel: IQ180; ScannerSoftware: Adobe Photoshop CS3 Windows; Resolution: 400; ImageWidth: 5977; ImageLength: 5774; BitsPerSample: 8; SamplesPerPixel: 1; Checksum: a4886739e992c580d9e9b4f5a0a4bf9f",
    "title": "Unfinished portrait",
    "transc": {},
    "type": "Still Image"
}

Download a record's file

Endpoint:

http://digdc.dclibrary.org/utils/getfile/collection/<collection_alias>/id/<record_pointer>/filename/<record_find>

Example Query:

$ curl http://digdc.dclibrary.org/utils/getfile/collection/p16808coll5/id/17/filename/18.jp2 > image.jp2

Example Response:

image