APIs are all the rage in public sector as a means for accessing information and integrating systems and services. But what is an API?
An application programming interface (API) does for developers what the graphical user interface (GUI) does for the general populace: it makes it easier to use the technology to build an application or use a programme for work.
Clicking on the print icon, for example, initiates a complex set of instructions resulting in the printed document you want. An API for file input/output might give the developer a function that copies a file from one location to another - without requiring that the developer understand the file system operations occurring behind the scenes. (With thanks to Wikipedia for the comprehensive explanation)
On a GDS blog ‘API First at data.gov.uk’ senior developer Ross Jones (pictured) outlines how using an ‘API first’ approach is being used to build data.gov.uk from the bottom up, making it easier for the developers to work with and for the public to use.
This is an important approach. Jonesd explains: “Adding an API to an existing system can often lead to APIs that are incomplete and hard to use - especially when they are not actively employed by the development team.
"By using our own API to build data.gov.uk we are forced into designing APIs from the very beginning, making sure that they are usable. It’s important that they make sense both with respect to data.gov.uk and to external users and systems.”
Data.gov.uk is the government’s open data catalogue listing data from government departments, agencies and other public bodies and making it available for public use. It has been built on the CKAN platform, which includes a complete metadata API enabling developers to perform nearly any action that’s also available to the users of data.gov.uk. This can, for example:
- Show metadata about a single dataset.
- Find publishers and the datasets they publish.
- Search for all CSV files published by a specific publisher, within a date range, using search keywords.
- Publish metadata, if you have the appropriate permissions.
According to Jones: “Using APIs during the development of a system also makes it easier to identify any inconsistencies in the design, such as with naming, format or expected behaviour, and keeps us in line with the ninth design principle - be consistent, not uniform.”
For more information on the data.gov.uk approach to APIs read Jones’ blog: https://data.blog.gov.uk/2016/08/23/api-first-at-data-gov-uk/