LESSON 5 OF 6

Interpretting the API data

Now that you are able to access the data within the API, let's take a look at the data itself.

{
      "info": {
      "totalrecordsperquery": 10,
      "totalrecords": 234937,
      "pages": 23494,
      "page": 1,
      "next": "https://api.harvardartmuseums.org/object?apikey=0000-0000-0000-0000&page=2",
      },
      "records": [
          ...
      ],
  }
  

This example query demonstrates how the dataset is broken up into two parts: info and records. Info represents the data about the data—how many total objects and pages are in the query. Records contain detailed information about each individual object.

Each query automatically breaks the records into groups of 10, and, to access the next set of 10, you must move forward to the next page. In the Info section, the link to the subsequent page is provided.

In order to increase the size of records in each page to 50, append "&size=50" to the end of your query.

https://api.harvardartmuseums.org/ object ? apikey=0000-0000-0000-0000 & size=50
URL Resource API Filter


When viewing the records, notice how each one has an ID number. Each record in the API has a unique identifier, which can be used to retrieve all information regarding that specific ID.

For objects, their identifier is under the field "objectid". To view the information for only one object, use their object ID in the Resource block.

Georgia O'Keefe's Red and Pink

https://api.harvardartmuseums.org/ object/312684 ? apikey=0000-0000-0000-0000
URL Resource API

Here, you can see how much information the museum stores for each individual object. Not only is the museum sharing the basic information of the piece and artist, but it is also revealing the history of the piece related to the museum through accession information, exhibit history, and museum location.

Not only are there IDs for object records, but IDs are also used to define labels for other filters such as "medium", "technique", and "culture".

All objects made with pastels from the United States:

https://api.harvardartmuseums.org/ object ? medium=2028216 & place=2028213 & apikey=0000-0000-0000-0000
URL Resource Filter Filter API


In the example above, the Medium and Place fields are equal to numerical IDs rather than their names. While it is possible to find all of the names and IDs for mediums, for instance, through this query, we have compiled tables for the filters (medium, place, culture, worktype, etc.) for ease of access. To find the entire list of names with their corresponding IDs, visit the Resource Labels page.