DigitalNZ API
digitalnz · Data
OpenAPI specification of DigitalNZ's Record API. For more information about the API see [digitalnz.org/developers](https://digitalnz.org/developers). To learn more about the metadata/fields used in the API see the [Metadata Dictionary](https://docs.google.com/document/pub?id=1Z3I_ckQWjnQQ4SzpORbClcIXUheO-Jd4jt-oZFuMcoQ). To get a sense of what content is available via the API take a look at the search feature on the [DigitalNZ website](https://digitalnz.org/records?text=all%20sorts&tab=Ima
Authentication
Sample Requests
This is the main search endpoint allowing queries against the records database.
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/digitalnz.org/3/records.{format}?page=1&sort=syndication_date&text=example&facets=example&fields=example&geo_bbox=example&per_page=20&and[date]=example&and[year]=example&direction=asc&and[decade]=example&facets_page=null&and[century]=example&and[title][]=example&and[usage][]=Share&and[format][]=example&and[creator][]=example&and[dc_type][]=example&and[subject][]=example&and[category][]=Newspapers&facets_per_page=10&and[has_lat_lng]=true&and[placename][]=example&and[collection][]=example&and[content_partner][]=example&and[is_commercial_use]=true&without[{filter_field}]=example&and[or][{filter_field}][]=example&and[primary_collection][]=example&exclude_filters_from_facets=false&and[has_large_thumbnail_url]=Y"import requests
params = {
"page": "1",
"sort": "syndication_date",
"text": "example",
"facets": "example",
"fields": "example",
"geo_bbox": "example",
"per_page": "20",
"and[date]": "example",
"and[year]": "example",
"direction": "asc",
"and[decade]": "example",
"facets_page": "null",
"and[century]": "example",
"and[title][]": "example",
"and[usage][]": "Share",
"and[format][]": "example",
"and[creator][]": "example",
"and[dc_type][]": "example",
"and[subject][]": "example",
"and[category][]": "Newspapers",
"facets_per_page": "10",
"and[has_lat_lng]": "true",
"and[placename][]": "example",
"and[collection][]": "example",
"and[content_partner][]": "example",
"and[is_commercial_use]": "true",
"without[{filter_field}]": "example",
"and[or][{filter_field}][]": "example",
"and[primary_collection][]": "example",
"exclude_filters_from_facets": "false",
"and[has_large_thumbnail_url]": "Y"
}
response = requests.get(
"https://api.apis.guru/v2/specs/digitalnz.org/3/records.{format}",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/digitalnz.org/3/records.{format}');
url.searchParams.set('page', '1');
url.searchParams.set('sort', 'syndication_date');
url.searchParams.set('text', 'example');
url.searchParams.set('facets', 'example');
url.searchParams.set('fields', 'example');
url.searchParams.set('geo_bbox', 'example');
url.searchParams.set('per_page', '20');
url.searchParams.set('and[date]', 'example');
url.searchParams.set('and[year]', 'example');
url.searchParams.set('direction', 'asc');
url.searchParams.set('and[decade]', 'example');
url.searchParams.set('facets_page', 'null');
url.searchParams.set('and[century]', 'example');
url.searchParams.set('and[title][]', 'example');
url.searchParams.set('and[usage][]', 'Share');
url.searchParams.set('and[format][]', 'example');
url.searchParams.set('and[creator][]', 'example');
url.searchParams.set('and[dc_type][]', 'example');
url.searchParams.set('and[subject][]', 'example');
url.searchParams.set('and[category][]', 'Newspapers');
url.searchParams.set('facets_per_page', '10');
url.searchParams.set('and[has_lat_lng]', 'true');
url.searchParams.set('and[placename][]', 'example');
url.searchParams.set('and[collection][]', 'example');
url.searchParams.set('and[content_partner][]', 'example');
url.searchParams.set('and[is_commercial_use]', 'true');
url.searchParams.set('without[{filter_field}]', 'example');
url.searchParams.set('and[or][{filter_field}][]', 'example');
url.searchParams.set('and[primary_collection][]', 'example');
url.searchParams.set('exclude_filters_from_facets', 'false');
url.searchParams.set('and[has_large_thumbnail_url]', 'Y');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/digitalnz.org/3/records.{format}")
q := baseURL.Query()
q.Set("page", "1")
q.Set("sort", "syndication_date")
q.Set("text", "example")
q.Set("facets", "example")
q.Set("fields", "example")
q.Set("geo_bbox", "example")
q.Set("per_page", "20")
q.Set("and[date]", "example")
q.Set("and[year]", "example")
q.Set("direction", "asc")
q.Set("and[decade]", "example")
q.Set("facets_page", "null")
q.Set("and[century]", "example")
q.Set("and[title][]", "example")
q.Set("and[usage][]", "Share")
q.Set("and[format][]", "example")
q.Set("and[creator][]", "example")
q.Set("and[dc_type][]", "example")
q.Set("and[subject][]", "example")
q.Set("and[category][]", "Newspapers")
q.Set("facets_per_page", "10")
q.Set("and[has_lat_lng]", "true")
q.Set("and[placename][]", "example")
q.Set("and[collection][]", "example")
q.Set("and[content_partner][]", "example")
q.Set("and[is_commercial_use]", "true")
q.Set("without[{filter_field}]", "example")
q.Set("and[or][{filter_field}][]", "example")
q.Set("and[primary_collection][]", "example")
q.Set("exclude_filters_from_facets", "false")
q.Set("and[has_large_thumbnail_url]", "Y")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/digitalnz.org/3/records.{format}")
uri.query = URI.encode_www_form({
"page" => "1",
"sort" => "syndication_date",
"text" => "example",
"facets" => "example",
"fields" => "example",
"geo_bbox" => "example",
"per_page" => "20",
"and[date]" => "example",
"and[year]" => "example",
"direction" => "asc",
"and[decade]" => "example",
"facets_page" => "null",
"and[century]" => "example",
"and[title][]" => "example",
"and[usage][]" => "Share",
"and[format][]" => "example",
"and[creator][]" => "example",
"and[dc_type][]" => "example",
"and[subject][]" => "example",
"and[category][]" => "Newspapers",
"facets_per_page" => "10",
"and[has_lat_lng]" => "true",
"and[placename][]" => "example",
"and[collection][]" => "example",
"and[content_partner][]" => "example",
"and[is_commercial_use]" => "true",
"without[{filter_field}]" => "example",
"and[or][{filter_field}][]" => "example",
"and[primary_collection][]" => "example",
"exclude_filters_from_facets" => "false",
"and[has_large_thumbnail_url]" => "Y"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/digitalnz.org/3/records.{format}?" . http_build_query([
"page" => "1",
"sort" => "syndication_date",
"text" => "example",
"facets" => "example",
"fields" => "example",
"geo_bbox" => "example",
"per_page" => "20",
"and[date]" => "example",
"and[year]" => "example",
"direction" => "asc",
"and[decade]" => "example",
"facets_page" => "null",
"and[century]" => "example",
"and[title][]" => "example",
"and[usage][]" => "Share",
"and[format][]" => "example",
"and[creator][]" => "example",
"and[dc_type][]" => "example",
"and[subject][]" => "example",
"and[category][]" => "Newspapers",
"facets_per_page" => "10",
"and[has_lat_lng]" => "true",
"and[placename][]" => "example",
"and[collection][]" => "example",
"and[content_partner][]" => "example",
"and[is_commercial_use]" => "true",
"without[{filter_field}]" => "example",
"and[or][{filter_field}][]" => "example",
"and[primary_collection][]" => "example",
"exclude_filters_from_facets" => "false",
"and[has_large_thumbnail_url]" => "Y"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));This feature returns a set of search results that are similar (ie have similar metadata) to a specific record.
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/digitalnz.org/3/records/{record_id}/more_like_this.{format}?fields=example&filtering=example&mlt_fields=example"import requests
params = {
"fields": "example",
"filtering": "example",
"mlt_fields": "example"
}
response = requests.get(
"https://api.apis.guru/v2/specs/digitalnz.org/3/records/{record_id}/more_like_this.{format}",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/digitalnz.org/3/records/{record_id}/more_like_this.{format}');
url.searchParams.set('fields', 'example');
url.searchParams.set('filtering', 'example');
url.searchParams.set('mlt_fields', 'example');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/digitalnz.org/3/records/{record_id}/more_like_this.{format}")
q := baseURL.Query()
q.Set("fields", "example")
q.Set("filtering", "example")
q.Set("mlt_fields", "example")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/digitalnz.org/3/records/{record_id}/more_like_this.{format}")
uri.query = URI.encode_www_form({
"fields" => "example",
"filtering" => "example",
"mlt_fields" => "example"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/digitalnz.org/3/records/{record_id}/more_like_this.{format}?" . http_build_query([
"fields" => "example",
"filtering" => "example",
"mlt_fields" => "example"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));If you know its `record_id` you can use this endpoint to view all metadata associated with that specific record.
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/digitalnz.org/3/records/{record_id}.{format}?fields=example"import requests
params = {
"fields": "example"
}
response = requests.get(
"https://api.apis.guru/v2/specs/digitalnz.org/3/records/{record_id}.{format}",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/digitalnz.org/3/records/{record_id}.{format}');
url.searchParams.set('fields', 'example');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/digitalnz.org/3/records/{record_id}.{format}")
q := baseURL.Query()
q.Set("fields", "example")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/digitalnz.org/3/records/{record_id}.{format}")
uri.query = URI.encode_www_form({
"fields" => "example"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/digitalnz.org/3/records/{record_id}.{format}?" . http_build_query([
"fields" => "example"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- See official documentation for authentication and setup.
What can you build with DigitalNZ API?
DigitalNZ API is a Data API. Developers commonly use data APIs for:
- enriching your app with third-party datasets
- building data pipelines and ETL workflows
- querying and searching large datasets
- powering research, analysis, and reporting tools
- syncing reference data into your own systems
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. DigitalNZ API is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide · Learn about API keys · What is REST?