UK & EU law
Overview
UK Acts and statutory instruments beside EU regulations, directives and decisions — the rules, the penalties, who they bind — searchable by meaning.
- status
- live
- document id
doc_id e.g. eu:32016R0679- citation
[CELEX 32016R0679]
Common calls
Find an EU regulationPOST /v1/uk_eu_law/search {"query": "personal data", "filters": {"jurisdiction": "eu", "kind": "REG"}}
UK statutes that carry penaltiesPOST /v1/uk_eu_law/search {"query": "数据保护", "filters": {"jurisdiction": "uk", "norm_types": "penalty"}}
Read oneGET /v1/uk_eu_law/read/eu:32016R0679
Vectors plus words. mode is hybrid by default, or dense, bm25, keyword. A filter on date or title, a sort, or mode=keyword sends the whole query to the keyword store, where several words are ANDed. Each hit carries layer.
What is not here, and what is not said. UK legislation that exists only as a scanned PDF, and entries before 1837 with no text, are left out. EU instruments carry no in-force status — status is always empty for them — so check EUR-Lex before relying on one.
Show the attribution. Wherever this data is displayed, carry corpus.attribution with it: EU material: © European Union, https://eur-lex.europa.eu. UK material: contains public sector information licensed under the Open Government Licence v3.0.
The fine print
- Division of labour with us_law: us_law holds **US** provisions in force (CFR / USC, clause level); uk_eu_law holds **UK statutes and EU instruments** (whole-instrument level). All three jurisdictions share one closed norm_types set, so 'find every data-protection instrument that carries penalties' is one question across domains.
- **The full text is not in Postgres**: path in level=detail points at the original on NAS, and source_url is the official link (EUR-Lex / legislation.gov.uk). So this domain has no level=full — fetch the text from source_url.
- summary_zh exists for about 92%; the other 8% have only the English summary. Both are model-written — not quotes.
- status is meaningful only for UK law (set when the title carries '(repealed)'); EU instruments are always empty, so do not filter EU material on status — it would exclude everything.
- subjects is an open model-generated label set and is not filterable before normalisation; filter on norm_types instead.
- Display requires attribution (see the attribution field): © European Union for the EU part, Open Government Licence v3.0 for the UK part.
- Two search paths: with a query, no sort and only filters the vector layer has (not date / title), search is hybrid vector + lexical (semantic recall, terms need not all match), topped up from Postgres; otherwise (sort given, date / title used, or mode=keyword) it runs in Postgres as an English tsvector and a Chinese zhparser pass whose results are unioned — quoted phrases / OR / -exclusion work, and **terms are ANDed**, so prefer fewer terms plus filters. Each hit's layer says which layer it came from.
- Model-written fields (summarise, do not quote): cross_references, deadlines, defined_terms, norm_types, penalties, regulated_parties, subjects, summary, summary_zh.
- The field table and enumerations are generated from the store's own self-description (search.field), not hand-written; enumeration counts are as of 2026-10-15.
Search
POST/v1/uk_eu_law/search
Hybrid retrieval, one card per hit. 2 credits. Free sample:
data protection.
Filter fields
| field | type · ops | meaning |
|---|
| date | datetime · range | Date adopted or signed, range |
| jurisdiction | keyword · eq anyeu · uk | uk (about 9.3k) or eu (about 42.4k) |
| kind | keyword · eq anyREG · REG_IMPL · DEC · nisr · ukpga · DIR … 12 values, /facets lists them all | Instrument type. EU: REG / REG_IMPL / DEC / DIR / DIR_IMPL. UK: ukpga (Act of Parliament) / asp (Scotland) / nia (Northern Ireland) / asc (Wales) / nisr / ssi / ukla |
| norm_types | keyword · eq any | Norm type (same closed set as us_law): obligation / prohibition / permission_or_authority / definition / procedure / penalty / effective_date_or_transition … (several allowed) |
| status | keyword · eq anyrepealed | repealed means repealed (the title carries '(repealed)'); empty means in force or unknown. **EU instruments carry no status information — always empty** |
| year | integer · range | Year, range |
1 more, all usable
| field | type · ops | meaning |
|---|
| title | text · text | Title (full-text match) |
Parameters
| Parameter | Type | Description |
| query REQUIRED | string | 1–1000 characters. Or an array of up to 5 (batch; hits become results[]). |
| top_k | integer= 10 | 1–200. |
| fields | brief · head= brief | head costs one more credit and returns the head view per hit. |
| filters | json | Filter DSL object (see Getting started); declared fields are listed above. |
| mode | hybrid · dense · bm25 · keyword= hybrid | Retrieval mode. Leave it out to use the first. |
| sort | relevance · date · date= relevance | Order of the hits. |
| offset | integer= 0 | Pagination. |
Example
{ "domain": "uk_eu_law", "query": "…", "hits": [ { "id": "eu:32016R0679", "score": 0.83, "brief": { … } } ], "total": null, "coverage": …, "warnings": [],
"meta": { "request_id": "req_…", "credits": { "charged": 2, "balance": 1998, "pool": "allowance" }, "latency_ms": 41, "cached": false } } Two layers. 51,752 documents carry vectors; the store behind them holds 51,752. Hits carry layer: index | pg — pg means the match was by words, not meaning — and coverage says which layer answered (answered_by) and why a fallback did not happen (no_fallback_because). Filters that only one layer has cannot be mixed; the 400 names which belongs where.
Undeclared filter fields return 400 rather than being ignored silently. Filters combine with AND; _or / _not are available.
Read
GET/v1/uk_eu_law/read/{doc_id}
Three depths.
detail is the default. Free sample:
eu:32016R0679.
Levels
| level | credits | returns |
|---|
| brief | 1 | Card: citation, date, doc_id, jurisdiction, kind, norm_types, status, summary… |
| detail (default) | 2 | Every structured field (card plus the source abstract and detail fields) |
Parameters
| Parameter | Type | Description |
| doc_id (path) REQUIRED | string | Document id (doc_id). |
| level | brief · detail= detail | How deep to read. |
| format | json · md · html= json | Response shape. |
Example
{ "domain": "uk_eu_law", "id": "eu:32016R0679", "level": "detail", "view": "detail", "data": { … } | "text": "…", "token_count": 1834, "meta": { … } } The older GET /v1/uk_eu_law/doc/{id}?view=… still works.
Read many
POST/v1/uk_eu_law/read
Up to 50 ids, one level. Missing ids come back with error: "not_found" and are not charged.
Parameters
| Parameter | Type | Description |
| ids REQUIRED | string[] | Document ids. |
| level | brief · detail= detail | Level for every id. |
Example
{ "domain": "uk_eu_law", "level": "detail", "docs": [ { "id": "…", "data": { … } }, { "id": "…", "error": "not_found" } ], "meta": { … } } Facets
GET/v1/uk_eu_law/facets?field={field}
Legal values for a filter field, so an agent never guesses; precomputed fields carry counts, declared enums come without. Free, no key.
Parameters
| Parameter | Type | Description |
| field REQUIRED | jurisdiction · kind · status | Filter field with facets. |
| limit | integer= 50 | Max values. |
Example
{ "domain": "uk_eu_law", "field": "…", "values": [ { "value": "…", "count": 3120 } ], "meta": { … } } Askregistered key+ /stream
POST/v1/uk_eu_law/ask
Agentic Q&A over this domain: hybrid vector + lexical search (filters the vector layer lacks fall back to Postgres full text); the model reads the hits and answers with [uk_eu_law: ] citations; /stream is NDJSON with real token deltas. effort low / medium / high = 50 / 100 / 200 credits. Append /stream for NDJSON; the first event is always billing. A failure before the first answer_delta is refunded.
Parameters
| Parameter | Type | Description |
| query REQUIRED | string | 1–2000 characters. Be specific; ask for numbers if you want numbers. |
| effort | low · medium · high= low | Reading rounds, and the price: 50 / 100 / 200 credits. Your plan caps it. |
| verbose | bool= false | Include the tool-call trace (tool_call / tool_result / thinking events when streaming). |
| top_k | integer= 10 | Speculative prefetch size. |
| stream_answer | bool= true | Streaming only: false emits one answer event instead of deltas. |
| max_rounds | integer | 0–8, overrides the effort preset. |
| force_answer_after | number | Seconds; hard cutover into the answer phase. |
| max_answer_tokens | integer= 4096 | Hitting it sets answer_truncated. |
| language | string | Answer language; defaults to the query’s. |
Example
{ "answer": "… [CELEX 32016R0679] …", "sources": [ … ], "stats": { "rounds": 1, "elapsed_s": 6.2, "answer_truncated": false }, "coverage"?: { … }, "meta": { "credits": { "charged": 50, … } } } Citations are real — every id in answer exists in this domain (format [CELEX 32016R0679]). sources is the retrieval set, not the citation list. answer_truncated means incomplete.