6. Exercise/Explore on your own: Getting JSON Data out of DPLA

DPLA publishes its data in JavaScript Object Notation (linked data friendly format).

DPLA provides a great API basics overview: http://dp.la/info/developers/codex/api-basics/

How to get a DPLA API key and start getting DPLA Data:

You can interact with the DPLA API through REST (Representational State Transfer), which is a simple way of interacting with a system that provides an API that responds to HTTP queries like DPLA.

If you have used the CONTENTdm query builder, you can easily use REST to get your data out of DPLA!

1. Get an API Key and a REST browser extension

Install a REST browser extension in your web browser of choice! For this exercise, I used Postman and Chrome.

To request an API key, you must send a HTTP POST request to the following URL:

http://api.dp.la/v2/api_key/YOUR_EMAIL@example.com

Example Request for API Key in Postman:

2. Querying

Here are some sample queries you can use to get JSON data out of DPLA:

Request materials provided by the MWDL:

http://api.dp.la/v2/items?provider.@id=http://dp.la/api/contributor/mwdl&api_key=YOUR_API_KEY_HERE

Take a look at the data!

Request materials provided by the MWDL with Japanese Americans in the subject, return 25 items per page:

http://api.dp.la/v2/items?provider.@id=http://dp.la/api/contributor/mwdl&sourceResource.subject=Japanese+Americans&page_size=25&api_key=YOUR_API_KEY

Click on URL params to expand the parameters of your query.

You could now swap in other subjects for Japanese Americans if you wanted to, in order to find JSON data from MWDL on other topics through the DPLA API.

Tip: Remember to link multiple words in a phrase with the + symbol.

Request materials that deal with the State of Utah that were published starting in 1930:

http://api.dp.la/v2/items?sourceResource.spatial.state=utah&sourceResource.temporal.begin=1930&api_key=YOUR_API_KEY_HERE

More resources:

DPLA API Codex

Danielle Plummer's DPLA API Tutorial