User menu

Developer API

Welcome! Data Engine is about making data more accessible for everyone, including developers. Allowing those who have the talent to create useful tools and applications by leveraging data in the Data Engine will make it that much more powerful. Data Engine at its heart is a utility built for extending through the API. Developers are invited to use this API, and share any feedback to help improve the Data Engine for the benefit of the community.

The Data Engine API will make data available as XML, JSON, and JSONP, all over a REST interface. Please refer to the technical documentation below for implementing your project.

API keys

All requests require an API key, passed as a "key" query parameter. You will receive a key upon registering with Data Engine and accepting the terms of use.

Formats

All API responses are available in 3 different formats:

XML

XML is the default response format, and all examples use the default XML URLs. For example, /api/dataset will return XML.

JSON

JSON responses are available by appending ".json" on API URLs. For example, /api/dataset.json will return JSON.

JSONP

JSONP responses are available by appending ".jsonp" on API URLs, and passing a "callback" query parameter, with the JavaScript function name that should be called with the response. For example, /api/dataset.jsonp?callback=myfunction will return a JSONP call to myfunction().

Limiting Results

By default, all API responses will return all results. To return a subset of results, query parameters "start" and "limit" can be used. Result numbers start at 0, so start=0&limit=20 will return the first 20 results.

List Datasets

GET /api/dataset

This resource will return a list of all datasets, with title and ID for each. ID can be used to get more information (see below).

List Records in a Dataset

GET /api/dataset/{id}

This resource will return a list of records in a given dataset.

Optionally, a "geodata_format" parameter may be passed in the request. This will instruct the endpoint on how to format any available geodata. Allowed formats are "geojson" and "wkt".

Errors

If for any reason the requested data can not be returned, the API will return a HTTP 503 Service Unavailable response.

Example URLs

http://codataengine.org/api/dataset.xml?key=YOURKEYHERE
http://codataengine.org/api/dataset.jsonp?callback=myfunction&key=YOURKE...
http://codataengine.org/api/dataset/84.xml?start=5&limit=10&key=YOURKEYHERE
http://codataengine.org/api/dataset/78.json?start=0&limit=25&key=YOURKEY...