v1

latestOpenAPI 3.0.02026-07-141321.3 KB
Content

Lookup GOV.UK content by path

This is the primary interface to lookup the content required to render a page on GOV.UK

It accepts an input of the path of the page you are looking up. For example, if you were looking up travel advice for Thailand which is hosted on GOV.UK at https://www.gov.uk/foreign-travel-advice/thailand you would make a request to https://www.gov.uk/api/content/foreign-travel-advice/thailand.

If the content is available at the requested path you will receive a ContentItem containing the structured data for that page.

In the GOV.UK context, content schemas are structured rules that define what a specific type of content can contain and how it's organised. Think of them as a strict blueprint or a template for every piece of information published on GOV.UK. These schemas ensure that all content is consistent, predictable, and machine-readable.

Each schema is a formal definition, written in JSON Schema, that specifies the underlying structure for a content type. For example, a schema for a "News Article" would define all the possible fields for that article, such as:

  • title: A mandatory text field with a maximum character limit.
  • summary: A mandatory short description.
  • body: The main content of the article, which itself must conform to the rules of Govspeak (GOV.UK's version of Markdown).
  • publication_date: A mandatory field that must be in a valid date format.
  • image: An optional field that must contain specific sub-fields like a URL and alt text.
  • related_links: A list where each item must have a title and a URL.

By enforcing these rules, schemas guarantee that every news article across GOV.UK has the same fundamental structure.

get/{path}

Path parameters

pathstring required
Example:vat-rates

The path to the content on GOV.UK e.g for https://www.gov.uk/vat-rates you'd use vat-rates

Response

A content item is available at that path.

analytics_identifierinteger

An identifier which clients of the Publishing API can include with an edition for later use in analytics software.

base_pathstring required

The path of the content on GOV.UK - or the shortest one for content that spans multiple sub paths. Learn more.

content_idstring uuid

A UUID which represents the public identifier for a piece of content, combined with locale this makes the unique identifier for an individual piece of content. Can be null for redirects / gone content.

descriptionstring

A description of the content which can then be displayed publically.

detailsobject

An object representing data that is structured in a format defined by the schema of the edition. This holds the content for the edition, often in a field called body. Can be null for items without content - for example, a redirect. Learn more.

document_typestring required

A particular type of document, used to differentiate between documents that are of different types but share the same schema. Learn more.

email_document_supertypestring required

High level group for email subscriptions used to identify publications and announcement.

first_published_atstring date-time required

Can be set by publishing application, otherwise set automatically in Publishing API on first publish and copied on subsequent ones.

government_document_supertypestring required

Grouping for email subscriptions.

linksobject required

An object that has collections of LinkedContentItems objects in arrays, which are grouped by a link type.

localestring

The language the document is written in. A fixed list of locales is allowed.

navigation_document_supertypestring required

Used to filter pages on the new taxonomy-based navigation pages.

phase'alpha' | 'beta' | 'live' required

The "phase" of an edition can either be alpha, beta or live.

public_updated_atstring date-time required

Can be set by publishing application, otherwise set automatically in Publishing API each time an edition is published with a major edition.

publishing_appstring required

The application which published the edition.

publishing_request_idstring

The GOV.UK Request ID which was used when the content item was published.

rendering_appstring

The application which will be used to render the content of the edition.

schema_namestring required

The name of the GOV.UK content schema that the request body will be validated against. Learn more.

titlestring

The title of the edition, displayed to the user.

updated_atstring date-time required

Current date time every time the content item changes, which could be an update to one of the dependent links.

user_journey_document_supertypestring required

Used to distinguish pages used mainly for navigation (finding) from content pages (thing).

Example response

{
  "$ref": "#/components/examples/ContentItemExample"
}
All 1 operations