Get Legislation Section
get_legislation_sectionRead the actual WORDS of one section of a UK Act or statutory instrument — "what does section 5 of the Data Protection Act 2018 say", "quote section 1 of the Human Rights Act", "text of s.170 DPA 2018". Returns the full text of that section alone, so a specific provision does not cost a whole statute. Identify the legislation by type + year + number (Data Protection Act 2018 = ukpga/2018/12) and give the section number. UK law exists in VERSIONS and they differ in substance: pass version to choose "current" (default — the law as amended and in force today), "enacted" (the original text as passed), or a date YYYY-MM-DD for the text as it stood on that day. as_at is an alias for a date version (e.g. as_at: "2019-01-01") — the same date is also accepted via version. legislation.gov.uk serves the NEAREST EARLIER version for a date with no amendment on it rather than erroring, so every response states the version it actually served (version_valid_from) alongside the date asked for, even when they differ. Source: legislation.gov.uk, the official database. Use search_uk_legislation or get_legislation first if you need the year and number.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Document type, e.g. "ukpga". One of: ukpga (UK Public General Acts), uksi (UK Statutory Instruments), asp (Scottish Parliament Acts), anaw/asc (Wales), nia (Northern Ireland), ukla (UK Local Acts). | |
| year | Yes | Year, e.g. 2018. | |
| as_at | No | YYYY-MM-DD — the law as it stood on this date. Alias for a date "version"; the response states the actual served version date, which may be earlier than this if nothing changed on the exact date given. | |
| number | Yes | Item number within that year/type, e.g. 12 for the Data Protection Act 2018. | |
| section | Yes | Section number, e.g. "5", "170", or "5A" for an inserted section. | |
| version | No | Which version of the text: "current" (default — the law as amended and in force today), "enacted" (the original text as passed), or a date YYYY-MM-DD for the text as it stood on that day. |