Skip to content

(4) Additional Tips

Brodie-Jean Hoare edited this page Sep 24, 2024 · 11 revisions

Json Viewer

The Auckland Museum API provided responses using the JSON data standard. In order to view the data that the API sends back you will need some way to view JSON data. We recommend you install a JSON viewer for your browser.

Browser Extension
Chrome JSON View extension
Firefox JSON View extension
Safari JSON formatter extension

Query string syntax

syntax usage Example link
%20 Used in place of a gap in a string, ie; Search for records containing Edmund Hillary https://collection-publicapi.aucklandmuseum.com/api/v3/opacobjects?query=edmund%20hillary
- Must not be present Search for ice axe and not Hillary https://collection-publicapi.aucklandmuseum.com/api/v3/opacobjects?query=ice%20axe%20-hillary
OR Contains either search term Search for both Hillary and Tenzing https://collection-publicapi.aucklandmuseum.com/api/v3/opacobjects?query=hillary%20or%20tenzing
has_images%3AYes Note: 'No' could be used here as a value alternatively Images field satisfy true image boolean Search for Hillary results that do not have any images associated https://collection-publicapi.aucklandmuseum.com/api/v3/opacobjects?query=Hillary&view=label&facet=has_images%3ANo

Pagination

Although your query may return 13,654 results, by default our API browser is set to an offset value of 0 and a limit of 12. These are non-mandatory parameters in your string query, so you will be able to parse your query without needing to specify these values.

The ‘LIMIT’ clause is mainly used for restricting the number of records to be retrieved. The maximum allowed limit is 100.

The ‘OFFSET’ clause is to specify the starting point within the result set, and will indicate where to begin returning results from based on their position within the query results.

The 'DIRECTION' clause is to specify whether this result set retrieved is in ascending order [asc] or descending order [desc]. The default value is ascending.

Note: for more details on different clauses available in structuring your string, please feel free to visit the documentation of our API provider: https://apidocs.browser.vernonsystems.com/#!/Object/get_opacobjects

How to find a record if you know the ID

Your JSON output will give a list of IDs as part of your broad search query result, with more field information nested under each ID. These ID's can be tacked onto the URI to take your directly to the file path of the record, or alternatively could be placed at the end of the Collections Online URL to view the record as part of our collections online platform.

For example the record ID 671988 can be viewed as raw JSON

Format Example
Collections Online https://www.aucklandmuseum.com/discover/collections/record/671988
Raw JSON https://collection-publicapi.aucklandmuseum.com/api/v3/opacobjects/671988

Media

Currently, our API is unable to offer full resolution image download for the time being. Full resolution download of our images are available directly from the records, as an alternative measure, or if you are wanting a batch of images based on query parameters for your project please feel free to get in touch with our team to discuss ways that we can help you directly with your data needs.

However, if you wish to view a medium or small size of one of our images (ideal for thumbnails, etc), then simply append the record ID is our base URI as such https://collection-publicapi.aucklandmuseum.com/api/v3/opacobjects/{record id}and add a facet specifying image ID as part of your query string parameter ?view=label&facet=imageID

eg; https://collection-publicapi.aucklandmuseum.com/api/v3/opacobjects/671988?view=label&facet=imageID

"imageId": "232518",
        "imageDerivatives": [
          {
            "identifier": "MEDIUM",
            "url": "https://collection-publicapi.aucklandmuseum.com/records/images/medium/2482/dde19beace33bd4c40d4b4fa64b2128fb9c60747.jpg",
            "width": "267",
            "height": "400"
          },
          {
            "identifier": "SMALL",
            "url": "https://collection-publicapi.aucklandmuseum.com/records/images/small/2482/dde19beace33bd4c40d4b4fa64b2128fb9c60747.jpg",
            "width": "100",
            "height": "150"
          }
        ],

Simply follow the file paths associated for the image derivatives within the JSON output to access the medium and small image jpgs for the record of your choosing.