Using the OS Features API Archive
Last updated
Website
Ordnance SurveyData
OS Data HubLast updated
A lot of the detail of accessing the OS Features API Archive is the same as accessing the main OS Features API. This detail is covered in Using the OS Features API. This page is primarily focused on the things that are different when wanting to specifically use the Archive.
OS Features API Archive gives you simple access to previously released non-OS NGD OS Data such as:
OS MasterMap Topography Layer
OS MasterMap Highways Network
OS MasterMap Integrated Transport Network-Roads
OS MasterMap Integrated Transport Network-Urban Paths
OS Open UPRN
The OS Features API Archive allows you to
Request specific feature types and their attributes using spatial or layer queries, although if using the bbox option care must be taken not to choose too big an area otherwise API throttle limits will be reached very quickly
Visualise and style the returned OS MasterMap data
Interrogate the highly detailed feature information of OS MasterMap Topography Layer, Highways and historic Integrated Transport Network data
Create and apply your own styling preferences or use the existing style sheets that can be found in the OS Repositories on GitHub can be used to style the data
The technical specification on the OS Data Hub goes into detail about the products accessible through the API
The archive will go back as far as the dates shown below for each product, which is important when setting the year in the API request as there is no Highways data for pre-2016 for example.
The archive data is the last full release of the product in the given year, so this is not an archive of ALL data releases, only a snapshot from the end of the year ,although this can vary between November and December depending when product releases fell in a particular year.
You can get access to the API through the OS Data Hub. The getting started guide can be accessed here. The first two steps are the same as accessing the API with no archive.
Your API key can be found in the API Dashboard by clicking ‘Add to Project’ under the OS OS Features API section
You will now be able to find the API EndPoint address with your API key under your projects
Then to access the archive you need to adjust the OS Features API endpoint by adding a year as shown here:
https://api.os.uk/features/v1/wfs/archive/2017/?key=YourAPIKeyGoesHere
With your API endpoint adjusted for the Archive you can access the API through GIS Software (such as QGIS and Cadcorp) and through programming languages such as Python and R.
The getting started guide has a walkthrough on getting the API in QGIS.
Example scripts for getting started with the API can be found online with code examples for various functions (for example showing features, finding the nearest feature) on OS labs
Over and above the benefits of the OS Features API generally, you can quickly and easily identify what your area of interest looked like historically using the same familiar data specification and styles as existing in life products. This is useful to understand previous land use for planning or for historical research for example.
There are a couple of options to enable you to view multiple years in one GIS session.
Set up the API endpoint, bring in the data for, say 2017, then edit the end point to 2010 and bring in the data again. The issue here is needing to constantly edit the end point string
Set up an endpoint for each year with the year set in the API string and bring in each endpoint as needed to see that year. Given there is only one cut of data for each year this works quite well, and easily allows you to swap between data epochs to quickly identify changes in the landscape
Limits- the API can return 100 features in a single call. Most GIS software will keep calling the API to bring in the requested features so it is important to set a feature limit when setting up the API. Pagination will be required when using a scripting language, this is explained in the next side.
Scale- the API is not designed to create a scalable map of Great Britain across zoom levels. It is designed to interrogate specific features and small areas.
Support – the API is not currently supported by all GIS software.
There are a number of resources available for the OS Features API:
The Data Hub contains an overview of the API, a getting started guide and a technical specification
There are a series of code examples to help you get started with the API
More resources, including style sheets and example scripts, are available on GitHub