gb_get_text
Fetch the complete text of UK legislation from legislation.gov.uk in multiple formats (XML, HTML, Akoma Ntoso, RDF, PDF, CSV) by referencing an act or instrument.
Instructions
Fetch the full text of UK legislation.
Uses legislation.gov.uk's content-negotiation path suffix (/data.{format}) -
xml (the site's own legislation.xsd schema), html, akn (Akoma Ntoso),
rdf, pdf, or csv.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | one of ``"xml"``, ``"html"``, ``"akn"``, ``"rdf"``, ``"pdf"``, ``"csv"``. | html |
| reference | Yes | reference of the act/instrument (work or point-in-time expression). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | Yes | ||
| content | No | ||
| eli_uri | Yes | ||
| byte_size | No | ||
| source_url | Yes | ||
| dataset_note | No | legislation.gov.uk has no native /eli/ namespace; eli_uri carries the UK's own persistent identifier URI (id.../{type}/{year}/{number}) instead of a fabricated ELI path. Revised ('as amended') text reflects the effective date shown in restrict_start_date; always check for in-force / pending amendments. | |
| human_readable_citation | No |