Discover/NZLII API
live

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.

Endpoint health
monitored
search_cases
Checks pendingself-healing
Endpoints
1
Updated
1h ago

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.

This call costs2 credits / call— charged only on success
Try it
Result ordering.
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.
Case name or words from the decision title, e.g. 'smith v police'.
Zero-based index of the first result row to return; use next_offset from the previous page. Pages hold 10 rows.
api.parse.bot/scraper/2136ce2d-cee6-4ca4-868f-da3bd6c0c69d/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
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'
Python SDK · recommended

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)")
All endpoints · 1 totalmissing one? ·

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.

Input
ParamTypeDescription
sortstringResult ordering.
courtstringNZLII 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.
queryrequiredstringCase name or words from the decision title, e.g. 'smith v police'.
offsetintegerZero-based index of the first result row to return; use next_offset from the previous page. Pages hold 10 rows.
Response
{
  "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.

Reliability & maintenance

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?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • 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 court parameter 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_documents count.
  • 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.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo2005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min
Team$300/mo20,000300 req/min
Company$1,000/mo100,000500 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.

Frequently asked questions
Does NZLII have an official developer API?+
NZLII does not publish an official developer API. The site at nzlii.org provides a public search interface, but there is no documented REST or GraphQL API for programmatic access to its case-law data.
What does the `court` filter accept, and where do I find valid values?+
The 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?+
No. The 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?+
Not currently. The API returns metadata — title, neutral citation, court code, court name, and year — but not the judgment text or a document download URL. You can fork this API on Parse and revise it to add an endpoint that returns the decision body or a link to the source document.
How does pagination work, and is the page size adjustable?+
Page size is fixed at 10 results. Use the 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.
Page content last updated . Spec covers 1 endpoint from nzlii.org.
Related APIs in Government PublicSee all →
bailii.org API
Search and retrieve court judgments and case law from British and Irish courts across multiple jurisdictions, with filtering by date range and location. Access complete case details including full judgment text and metadata to research legal precedents and decisions.
austlii.edu.au API
Search and access Australian legal cases from AustLII's comprehensive database, browsing by year and downloading decisions in multiple formats including RTF, PDF, and print-friendly versions. Discover available case databases and retrieve specific court rulings with prioritized download options to suit your preferred format.
canlii.org API
Access Canadian legal information from CanLII.org. Discover jurisdictions and databases, search case law and legislation across all provinces and territories, and retrieve full document text and metadata.
law.justia.com API
Search federal court dockets and retrieve detailed case filings to stay informed about ongoing litigation, track case outcomes, and access official court documents. Find specific cases by keywords or case identifiers to monitor legal proceedings relevant to your interests or research.
jade.io API
Access Australian legal cases from JADE, including recent High Court of Australia decisions and full case content retrieved by article ID or medium neutral citation. Look up specific cases quickly using their standardized citation format to stay informed on the latest Australian legal precedents.
indocourtatlas.com API
Search and browse judicial records, legal decisions, and court cases from courts throughout Indonesia to find relevant case information and rulings. Access comprehensive Indonesian court data through simple search and browsing capabilities to research legal precedents and case outcomes.
indiankanoon.org API
Search and access Indian court judgments, laws, and tribunal decisions to find relevant legal documents and case law. Browse legal documents by court, year, and month, or get real-time suggestions and recent rulings to support your legal research.
scholar.google.com API
Search and retrieve case law from Google Scholar by keyword, with optional filtering by date range and court type. Fetch full case details including citations, court, and opinion text for any case returned by search.