# Statutes

> The current text of laws from official sources, how to find and read them, and the Taiwan judgments and retrieval routes.

Page: https://docs.aggre.org/datasets/legal-statutes · Section: Datasets · All pages: https://docs.aggre.org/llms.txt

Statutes and regulations as the official sources publish them: **current version only**, with provisions, attachments, licence and attribution. Reference: [Legal routes](https://docs.aggre.org/api/data/legal.md).

## Datasets {#datasets}

| Dataset | `instrument_id` prefix | Publisher |
|---|---|---|
| `legal.statutes.tw_moj` | `TW:MOJ:` | Ministry of Justice, Laws & Regulations Database (Traditional Chinese and English; laws and orders, each language a separate record) |
| `legal.statutes.jp_egov` | `JP:EGOV:` | e-Gov Laws and Regulations Search |
| `legal.statutes.uk_legislation` | `UK:LEG:` | legislation.gov.uk |
| `legal.statutes.ca_laws` | `CA:JUSTICE:` | Justice Laws Website |
| `legal.statutes.eu_eurlex` | `EU:EURLEX:` | EUR-Lex (regulations, directives, decisions) |
| `legal.statutes.us_ecfr` | `US:ECFR:` | Electronic Code of Federal Regulations (federal regulations, not acts of Congress) |
| `legal.statutes.de_gii` | `DE:GII:` | Gesetze im Internet (federal law) |
| `legal.statutes.au_federal` | `AU:FEDERAL:` | Federal Register of Legislation |
| `legal.statutes.sg_sso` | `SG:SSO:` | Singapore Statutes Online. **Not collected**: no official API or open-data licence. Where such text is ever served it is `restricted` and must carry attribution. |
| `legal.statutes.cn_flk` | `CN:FLK:` | National Database of Laws and Regulations. **Not collected**: no published API and terms not reviewed. |

An instrument id may contain `:` and `/`, for example `UK:LEG:ukpga/2020/1` or `TW:MOJ:A0000001:en`.

## Routes {#routes}

All need an API key and are strict about parameters.

| Route | Returns |
|---|---|
| `GET /v1/legal/statutes/instruments` | A list of instruments without provisions or foreword |
| `GET /v1/legal/statutes/instruments/{instrument_id}` | One instrument with foreword, provisions and attachments (up to 5000 provisions per call) |
| `GET /v1/legal/statutes/instruments/{instrument_id}/provisions` | Only the provisions, paged |

The id goes in the path raw or percent-encoded. A path ending in `/provisions` is always the provisions route, so no source id ends that way. A malformed id is `400`, a well-formed id that does not exist is `404`.

### Listing {#listing}

Filters combine with AND: `dataset`, `jurisdiction` (two uppercase letters), `language` (`zh-Hant`, `en`, `ja`, ...), `kind` (`act`, `regulation`, `order`, `treaty`, `other`), `status` (`in_force`, `repealed`, `abandoned`, `withdrawn`), `q` (title **contains**, case-insensitive, 1 to 200 characters; a directory filter, not full-text search), `updated_since` (`YYYY-MM-DD` or RFC 3339), `include_removed`. Order is fixed by `instrument_id`; `limit` is 1 to 200, default 50. The cursor is the last `instrument_id`.

To follow changes, combine `updated_since` with `include_removed=true`: marking an instrument as gone from its source updates `updated_at`.

### Reading provisions {#provisions}

The detail route returns at most 5000 provisions; for a longer instrument `provisions_truncated` is `true` and `next_from_seq` says where to continue with the provisions route. The provisions route takes `from_seq` (default 0) or `cursor` (not both), `number` and `limit` (1 to 1000, default 500).

`number` finds an article. Write it as the original (`第 184 條`, `Article 15-1`), or as an article key: `184`, `184-1`, `184之1`, `第184條之1`, `Article 184` and leading zeros all mean the same key, and `184` does not match `184-1` or `1840`. The returned `number` is always the original text. A provision with no numbering (such as `附則`) matches only its exact text. A `from_seq` past the last provision returns `200` with an empty array.

## Licence, attribution and restrictions {#licence}

Each instrument has `license`, `attribution` and `restricted`; the response `meta` repeats them de-duplicated (`licenses`, `attribution`, `restricted` when any instrument is restricted). Provision rows carry none of these: use `meta`. If an instrument is restricted you must show its attribution and the reminder to check the latest version at the source. Licence and attribution strings come from each publisher's terms ([Attribution](https://docs.aggre.org/concepts/attribution.md)).

An instrument its source stopped listing is still served (`removed_on` set, with a message saying the content is the last version seen).

## Judgments and retrieval {#judgments-and-retrieval}

Taiwan judgments and semantic retrieval are served by a separate set of routes, registered in the same API:

| Route | Purpose |
|---|---|
| `GET /v1/legal/judgments/lookup` | Find a judgment by its citation |
| `GET /v1/legal/judgments/{jid}` | Read a judgment |
| `POST /v1/legal/judgments/{jid}/search` | Find where in one judgment a question is answered |
| `GET`/`POST /v1/legal/judgments/{jid}/outline` | The map of one judgment |
| `POST /v1/legal/judgments/search` | Search case law by the court's own reasoning |
| `POST /v1/legal/retrieve`, `POST /v1/legal/retrieve/batch` | Retrieval over the legal corpora |

Judgment routes can answer `501 corpus_not_migrated` while a corpus is not loaded, `410 taken_down`, `503 index_unavailable` and `503 retrieval_unavailable` ([Errors](https://docs.aggre.org/concepts/errors.md)). The per-route reference for these is not generated on this site yet; the argument lists of the [MCP compatibility tools](https://docs.aggre.org/agents/mcp.md) (`retrieve`, `search_judgments`, `lookup_judgment`, `get_judgment`, `search_in_judgment`, `judgment_outline`) describe the same operations.

Retrieval is a ranked search over a bounded index, and its responses carry a `coverage` object that says how the ranking was done (for example `coverage.rerank=bm25_fallback` when the reranker was unavailable and results are in lexical order). Read `coverage` before treating an empty result as proof that nothing matches.
