• Skip to main content
  • Skip to navigation

Cookies on Legislation.gov.uk

The cookies on legislation.gov.uk do two things: they remember any settings you've chosen so you don't have to choose them on every page, and they help us understand how people browse our website, so we can make improvements and fix problems. We need your consent to use some of these cookies.

  • Find out more or set individual cookie preferences

legislation.gov.uk

http://www.nationalarchives.gov.uk
  • Cymraeg
  • Home
  • Explore our collections
  • Research tools
  • Help and guidance
  • What's new
  • About us
  • Search LegislationHide

Search Legislation

Advanced Search

Back to top

Developer Zone

This is the developer area of the Legislation API. It's not just for developers though! Anybody interested in getting their hands on legislation or linking to it will find useful information.

The Legislation API Developer Zone gives complete documentation for all of the available functionality.

You can follow development of this project on Twitter using #opsidev and on the PerSpectIves, the OPSI blog.

What do you want to know?

Overview

The Legislation API provides consolidated UK legislation, with a few limitations, in a variety of formats for people to reuse. There are three ways in which you might want to use the API.

Re-users

Do you want to reuse the information we are publishing? It is free for you to reuse, but you should look at the copyright and licensing information. Then dive in to the documentation about searching for items of legislation and the URI scheme we are using. You will also be interested in the formats that we provide information in.

Linkers

Do you publish information that references legislation? This service provides permanent URIs for legislation items and sections within legislation, and we would encourage you to use these URIs wherever you refer to items of legislation.

If you are using RDFa within your pages, you can use the resource attribute to indicate that you are linking to a piece of legislation while including a link to another source of information. For example,

The <a rel="cite" resource="http://www.legislation.gov.uk/id/ukpga/1999/17" 
href="http://en.wikipedia.org/wiki/Disability_Rights_Commission_Act_1999">Disability Rights Commission Act 1999</a> replaced 
the National Disability Council with the Disability Rights Commission (DRC).

will generate the triple

<> xhv:cite <http://www.legislation.gov.uk/id/ukpga/1999/17> .

If you are generating links to legislation automatically, it may be hard to construct the relevant URI because chapter numbers are often missing from citations. You can use a query to provide the correct link:

The <a rel="cite" resource="http://www.legislation.gov.uk/id?title=Disability Rights Commission Act 1999" 
href="http://en.wikipedia.org/wiki/Disability_Rights_Commission_Act_1999">Disability Rights Commission Act 1999</a> replaced 
the National Disability Council with the Disability Rights Commission (DRC).

Browsers

Do you just want to have a look at the information we have? You can browse through the different legislation types, search for particular items of legislation, or take a look at some sample items.

  • New site design
  • Help
  • About us
  • Site map
  • Accessibility
  • Contact us
  • Privacy notice
  • Cookies

OGL logoAll content is available under the Open Government Licence v3.0 except where otherwise stated. This site additionally contains content derived from EUR-Lex, reused under the terms of the Commission Decision 2011/833/EU on the reuse of documents from the EU institutions. For more information see the EUR-Lex public statement on re-use.

© Crown and database right