CINXE.COM

About - GOV.UK Content API - Content API

<!doctype html> <html lang="en" class="govuk-template no-js"> <head><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("http://web.archive.org/web"); __wm.wombat("https://content-api.publishing.service.gov.uk/","20230318161725","http://web.archive.org/","web","/_static/", "1679156245"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta content="IE=edge" http-equiv="X-UA-Compatible"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"> <title>About - GOV.UK Content API - Content API</title> <link href="/web/20230318161725cs_/https://content-api.publishing.service.gov.uk/stylesheets/manifest.css" rel="stylesheet"/> <link rel="canonical" href="http://web.archive.org/web/20230318161725/https://content-api.publishing.service.gov.uk/"> <meta name="twitter:card" content="summary"/> <meta name="twitter:domain" content="content-api.publishing.service.gov.uk"/> <meta name="twitter:image" content="http://web.archive.org/web/20230318161725im_/https://content-api.publishing.service.gov.uk/images/govuk-large.png"/> <meta name="twitter:title" content="About - GOV.UK Content API - Content API"/> <meta name="twitter:url" content="http://web.archive.org/web/20230318161725im_/https://content-api.publishing.service.gov.uk/"/> <meta property="og:image" content="http://web.archive.org/web/20230318161725im_/https://content-api.publishing.service.gov.uk/images/govuk-large.png"/> <meta property="og:site_name" content="Content API"/> <meta property="og:title" content="About - GOV.UK Content API"/> <meta property="og:type" content="object"/> <meta property="og:url" content="http://web.archive.org/web/20230318161725/https://content-api.publishing.service.gov.uk/"/> </head> <body class="govuk-template__body"> <script>document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');</script> <div class="app-pane"> <div class="app-pane__header toc-open-disabled"> <a href="#content" class="govuk-skip-link" data-module="govuk-skip-link">Skip to main content</a> <header class="govuk-header app-header" role="banner" data-module="govuk-header"> <div class="govuk-header__container govuk-header__container--full-width"> <div class="govuk-header__logo"> <a href="/web/20230318161725/https://content-api.publishing.service.gov.uk/" class="govuk-header__link govuk-header__link--homepage"> <span class="govuk-header__logotype"> <svg aria-hidden="true" focusable="false" class="govuk-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 132 97" height="30" width="36"> <path fill="currentColor" fill-rule="evenodd" d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 7.7.2 9.2 3.8 1.5 3.5-.3 7.5-3.8 9zm4.7 17.7c-3.6 1.5-7.8-.2-9.2-3.8-1.5-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.3 3.5-.4 7.6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 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path> </svg> <span class="govuk-header__logotype-text"> GOV.UK </span> </span> <span class="govuk-header__product-name"> Content API </span> </a> <strong class="govuk-tag">Beta</strong> </div> <div class="govuk-header__content"> <nav class="govuk-header__navigation govuk-header__navigation--end" aria-label="Menu"> <button type="button" class="govuk-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide menu">Menu</button> <ul id="navigation" class="govuk-header__navigation-list"> <li class="govuk-header__navigation-item"> <a class="govuk-header__link" href="getting-started.html">Getting Started</a> </li> <li class="govuk-header__navigation-item"> <a class="govuk-header__link" href="reference.html">Reference</a> </li> </ul> </nav> </div> </div> </header> </div> <div id="toc-heading" class="toc-show fixedsticky"> <button type="button" class="toc-show__label js-toc-show" aria-controls="toc"> Table of contents <span class="toc-show__icon"></span> </button> </div> <div class="app-pane__body" data-module="in-page-navigation"> <div class="app-pane__toc"> <div class="toc" data-module="table-of-contents" tabindex="-1" aria-label="Table of contents" role="dialog"> <button type="button" class="toc__close js-toc-close" aria-controls="toc" aria-label="Hide table of contents"></button> <nav id="toc" class="js-toc-list toc__list" aria-labelledby="toc-heading"> <ul> <li> <a href="#gov-uk-content-api"><span>GOV.UK Content API</span></a> <ul> <li> <a href="#what-you-can-do-with-this-api"><span>What you can do with this API</span></a> </li> <li> <a href="#what-you-can-39-t-do-with-this-api"><span>What you can’t do with this API</span></a> </li> <li> <a href="#quick-start"><span>Quick start</span></a> </li> <li> <a href="#beta-software"><span>Beta software</span></a> </li> <li> <a href="#authentication"><span>Authentication</span></a> </li> <li> <a href="#security-and-compliance"><span>Security and compliance</span></a> <ul> <li> <a href="#reporting-vulnerabilities"><span>Reporting vulnerabilities</span></a> </li> <li> <a href="#https"><span>HTTPS</span></a> </li> <li> <a href="#security-patches"><span>Security patches</span></a> </li> </ul> </li> <li> <a href="#rate-limiting"><span>Rate limiting</span></a> </li> <li> <a href="#support"><span>Support</span></a> </li> </ul> </li> </ul> </nav> </div> </div> <div class="app-pane__content toc-open-disabled"> <main id="content" class="technical-documentation" data-module="anchored-headings"> <h1 id="gov-uk-content-api">GOV.UK Content API</h1> <div class="govuk-phase-banner"> <p class="govuk-phase-banner__content"> <strong class="govuk-tag govuk-phase-banner__content__tag"> Beta </strong> <span class="govuk-phase-banner__text"> This is a trial service — your <a class="govuk-link" href="http://web.archive.org/web/20230318161725/http://www.smartsurvey.co.uk/s/GPYGP">feedback</a> will help us to improve it. <a class="govuk-link" href="#beta-software">Find out what this means</a>. </span> </p> </div> <p>GOV.UK Content API makes it possible to access the data used to render content on <a href="http://web.archive.org/web/20230318161725/https://www.gov.uk/">https://www.gov.uk</a> (hereafter referred to as GOV.UK). For any page hosted on GOV.UK you can <a href="#quick-start">use the path</a> to access the content and associated metadata for a page.</p> <p>GOV.UK Content API is accessed via <a href="http://web.archive.org/web/20230318161725/https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol">HTTP</a> and returns data in a <a href="http://web.archive.org/web/20230318161725/https://en.wikipedia.org/wiki/JSON">JSON</a> format. The <a href="reference.html">reference documentation</a> details the endpoints and the response format.</p> <h2 id="what-you-can-do-with-this-api">What you can do with this API</h2> <p>This API is useful for applications that incorporate content from GOV.UK and for keeping that content up to date. It provides a more accessible and predictable interface than what can be achieved through scraping HTML pages.</p> <p>You can navigate between content within this API by utilising links. For example, for a page you could access the government organisation that published the page and then navigate to feature policies of that organisation.</p> <h2 id="what-you-can-39-t-do-with-this-api">What you can&rsquo;t do with this API</h2> <p>The content within this API is limited to pages hosted on <a href="http://web.archive.org/web/20230318161725/https://www.gov.uk/"><code>www.gov.uk</code></a> and does not include other websites that are subdomains of <code>gov.uk</code>.</p> <p>This API includes only the pages on GOV.UK that are available as HTML and does not allow direct access to attachments or images. These files however are associated with their HTML content and can be accessed.</p> <p>Not all content is available. For example, content that is generated dynamically (such as through a search) is not available. Some types of content may still be being migrated to utilise this API and these could appear as placeholder documents without any content or as redirections to a catch-all content item that represents a group of unmigrated content.</p> <p>If you wish to access historic content this can currently be done through the <a href="http://web.archive.org/web/20230318161725/http://webarchive.nationalarchives.gov.uk/*/https://www.gov.uk/">National Archives</a>.</p> <h2 id="quick-start">Quick start</h2> <p>You can use the GOV.UK Content API to look up the data that is used to render content on GOV.UK.</p> <p>To get started:</p> <ol> <li>Pick a page on GOV.UK, for example: <a href="http://web.archive.org/web/20230318161725/https://www.gov.uk/take-pet-abroad">https://www.gov.uk/take-pet-abroad</a>.</li> <li>Make a note of the path, for example: <code>/take-pet-abroad</code>.</li> <li>Using a tool such as <a href="http://web.archive.org/web/20230318161725/https://curl.haxx.se/">curl</a>, <a href="http://web.archive.org/web/20230318161725/https://www.getpostman.com/">Postman</a> or your web browser, make a GET request to <a href="http://web.archive.org/web/20230318161725/https://www.gov.uk/api/content/take-pet-abroad"><code>https://www.gov.uk/api/content/take-pet-abroad</code></a>.</li> <li>You’ll receive a JSON response and the fields for this are explained in the <a href="reference.html">reference documentation</a>.</li> </ol> <p>For example, using the curl command line utility tool:</p> <div class="highlight"><pre class="highlight shell" tabindex="0"><code>curl https://www.gov.uk/api/content/take-pet-abroad </code></pre></div><p>Or, you can <a href="http://web.archive.org/web/20230318161725/https://github.com/alphagov/govuk-browser-extension">use the govuk-browser-extension</a>. Note that this is intended for internal use.</p> <h2 id="beta-software">Beta software</h2> <p>GOV.UK Content API is currently beta software and may be subject to changes and improvements as we learn from usage.</p> <p>This means that you may use this software and build applications that utilise it. However as we learn from feedback we may make changes to the software.</p> <p>Please use our survey if you would like to <a href="http://web.archive.org/web/20230318161725/http://www.smartsurvey.co.uk/s/GPYGP">share your feedback about GOV.UK Content API</a>.</p> <h2 id="authentication">Authentication</h2> <p>Usage of GOV.UK Content API does not require authentication.</p> <h2 id="security-and-compliance">Security and compliance</h2> <h3 id="reporting-vulnerabilities">Reporting vulnerabilities</h3> <p>If you believe there is a security issue with GOV.UK Content API, <a href="http://web.archive.org/web/20230318161725/https://github.com/alphagov/.github/blob/master/SECURITY.md">read our security policy</a> and <a href="http://web.archive.org/web/20230318161725/https://github.com/alphagov/.github/blob/master/SECURITY.md#reporting-a-vulnerability">contact us immediately</a>.</p> <p>Please don’t disclose the suspected breach publicly until it has been fixed.</p> <h3 id="https">HTTPS</h3> <p>GOV.UK Content API follows government HTTPS security guidelines. The Hypertext Transfer Protocol Secure (HTTPS), which involves the Transport Layer Security (TLS) protocol, is used by the platform to provide secure connections.</p> <h3 id="security-patches">Security patches</h3> <p>We treat security vulnerabilities in the platform and library code in the GOV.UK Content API as our highest priority. The codebase will be updated as soon as possible when vulnerabilities are discovered or reported.</p> <p>We frequently upgrade the framework and library code in GOV.UK Content API to the latest versions for security and feature enhancements.</p> <h2 id="rate-limiting">Rate limiting</h2> <p>There is a maximum limit of 10 requests per second per client. If you exceed this your request won&rsquo;t be processed until the limit is no longer exceeded and you may see timeout errors.</p> <p>We think this should be sufficient for all users of GOV.UK Content API but if you believe you need the limit increasing you can <a href="#support">contact support</a>.</p> <h2 id="support">Support</h2> <p>GOV.UK Content API is currently in a <a href="http://web.archive.org/web/20230318161725/https://www.gov.uk/help/beta">beta</a> phase and may be subject to changes and improvements.</p> <p>If you experience any issues or have questions regarding GOV.UK Content API please:</p> <ul> <li><strong>If you are a government department:</strong> <a href="http://web.archive.org/web/20230318161725/https://support.publishing.service.gov.uk/">Raise a ticket with GOV.UK Support</a></li> <li><strong>Otherwise:</strong> <a href="http://web.archive.org/web/20230318161725/https://www.gov.uk/contact/govuk">Contact GOV.UK</a> with your query</li> </ul> </main> <aside> </aside> <footer class="govuk-footer app-footer" role="contentinfo"> <div class="govuk-footer__meta"> <div class="govuk-footer__meta-item govuk-footer__meta-item--grow"> <ul class="govuk-footer__inline-list"> <li class="govuk-footer__inline-list-item"> <a class="govuk-footer__link" href="accessibility.html">Accessibility</a> </li> </ul> <svg aria-hidden="true" focusable="false" class="govuk-footer__licence-logo" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 483.2 195.7" height="17" width="41"> <path fill="currentColor" d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145"/> </svg> <span class="govuk-footer__licence-description"> All content is available under the <a class="govuk-footer__link" href="http://web.archive.org/web/20230318161725/https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" rel="license">Open Government Licence v3.0</a>, except where otherwise stated </span> </div> <div class="govuk-footer__meta-item"> <a class="govuk-footer__link govuk-footer__copyright-logo" href="http://web.archive.org/web/20230318161725/https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/">© Crown copyright</a> </div> </div> </footer> </div> </div> </div> <script src="/web/20230318161725js_/https://content-api.publishing.service.gov.uk/javascripts/application.js"></script> </body> </html> <!-- FILE ARCHIVED ON 16:17:25 Mar 18, 2023 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 16:49:11 Nov 25, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 0.589 exclusion.robots: 0.033 exclusion.robots.policy: 0.021 esindex: 0.012 cdx.remote: 4.688 LoadShardBlock: 260.931 (3) PetaboxLoader3.datanode: 209.102 (4) PetaboxLoader3.resolve: 165.694 (2) load_resource: 140.145 -->

Pages: 1 2 3 4 5 6 7 8 9 10