# Bailii — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> 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.

**Category:** Government & Public Data | **Website:** [bailii.org/](https://bailii.org/) | **Docs:** [parse.bot/marketplace/d88b79c8-973f-42b6-88f7-0786af1c2d4f/bailii-org-api](https://parse.bot/marketplace/d88b79c8-973f-42b6-88f7-0786af1c2d4f/bailii-org-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-bailii-org-api-d88b79c8/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_case_detail

Fetch and parse a BAILII case detail page. Returns structured metadata (title, citation, court, date, judges, status, result) and the full judgment text. Requires either case_path or case_url. Case paths are obtained from search_cases or search_cases_rss results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `case_path` | string | No | Case path relative to BAILII root (e.g., 'ie/cases/IEHC/2016/H187.html'). Obtain from search_cases or search_cases_rss results' case_path field. |
| `case_url` | string | No | Full URL of the case page (e.g., 'https://www.bailii.org/ie/cases/IEHC/2016/H187.html'). Use either case_path or case_url. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-bailii-org-api-d88b79c8/get_case_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"case_path":"<string>","case_url":"<string>"}'
```

### search_cases

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.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `all_words` | string | No | All of these words must appear (space-separated) |
| `any_words` | string | No | Any of these words may appear (space-separated) |
| `date_from` | string | No | Filter results from this date (DD/MM/YYYY format) |
| `date_to` | string | No | Filter results up to this date (DD/MM/YYYY format) |
| `jurisdiction` | string | No | 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'. |
| `page` | integer | No | Page number (1-based) |
| `per_page` | integer | No | Results per page |
| `phrase` | string | No | Exact phrase to search for (e.g., 'negligence') |
| `query` | string | No | Direct search query string (advanced boolean syntax). Use this OR phrase/all_words/any_words. |
| `sort` | string | No | Sort order for results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-bailii-org-api-d88b79c8/search_cases \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"all_words":"<string>","any_words":"<string>","date_from":"<string>","date_to":"<string>","jurisdiction":"<string>","page":"<integer>","per_page":"<integer>","phrase":"<string>","query":"<string>","sort":"<string>"}'
```

### search_cases_rss

Search BAILII cases and return ALL matching results at once (no pagination needed). Uses the RSS feed format for faster retrieval. Returns basic metadata per case (title, citation, court, date, URL). Best for getting a complete list of matching cases. Requires at least one search parameter.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `all_words` | string | No | All of these words must appear (space-separated) |
| `any_words` | string | No | Any of these words may appear (space-separated) |
| `jurisdiction` | string | No | 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'. |
| `phrase` | string | No | Exact phrase to search for |
| `query` | string | No | Direct search query string. Use this OR phrase/all_words/any_words. |
| `sort` | string | No | Sort order for results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-bailii-org-api-d88b79c8/search_cases_rss \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"all_words":"<string>","any_words":"<string>","jurisdiction":"<string>","phrase":"<string>","query":"<string>","sort":"<string>"}'
```
