OS NGD API - Features
What is OS NGD API – Features?
OS NGD API – Features gives you simple access to the OS National Geographic Database (OS NGD)
OS NGD API – Features allows you to
Request specific feature types and their attributes using spatial or attribute queries.
Interrogate highly detailed feature information.
Freely discover what data collection are available.
Explore the data schemas.
Request data in GeoJSON format.
Visualise Ordnance Survey data and apply your own styling.
The API uses the same naming convention as OS NGD to allow you to explore themes and collections easily.
The technical specification on the OS Data Hub goes into detail about the different themes that are accessible.
The API is compliant with OGC API standards.
How do I access the API?
Get access to the API through the OS Data Hub. The getting started guide can be accessed here.
Your API key can be found in the API Dashboard by clicking ‘Add to Project’ under the OS NGD API – Features section
You will now be able to find the API EndPoint address with your API key under your projects
With your API key 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 walk through on getting the API in QGIS.
Example scripts for getting started with the API can be found online:
What are the main benefits of the API?
Plug and play – easily set up in QGIS to explore NGD data
More flexible – pull in exactly the data you want
No ordering or waiting – less time processing and storing data
Easy Testing – great for quick and easy analysis of features
The table below shows the attributes that are available to query against on top of the options available in OS Select+Build.
How is the OS Features API different to the OS NGD API - Features?
The main difference between the new OS NGD API – Features and the OS Features API is the OS NGD API – Features is for accessing OS NGD data.
OS NGD attribution can be explored through the OS NGD layers found in the OS NGD API – Features API
Limitations
There are a number of considerations to keep in mind when using the API.
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.
Access- the API does not have the ability to access OS NGD Address Theme, the Administrative & Statistical Theme data or Water Catchments
CQL errors- the API currently (as of May 2023) does not allow CQL querying with apostrophe (e.g. description = ‘Children’s Centre’)
Pagination
The API returns 100 features per page and the JSON response will include the URL for the following page
Most GIS already understand how to page as its part of the OGC standard. So remember to set limits to avoid calling back the entire country.
However, when using a scripting language you will need to page through the results by utilising the offset attribute.
Resources
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
Last updated