Records (Search)

Method: GET
Availability: Available since version 1
History: Query parameters and response formats significantly changed in version 3. Versions 1 and 2 are no longer supported.

The Search Records API call returns a result set in response to a search query.

For more comprehensive details about the API parameters and responses see the DigitalNZ OpenAPI spec on SwaggerHub.

URL format<version>/records.<response_format>?<request_parameters>

Request parameters, required

The following must be specified as request parameters:

  • text - the text you wish to search for

  • api_key - developer API key. Your personal API key must be passed in the HTTP request header as 'Authentication-Token'.

Request parameters, optional

The following may be specified as request parameters:

  • and - Restricts search to records matching all facet values. Example:


  • or - Restricts search to records matching any of the specified facet values. Example:


  • without - Restricts search to records that don't match any of the facet values. Example:


  • per_page - The number of records to return per page of search results. Maximum of 100. Defaults to 20.

  • page - Which page of results to return. Defaults to 1.

  • facets - A list of facet fields to include in the output. See the note on facets below for more information. Example:


  • facets_per_page - The number of facets to return per page of facets fields. Defaults to 10.

  • facets_page - Which page of facet fields to return. Defaults to 1.

  • sort - The field upon which results are sorted. Defaults to relevance sorting. The sort field must be either


  • direction - The order in which the results are sorted. Possible values: asc (ascending) or desc (descending).

  • geo_bbox - A geographic bounding box scoping a search to a geographic region. Order of latitude-longitude coordinates is north, west, south, east. The following example searches the Wellington region:


Response format

In version 3 the search records and get metadata call response elements have been standardised. Appending an extension to a resource tells the API to use the requested format. Valid extensions are: xml, json and rss. Examples:

Note: Responses in XML format will return field names in a hyphenated format. For example; "content_partner" in an XML format will look like:

>Kete Horowhenua</c

Response elements

The search results will return the following elements:

  • result_count - total number of matching search results.

  • results - search result records

  • The results elements will contain 0 or more result elements, each representing a single record. Each record element will contain a varying combination of metadata fields such as:

    • is_commercial_use - whether or not this record is licensed for commercial use

    • category - comma-separated list of categories applied to this record (e.g. Images, Web pages)

    • content_partner - institution holding the content to which this record refers

    • date - date associated with this record (e.g. 1996-01-01T00:00:00.000Z). This field may be empty.

    • description - text describing this record

    • additional_description - additional text describing this record

    • landing_url - URL for the content on the content partner's website.
      NB: Please use the source_url (see below) when providing HTML links.

    • id - internal DigitalNZ identifier (used by the Get Metadata API call)

    • source_url - URL that will redirect users to the landing_url.
      NB: Please provide this URL (as opposed to the landing_url) in public hyperlinks so that we are able to count click-throughs, which is helpful for demonstrating the value of DigitalNZ, thus helping us to continue our service.

    • syndication_date - date this record was added to DigitalNZ

    • thumbnail_url - URL for a thumbnail image of the content to which this record refers. This field may be empty.

    • title - title of this record

    • large_thumbnail_url - a larger thumbnail image with dimensions up to 800px (NB the API Terms do not extend rights to the use of these thumbnails)

    • copyright - copyright statement applying to the object referenced by this record. This field may be empty.

    • rights_url - URL of the object licence. This field may be empty

    • display_date - date information in various, often unstructured, formats (e.g. Circa 2000)

    • dc_type - Dublin Core categorisation indicating type

    • display_collection - the display collection the item belongs to

  • facets - the facet result data (if requested). The facets element will contain one facet-field element corresponding to each facet requested. Each facet-field element contains a sorted list of value elements that are made up of a name and result count element. See the note below for more information on facets.

A note on facets

Faceted search is a user interface technique for helping users to refine their searches by prompting them with metadata elements to add to their search. The Wikipedia faceted search page provides useful background information.

DigitalNZ can calculate facet values for any search. In the DigitalNZ search interface these facets are used to filter and categorise search results.

The facets that you can request through the DigitalNZ search records API are category, display_collection, creator, placename, year, decade, century, language, content_partner, rights, collection.

Commercial Use Metadata

Some DigitalNZ partners offer their metadata for use in commercial applications. This content can be identified through the is_commercial_use flag. Only API results where the is_commercial_use field set to True can be used for commercial purposes.

For example, to search for results relating to Auckland that are available for commercial use you would use this query:[is_commercial_use]=True


Search for 'social welfare' and return only ten results per page, starting at page three:

Search for 'social welfare' and only return the title, content_partner, creator and display_collection fields:

Search for Kete Horowhenua for images with the term 'hangi':

Give me result counts for the search term 'health' broken down by top 20 content partners, without showing me the actual records:

Search for Wellington region for the term "kiwi":