NZLII APInzlii.org ↗
Search New Zealand court and tribunal decisions on NZLII by case name. Returns title, neutral citation, court code, year, and pagination data.
What is the NZLII API?
The NZLII API exposes one endpoint, search_cases, that queries the New Zealand Legal Information Institute's case-law databases by decision title. Each response returns up to 10 results per page, with eight fields per result including the neutral citation, court database code, court name, and decision year. You can filter by a specific court or tribunal and page through results using offset-based pagination.
curl -X GET 'https://api.parse.bot/scraper/2136ce2d-cee6-4ca4-868f-da3bd6c0c69d/search_cases?sort=relevance&query=smith+v+police' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace nzlii-org-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: search New Zealand case law on NZLII, sorted and filtered."""
from parse_apis.nzlii_org_api import Nzlii, SortOrder, InputFormatInvalid
client = Nzlii()
# Search for cases by name, sorted by most-cited, capped at 5 results.
for case in client.cases.search(query="smith v police", sort=SortOrder.CITED_MOST, limit=5):
print(case.title, "|", case.citation, "| cited:", case.citation_count)
# Narrow to a single court and take the first hit for drill-down.
try:
hit = client.cases.search(query="commerce commission", court="NZHC", sort=SortOrder.DATE_LATEST, limit=1).first()
except InputFormatInvalid as e:
print("Bad input:", e.message)
hit = None
if hit is not None:
print(hit.title)
print(" court:", hit.court)
print(" date:", hit.date, "| year:", hit.year)
print(" url:", hit.url)
print("exercised: cases.search (paginated, filtered, first)")
Searches NZLII case-law databases by case name: the query is matched against decision titles (e.g. 'smith v police'), not full text. Returns one page of 10 result rows (the site's fixed page size), each with the decision title, neutral citation, court database code and name, year, decision number, decision date as shown on the site, document size, LawCite citation count, relevance percentage (present only for the relevance sort, null otherwise) and the decision URL. total_documents is the site's reported match count across all pages. Paging is by offset: pass next_offset from the previous response; has_more is false on the last page. The same decision can appear more than once when the site indexes multiple versions of it. An unknown court code or a name with no matches returns an empty results array with total_documents 0.
| Param | Type | Description |
|---|---|---|
| sort | string | Result ordering. |
| court | string | NZLII court/tribunal database code to restrict the search to, as it appears in court_code of results (confirmed: NZCA, also NZHC, NZSC, NZDC, NZFC, NZEmpC, NZEnvC among the site's advanced-search list). Alphanumeric only. Omitted = all case-law databases. |
| queryrequired | string | Case name or words from the decision title, e.g. 'smith v police'. |
| offset | integer | Zero-based index of the first result row to return; use next_offset from the previous page. Pages hold 10 rows. |
{
"type": "object",
"fields": {
"sort": "sort order applied",
"court": "court code filter applied, or null when searching all case databases",
"query": "the case-name query as searched",
"offset": "integer, offset of this page",
"results": "array of decision rows: title, citation (neutral citation), court_code, court (database name), year (integer), decision_number (string), date (as shown, e.g. '13 June 2019'), size, citation_count (integer LawCite count), relevance_percent (integer or null), url",
"has_more": "boolean, whether another page exists",
"page_size": "integer, fixed at 10",
"next_offset": "integer offset for the next page, or null on the last page",
"total_documents": "integer, the site's total match count across all pages"
},
"sample": {
"data": {
"sort": "relevance",
"court": "NZCA",
"query": "smith v police",
"offset": 0,
"results": [
{
"url": "https://www.nzlii.org/cgi-bin/viewdoc/nz/cases/NZCA/2019/219.html",
"date": "13 June 2019",
"size": "6.35 KB",
"year": 2019,
"court": "Court of Appeal of New Zealand - Te Kōti Pīra",
"title": "Smith v Police [2019] NZCA 219 (13 June 2019)",
"citation": "[2019] NZCA 219",
"court_code": "NZCA",
"citation_count": 1,
"decision_number": "219",
"relevance_percent": 100
},
{
"url": "https://www.nzlii.org/cgi-bin/viewdoc/nz/cases/NZCA/1979/95.html",
"date": "21 November 1979",
"size": "5.08 KB",
"year": 1979,
"court": "Court of Appeal of New Zealand - Te Kōti Pīra",
"title": "Smith v Police CA113/79 [1979] NZCA 95 (21 November 1979)",
"citation": "[1979] NZCA 95",
"court_code": "NZCA",
"citation_count": 0,
"decision_number": "95",
"relevance_percent": 100
}
],
"has_more": false,
"page_size": 10,
"next_offset": null,
"total_documents": 3
},
"status": "success"
}
}About the NZLII API
What the API Returns
The search_cases endpoint matches your query string against decision titles across NZLII's case-law databases — for example, searching 'smith v police' returns decisions whose titles contain those words. Each result row includes title (the decision name), citation (the neutral citation), court_code (the short database identifier), court (the full database name), year, and decision_number. The response envelope also reports total_documents (the site's total match count across all pages), page_size (fixed at 10), has_more, and next_offset for walking through results.
Filtering and Pagination
The optional court parameter accepts a NZLII court or tribunal database code — values correspond to the court_code field in previous results — and restricts the search to that single database. Omitting court searches all case databases simultaneously, and court in the response will be null. The optional offset parameter is zero-based; pass the next_offset from one response as the offset of the next request to page forward. When you reach the last page, has_more is false and next_offset is null.
Sorting and Scope
The optional sort parameter controls result ordering; the value applied is echoed back in the sort field of the response. Searches are title-based only — the query matches words in the decision title, not the full text of a judgment. This makes the endpoint well-suited for finding a known case by name or exploring which decisions involve a particular party, but it does not support free-text search across the body of judgments.
The NZLII API is a managed, monitored endpoint for nzlii.org — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when nzlii.org changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official nzlii.org API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Look up the neutral citation for a known New Zealand case by searching its party names.
- Enumerate all decisions from a specific court by filtering with the
courtparameter and paging through results. - Identify the year and court of decisions involving a particular named party across multiple tribunals.
- Build a case-name autocomplete tool using title matches and the
total_documentscount. - Collect a dataset of NZLII decision titles and court codes for research into tribunal activity over time.
- Check whether a case name appears in a specific court's database before retrieving the full judgment elsewhere.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does NZLII have an official developer API?+
What does the `court` filter accept, and where do I find valid values?+
court parameter takes a NZLII database code — the same short identifier that appears in the court_code field of any result row. Run a broad query first without the filter to collect court_code values for courts you want to restrict future searches to.Does the API search the full text of judgments?+
query parameter is matched against decision titles only — the names of the parties and similar title-level text. Full-text search across the body of judgments is not covered. You can fork this API on Parse and revise it to add a full-text search endpoint if that capability becomes available.Can I retrieve the actual text or PDF of a decision?+
How does pagination work, and is the page size adjustable?+
offset parameter (zero-based) to request subsequent pages; the response includes next_offset which you pass as offset on the next call. When has_more is false, you have reached the last page. The total_documents field tells you the full match count across all pages.