Skip to main content

 

GovDelivery

DKAN APIs

In the same way that data on a Granicus Open Data site is made accessible to general users through sensory devices like visualizations, dashboards, and data stories, Granicus Open Data APIs are essential to developers. Granicus Open Data comes with two standard API’s, the Dataset API and the Datastore API. These can be queried to discover metadata associated with the catalog or a specific dataset. It can also be harvested by other portals by complying with the API standard Data.json.

 

Datastore API.

The Granicus Open Data Datastore houses any CSV files that have been uploaded and then imported into the Granicus Open Data Datastore. One reason for importing CSV files into the Datastore is to make the file part of the public Datastore API. Allowing data from uploaded files to be included in the Datastore API greatly increases ability to discover the information as well as the usability and accessibility of the data. The Datastore API enables interactions with specific resources in the Granicus Open Data Datastore down to specific rows. Without the Datastore API data could not be searched with such precision.  


With the Datastore API, technical users can write programs to interact with the information held within the API. This means that the data in the Granicus Open Data Datastore can be accurately and efficiently queried (searched) and the data then used in other contexts and applications. The Datastore API is another way to show how open data can be used to provide a tangible return for citizens.

 

 

Using the API. Click on the Data API button to get information about the Resource that's imported into the Datastore. You won't perform API queries from here, but you can get linked to a sample query and find documentation for more instruction on how to use the Datastore API. The image below is the information returned on a sample query of the Granicus Open Data Datastore using the Datastore API. 

The query below shows the results in a "raw" form. This is generally more difficult to read, but it is what appears with a standard query. 

 

The image below shows a "parsed" view of another API query using a web extension to make the results easier to read. 

 

Dataset API.

The Dataset API works by combining a number of public, supported APIs. Each API is different in what level of detail it pulls out from the information available on a Granicus Open Data site. Together, the suite of APIs makes it possible to pull out information with varying specificity. When data is uploaded to Granicus Open Data as a Resource or Dataset, it is automatically included in the Dataset API. With the Dataset API, a public Data.json file is also automatically published to follow Project Open Data standards.

As a Site Manager, you don’t have to worry about managing the Dataset API because all the work happens in the background. At any point you can access the Data.json file by simply typing /data.json in the URL after the homepage URL. You’ll get a page with all the information from the Datasets and Resources on your Granicus Open Data site.

 

The query below shows the results in a "raw" form. This is generally more difficult to read, but it is what appears with a standard query. 

The image below shows a "parsed" view of another API query using a web extension to make the results easier to read. 

 

 

Next up

Learn more about adding and managing users. 

 

  • Was this article helpful?