Please upgrade to a more up-to-date browser to explore the datasets on this website.


User menu

Cambridgeshire Insight OpenData

Welcome to Cambridgeshire Insight Open Data
Funded by the LGA Open data Breakthrough Fund

Developer resources

Welcome to the Developer Resources Page! The majority of data resources on Cambridgeshire Insight Open Data have an API. We will be updating these pages with any relevant content as the site develops.

DKAN documentation

DKAN documentation

Examples of the DKAN API

DKAN Datastore API

Access resource data via a web API with powerful query support.

Resource ID

For example the Resource ID for the Local Housing Allowance changes 2013 resource is c94df6eb-d220-4c26-83aa-5528a241543e

Example Query

Query this datastore and return first five results


DKAN offers a Datastore API as a custom endpoint for the Drupal Services module.

This API is designed to be as compatible as possible with the CKAN Datastore API:

The only documented difference is that the CKAN Datastore API supports POST requests while the DKAN Datastore API only supports GET requests. The DKAN Dataset APIs will support POST but the DKAN Datastore API.

Requests can be sent over HTTP. Data can be returned as JSON, XML, or JSONP.

Datastore API URL

Datastores can be queried at:

The default return format is XML. JSON can be retrieved with '.json' at the end:

Request Parameters

Parameters: * resource_id (mixed) – id (string) or ids (array) of the resource to be searched against.

  • filters (mixed) – array or string of matching conditions to select

  • q (string) – full text query*

  • offset (int) – offset this number of rows

  • limit (int) – maximum number of rows to return (default: 100)

  • fields (array or comma separated string) – fields to return (default: all fields in original order)

  • sort (string) – comma separated field names with ordering

  • join (array) – array of fields to join from multiple tables

Return Values

Return is in XML, JSON or JSONP.

Return type:

A dictionary with the following keys


  • fields (list of fields) – fields/columns and metadata
  • offset (int) – query offset value
  • limit (int) – query limit value
  • count (int) – number of total matching records
  • records (list of dictionaries) – list of matching results


The following is a simple example with two resources that contain 4 records each. Please note that the resource_id would be a UUID not single digit number in real scenario. Resource: 1 +---------+-------------+----+------------+

| country | population | id | timestamp |


| US | 315,209,000 | 1 | 1359062329 |

| CA | 35,002,447 | 2 | 1359062329 |

| AR | 40,117,096 | 3 | 1359062329 |

| JP | 127,520,000 | 4 | 1359062329 |


Resource 2 +---------+-----------+----+------------+

| country | squarekm | id | timestamp |


| US | 9,629,091 | 1 | 1359062713 |

| CA | 9,984,670 | 2 | 1359062713 |

| AR | 2,780,400 | 3 | 1359062713 |

| JP | 377,930 | 4 | 1359062713 |


Simple query example:

Returns the country, population, and timestamp fields for US and AR from dataset 1 sorting by the country in ascending order.

Text Search

Paths with the 'query' argument will search the listed fields within the dataset.

Will return the country and population from US


If you wish to query multiple tables, indicate the table as an array key in the following fields:[pop]=1&resource_id[size]=2&filters[pop][country]=US,AR&join[pop]=country&join[size]=country

Returns the country, population, squarekm and id for US and AR from datasets 11 and 13.

Submit a Story/App