Code samples and libraries


SDK/Client Libraries

APIMatic have set up a range of SDKs/Client Libraries for DigitalNZ that includes PHP, Javascript, Python, Ruby, Java, C#, and Objective C.

Javascript search widget for API v3

In-context search of content in DigitalNZ that can be embedded in web pages and blogs etc.

Python resources for API v3

  • pyDnz - a Python module for consuming the DigitalNZ API. 
  • A video tutorial demonstrating how to create simple search application with the DigitalNZ API.

Deprecated code samples for API v1 and v2

The following code samples were written for the depreciated versions 1 and 2 of the DigitalNZ API. The current DigitalNZ API is version 3.

iOS (Objective C) iPhone/iPad app (old)
A simple app for searching DigitalNZ from your iPhone, iPad or iPod Touch.

Javascript JSON query - Joe Mahoney (old)
Simple example that shows "sports related" cartoons from DigitalNZ. Loads the Google Ajax API code; imports the jQuery javascript framework; uses jQuery to make an api call to DigitalNZ - see the function get_page_of_cartoons(); when the api returns the json data it updates the text and shows four thumbnail images of related cartoons.

Javascript Timeline demo - DigitalNZ (old)
Implementation of Timeline app from MIT's Simile project (Javascript + Ruby)

Perl DigitalNZ image distribution - Gordon Paynter (old)
Application that shows the distribution of images in DigitalNZ over time.

PHP Demonstration Website (old)
A Picture Show website built on the DigitalNZ Search API.

PHP Drupal module (old)
Module to integrate DigitalNZ search with Drupal CMS.

PHP Moodle search block - Fran├žois Marier (old)
Plugin to allow teachers to provide their students with an easy way of using the DigitalNZ search engine from within a Moodle course page.

PHP Moodle embedded resource - Fran├žois Marier (old)
Plugin to allow teachers to provide their students with links to resources indexed by DigitalNZ.

Python module - Mark Matienzo (old)
A Python module to interact with the DigitalNZ API. Shorthand way to make requests that then grabs JSON responses and translates to a Python object.

Ruby Gem for DigitalNZ - James Harton (old)
Note that some components such as the DigitalNZ record lookup and date were not added.

Ruby DigitalNZ client library - Boost (old)
This library uses nokogiri for speedily parsing the XML.

Ruby Kete's External Search Sources - Kete/Katipo/Auckland City Library  (old)

Ruby Geoparsing DigitalNZ - Gordon Anderson  (old)