APIs (Application Programming Interface) provide programmatic machine-based interaction with metadata and image content from items in the Digital Commonwealth collections, allowing this content to be used in other applications and data services.
Please contact us with any questions or comments.
Metadata records for all collections and items are accessible in the Digital Commonwealth OAI-PMH feed.
Search results and item detail pages are available as JSON. To retrieve a page as JSON, append
.json to the page url, as in the examples below:
# normal, return HTML https://search-hydradev.bpl.org/search?q=Boston # return JSON https://search-hydradev.bpl.org/search.json?q=Boston
# normal, return HTML https://search-hydradev.bpl.org/search/commonwealth:abcd12345 # return JSON https://search-hydradev.bpl.org/search/commonwealth:abcd12345.json
Digital Commonwealth supports the following International Image Interoperability Framework APIs:
To request a IIIF Image response, you will need the image identifier. Images have different identifiers than the parent item. To find the image identifier, right-click on the image in a browser window and view or copy the image URL. The image identifier is part of the URL string, as in:
The image identifier can then be used to construct a URL to create a valid IIIF Image request:
# image information request https://iiifdev.bpl.org/iiif/2/IMAGE_ID/info.json # full image, 50% size, as JPEG https://iiifdev.bpl.org/iiif/2/IMAGE_ID/full/pct:50/0/default.jpg
IIIF Presentation manifests in JSON-LD can be returned by appending
/manifest to the
URL for the item detail page. (A 404 will be returned if no manifest is available.)
# normal, return HTML https://search-hydradev.bpl.org/search/commonwealth:abcd12345 # return IIIF manifest https://search-hydradev.bpl.org/search/commonwealth:abcd12345/manifest