Skip to content

Accessing machine readable data via API

The DataStore API allows you to access and query the rows and columns of raw data listed by agencies in machine readable CSV format via a JSON API endpoint.

When agencies provide their data files in an open and machine readable format (CSV for example), can make this data available via its "DataStore API". The Datastore API is a useful tool for you to query specific rows of data within a data resource. It allows you to query and consume the same data in JSON format. Each row in the datastore corresponds to a Primary Key, identified by the _id field.

API Endpoints

Simple DataStore query endpoint:

SQL DataStore endpoint:

DataStore API Documentation

Available at 

Example: Using searching a resource

  • Identify the data resource you want and retrieve it's ID, for instance: 4c5f6967-6c6d-4981-aa10-6b6790918cb5.
  • Create the URL call:
  • Make a web request to the above URL and you will receive a response. After parsing the JSON response into an object, check if the request was successful by ensuring that the response-json-object.success value evaluates to true before proceeding.
  • Query parameter q can be either a string or a dictionary. If it is a string, it will search on all fields on each row. If it is a dictionary as {"key1": "a", "key2": "b"}, it will search on each specific field.