BAILII APIbailii.org ↗
Search and retrieve court judgments from BAILII across UK and Irish jurisdictions. Access full judgment text, citations, metadata, and case details via 3 endpoints.
What is the BAILII API?
The BAILII API provides 3 endpoints to search and retrieve court judgments from the British and Irish Legal Information Institute database, covering jurisdictions across Ireland, England & Wales, Scotland, and Northern Ireland. Use search_cases to run paginated searches with boolean query syntax, search_cases_rss to pull a complete unpaginated result set, or get_case_detail to fetch structured metadata and the full judgment text for any individual case.
curl -X GET 'https://api.parse.bot/scraper/6cc717d3-f3c8-4638-9679-54b268171b75/search_cases?page=1&sort=relevance&query=negligence&phrase=contract&date_to=31%2F12%2F2025&per_page=5&all_words=damages+breach&any_words=tort+negligence&date_from=01%2F01%2F2020&jurisdiction=ie' \ -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 bailii-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: BAILII Legal Database API — search cases, drill into details."""
from parse_apis.bailii_legal_database_api import Bailii, Sort, Jurisdiction, CaseNotFound
client = Bailii()
# Search for negligence cases in Irish courts, sorted by date
for case in client.cases.search(phrase="negligence", jurisdiction=Jurisdiction.IE, sort=Sort.DATE, limit=5):
print(case.title, case.citation, case.court)
# Drill into a single case's full judgment via .first() + sub-resource
case = client.cases.search(query="contract", jurisdiction=Jurisdiction.IE_SC, limit=1).first()
if case:
detail = case.detail.get()
print(detail.title, detail.neutral_citation, detail.judgment_by)
# Use the RSS endpoint for a complete (non-paginated) list of matching cases
for rss_case in client.cases.search_rss(phrase="damages", jurisdiction=Jurisdiction.EW, sort=Sort.RELEVANCE, limit=3):
print(rss_case.title, rss_case.date, rss_case.case_path)
# Typed error handling: catch CaseNotFound for a missing case
try:
missing = client.case("ie/cases/IESC/9999/DOESNOTEXIST.html").detail.get()
print(missing.title)
except CaseNotFound as exc:
print(f"Case not found: {exc.case_path}")
print("exercised: cases.search / case.detail.get / cases.search_rss / CaseNotFound error")
Search BAILII case law databases with various filters. Returns paginated results with case titles, citations, courts, dates, and relevance scores. Requires at least one search parameter (query, phrase, all_words, or any_words). Pagination via page parameter; default 10 results per page. Sort by relevance, date, title, or jurisdiction.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number (1-based) |
| sort | string | Sort order for results. |
| query | string | Direct search query string (advanced boolean syntax). Use this OR phrase/all_words/any_words. |
| phrase | string | Exact phrase to search for (e.g., 'negligence') |
| date_to | string | Filter results up to this date (DD/MM/YYYY format) |
| per_page | integer | Results per page |
| all_words | string | All of these words must appear (space-separated) |
| any_words | string | Any of these words may appear (space-separated) |
| date_from | string | Filter results from this date (DD/MM/YYYY format) |
| jurisdiction | string | Jurisdiction filter. Accepted values: ie (all Ireland), ie_sc (Supreme Court), ie_ca (Court of Appeal), ie_hc (High Court), uk (all UK), ew (England & Wales), nie (Northern Ireland), scot (Scotland). Or a direct mask_path like 'ie/cases/IESC'. |
{
"type": "object",
"fields": {
"page": "integer current page number",
"total": "integer total number of matching documents",
"results": "array of case result objects with title, citation, court, date, relevance_pct, file_size, case_url, case_path, highlighted_url",
"per_page": "integer results per page",
"total_pages": "integer total number of pages"
},
"sample": {
"data": {
"page": 1,
"total": 4066,
"results": [
{
"date": "30 July 2015",
"court": "High Court of Ireland Decisions",
"title": "Nugent -v- Fogarty [2015] IEHC 523 (30 July 2015)",
"case_url": "https://www.bailii.org/ie/cases/IEHC/2015/H523.html",
"citation": "[2015] IEHC 523",
"case_path": "ie/cases/IEHC/2015/H523.html",
"file_size": "35 KB",
"relevance_pct": 4,
"highlighted_url": "https://www.bailii.org/cgi-bin/format.cgi?doc=/ie/cases/IEHC/2015/H523.html&query=(\"negligence\")"
}
],
"per_page": 3,
"total_pages": 1356
},
"status": "success"
}
}About the BAILII API
Search Endpoints
The search_cases endpoint accepts flexible query inputs: you can supply a raw boolean query string via the query parameter, or use the phrase, all_words, and any_words parameters for structured keyword matching. Results are paginated and each item in the results array carries a title, citation, court, date, relevance_pct, file_size, and both a case_url and case_path for downstream lookups. You can sort by relevance, date, date_oldest, title, or jurisdiction, and narrow results using date_to for a cutoff date.
RSS-Style Full Result Retrieval
search_cases_rss accepts the same query parameters as search_cases and additionally supports a jurisdiction filter (e.g., ie_hc for the Irish High Court, ie_sc for the Supreme Court). Rather than paginating, it returns all matching results in a single response, each with title, citation, court, date, case_url, and case_path. This is suited for bulk collection or complete coverage of a search query without managing pagination state.
Case Detail
The get_case_detail endpoint accepts either a case_url (full URL) or a case_path (relative path obtained from a prior search). It returns structured fields including title, court, date_of_delivery, judgment_by, status (Approved/Unapproved), result, and judgment_text — the complete text of the judgment. An extra_metadata object captures additional fields that vary by case and court. The status and result fields may be null depending on how the source document is structured.
Coverage and Limitations
BAILII's database spans courts across the UK and Republic of Ireland, but not all historical judgments are digitised or available in full text. The judgment_text field may be null for some older cases. Jurisdiction filtering is only available on the search_cases_rss endpoint, not on search_cases. Date filtering via date_to accepts DD/MM/YYYY format; there is no date_from parameter in the current spec.
The BAILII API is a managed, monitored endpoint for bailii.org — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when bailii.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 bailii.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?+
- Retrieving the full judgment text of Irish High Court decisions by querying
get_case_detailwith acase_path - Building a case law alert system by polling
search_cases_rsswith keyword filters and sorting bydate - Extracting citation and court metadata for a batch of cases returned by
search_casesfor citation network analysis - Filtering Supreme Court of Ireland judgments by jurisdiction code
ie_scviasearch_cases_rss - Checking the approval status (
Approved/Unapproved) of judgments for legal research quality filtering - Aggregating cases by judge using the
judgment_byfield returned fromget_case_detail - Searching for exact legal phrases like 'duty of care' across all jurisdictions using the
phraseparameter
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does BAILII have an official developer API?+
What does `get_case_detail` return and how do I identify which case to fetch?+
title, court, date_of_delivery, judgment_by, status, result, judgment_text, and an extra_metadata object for additional court-specific fields. To identify a case, pass either the case_url (e.g., https://www.bailii.org/ie/cases/IEHC/2016/H187.html) or the case_path obtained from a prior search_cases or search_cases_rss call.Can I filter `search_cases` results by jurisdiction?+
search_cases endpoint does not currently support a jurisdiction filter parameter. Jurisdiction filtering (e.g., ie_sc, ie_hc, ie_ca) is available on search_cases_rss only. You can fork the API on Parse and revise it to add jurisdiction filtering to the paginated search endpoint.Is there a `date_from` filter to search cases from a specific start date?+
search_cases endpoint supports a date_to parameter for an upper date cutoff in DD/MM/YYYY format, but no date_from for a lower bound. You can fork the API on Parse and revise it to add a start-date filter.Are there cases where `judgment_text` will be null?+
judgment_text field in get_case_detail can be null when the source document does not include extractable full text — this is more common with older or scanned judgments in the BAILII database. The structured metadata fields (title, court, date_of_delivery, status) are more consistently populated.