GOV.UK Content API
The GOV.UK Content API is a public, read-only API for retrieving content and metadata from supported pages on the GOV.UK website. This information is available to any member of the public, but the API provides it in a format that your services, tools and products can consume directly.
This technical documentation gives you information on:
- how the GOV.UK Content API works
- what you can and cannot use the API for
- how to retrieve and display GOV.UK content
Contact us if you have any questions or feedback.
What you can do with this API
You can use the GOV.UK Content API for building services, tools and products which incorporate content from GOV.UK, and for keeping that content up to date.
The GOV.UK Content API returns a JSON representation of a live page from the GOV.UK website. The response includes page metadata, links to related content, and the page body as HTML. This provides a more convenient and predictable interface than scraping the HTML from web pages.
The information returned by the API includes links between related GOV.UK content. For example, a response may identify the government organisation that published a page. You could then retrieve that organisation’s policies from another page.
Our API reference describes the API endpoints and response format a developer can expect.
What you cannot do with this API
The content and metadata you can access using the GOV.UK Content API are limited
to live pages on the GOV.UK website, published on the www.gov.uk domain.
For example, here are some pages that you can access using the API:
- Holiday entitlement rights on
www.gov.uk - Registering for Self Assessment on
www.gov.uk - Pay and conditions on
www.gov.uk
The GOV.UK Content API does not provide access to content from websites on other
subdomains of gov.uk, such as blog.gov.uk. The following are examples of pages
that you cannot access using the API:
- Transforming towns and cities for people and nature on
blog.gov.uk - Using GOV.UK Pay on
payments.service.gov.uk
You also cannot use this API to search GOV.UK content, or use any filters such as date, type, or page relationship. You can only retrieve content by path, as described in Get started.
If you want to search or filter for GOV.UK content before retrieving it, use the GOV.UK Search API.
Types of content available from this API
Some fields in the API response from the GOV.UK Content API contain HTML. This HTML may reference images, attachments or other files, but you cannot use the API to return those files directly. Instead you must retrieve, for example, a referenced image file directly from its source by other means.
In addition, you can only access content from static pages on the GOV.UK website using this API. Content from dynamic pages (for example, from a search, or using data that changes over time) is not available from this API.
Some types of content are still being migrated to the GOV.UK Content API. In such cases, you may encounter a placeholder page which holds no content, or a redirect to a catch-all destination for unmigrated content. You can find more information in the API reference.
You cannot access historic content using this API. If you want to access historic content, you can get this from the UK Government Web Archive.
Who can use this API
The GOV.UK Content API is public, and anyone can use it. You do not need to seek permission or sign any agreements to use this API.