Page cover

Using the OS Features API Archive

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.

What is the OS Features API 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

What products are in the OS Features API Archive?

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.

How do I access the OS Features API Archive?

You can get access to the API through the OS Data Hub. The on the api documentation platform has a walkthrough of how to get your API key and a getting started guide with a walkthrough of how to set up the API in a range of GIS software.

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

Once you have your API key, 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.

What are the main benefits of the OS Features API Archive?

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.

How to view multiple years in one GIS session

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

2004 OS MasterMap Topography data with 2021 Topographic Lines over the top

Limitations

  • 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.

Resources

There are a number of resources available for the OS Features API:

Last updated

Was this helpful?