Code Samples and libraries
Note: The following resources are a little stale but still provide some useful starting points. One important change (in late 2021) is the passing of API keys in a custom HTTP header, ‘Authentication-Token’, instead of the request URL. See API docs v3 for more information.
In-context search of content in DigitalNZ that can be embedded in web pages and blogs etc.
Source code and resources for DigitalNZ search widget in a zipped archive (ZIP/13.8 KB) . Also see the cut down version of the same code turned into an image display (ZIP/133 KB) .
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.
Jupyter notebooks for API v3
Tim Sherrat's Jupyter notebooks are a collection of tools, tutorials and examples in Python that cover a wide range of really interesting interactions with the DigitalNZ API.
Deprecated code samples for API v1 and v2
The following code samples were written for the deprecated versions 1 and 2 of the DigitalNZ API. The current DigitalNZ API is version 3.
iOS (Objective C) iPhone/iPad app
A simple app for searching DigitalNZ from your iPhone, iPad or iPod Touch.
PHP Demonstration Website
A Picture Show website built on the DigitalNZ Search API.
The blog post with full source code - Elliott Young
PHP Drupal module
Module to integrate DigitalNZ search with Drupal CMS.
Source code for DigitalNZ Drupal module - Jonathan Hunt
Ruby DigitalNZ client library - Boost
This library uses nokogiri for speedily parsing the XML.