Search Legislation

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.