get_legislation_text
Retrieve New Zealand legislation text by work or version ID. Need a specific section or schedule? Fetch just that part, or get an official PDF link.
Instructions
Retrieve the text of a piece of legislation. Provide a version_id or work_id. Without section/schedule params, returns the whole document as cleaned plain text. With a section param (e.g. "22" or "25A"), returns just that section with its Part/subpart context. With a schedule param (e.g. "1"), returns just that schedule. Use list_sections to discover numbers first. With format:"pdf", returns the official PDF download URL instead of text; format:"pdf_original_scan" returns the scan of the original printed Act (pre-2008 as-enacted versions only).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Set to "pdf" to retrieve the official PDF download URL instead of the document text (falls back to the scanned original if no typeset PDF exists). Set to "pdf_original_scan" to require the scan of the original printed Act, which only as-enacted versions of pre-2008 Acts have. Returns the URL and metadata without downloading the file. Cannot be combined with section or schedule. | |
| exclude | No | Content types to exclude from the rendered text. By default everything is included. Options: - "cover": Front-page block (title, assent date, PCO reprint note). Already returned as structured metadata fields — exclude to avoid duplication in the text body. - "history_notes": Amendment-history entries at the end of each provision, recording when it was inserted, amended, or repealed and by which Act. Useful for understanding how law evolved; omit if you only need current text. - "comparative_references": Terse cross-references to equivalent provisions in predecessor or overseas legislation (e.g. '1952 No 43 s 4(1)'). Lineage information only — not part of the current operative law. - "editorial_notes": Two kinds of PCO annotation: (1) editorial-note elements — free-text PCO notes such as secondary legislation compliance tables, explicitly flagged in the source as 'not part of the Act'; and (2) amends-note elements — machine-readable scheduling data for amendments not yet in force, recording the trigger date/event, affected provisions, and replacement text. Exclude if you only need the current operative text. - "defined_term_links": Inland Revenue (Income Tax Act) navigation lists enumerating which defined terms appear in a provision. Website navigation aids only — not legislative text. - "end_matter": Document-tail reprint metadata — the reprint index (table of reprint dates) and reprint notes (free-text describing what each reprint changed), plus the leg-history element (structured list of reprint issuance dates). Appears once at the end of the whole document; not present when fetching a single section. | |
| section | No | Return only this section number (e.g. "22" or "25A") instead of the whole document. Use list_sections first to discover section numbers. Cannot be combined with schedule. | |
| work_id | No | A work_id; the newest version will be resolved automatically. Provide either version_id or work_id. | |
| schedule | No | Return only this schedule number (e.g. "1") instead of the whole document. Cannot be combined with section. | |
| max_chars | No | Truncate whole-document output to this many characters (default 100000). Not applied when fetching a single section or schedule. | |
| version_id | No | A specific version to read. Provide either version_id or work_id. |