An ECLI, an ELI or a link in, a CELEX number out.
LexAPI reads documents by CELEX number. Users paste everything else: a case-law identifier, a legislation identifier, a link from the browser. One call turns each into the CELEX number and says whether the match was confirmed by a lookup.
The free plan starts with 500 credits, no card. Your API key is on the dashboard once you confirm your email.
From a judgment’s ECLI to its CELEX number.
Send the identifier as it is. Run this with your key in place of lex_your_key.
curl -X POST "https://lex-api.com/api/v1/resolve" \
-H "x-api-key: lex_your_key" \
-H "Content-Type: application/json" \
-d '{"identifier":"ECLI:EU:C:2020:559"}'{
"success": true,
"identifier": "ECLI:EU:C:2020:559",
"identifierType": "ecli",
"resolvedVia": "ecli-corpus",
"verified": true,
"celex": "62018CJ0311",
"urls": {
"html": "https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:62018CJ0311",
…
},
"credits": { "operation_weight": 1, … }
}celexis the number every other endpoint takes.urlsholds the document’s EUR-Lex links: metadata, HTML, PDF and XML.- An ECLI resolves only for a decision LexAPI already holds. A 404 for a valid ECLI is not proof that the decision does not exist.
- Each call costs 1 credit, on every plan. A 404 costs the credit; a 400 is refunded.
An ELI is looked up, not guessed.
The CELEX number cannot always be derived from an ELI. This decision’s ELI ends in 2019/166; its CELEX number does not.
curl -X POST "https://lex-api.com/api/v1/resolve" \
-H "x-api-key: lex_your_key" \
-H "Content-Type: application/json" \
-d '{"identifier":"http://data.europa.eu/eli/dec/2019/166/oj"}'{
"success": true,
"identifier": "http://data.europa.eu/eli/dec/2019/166/oj",
"identifierType": "eli",
"resolvedVia": "eli-cellar",
"verified": true,
"celex": "32019D0003(01)",
"urls": {
"html": "https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32019D0003(01)",
…
},
"credits": { "operation_weight": 1, … }
}resolvedVia: "eli-cellar"means the Publications Office’s Cellar register was asked.- The host,
/oj, and the language and format segments are optional:eli/reg/2016/679resolves too. - A corrigendum’s ELI resolves to the corrigendum’s own CELEX number, a consolidated version’s ELI to that version.
- An ELI Cellar has no work for answers 404.
A link from the browser, pasted as it is.
A EUR-Lex link carries the CELEX number in its uri parameter, here with the colon URL-encoded as a browser copies it.
curl -X POST "https://lex-api.com/api/v1/resolve" \
-H "x-api-key: lex_your_key" \
-H "Content-Type: application/json" \
-d '{"identifier":"https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX%3A32016R0679"}'{
"success": true,
"identifier": "https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX%3A32016R0679",
"identifierType": "url",
"resolvedVia": "url",
"verified": false,
"celex": "32016R0679",
"urls": {
"html": "https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679",
…
},
"credits": { "operation_weight": 1, … }
}verified is false: the number was read off the link, and /resolve does not check that the document exists. Reading the document does.
Was the match confirmed?
Two fields answer it: resolvedVia says how the number was found, verified whether a lookup confirmed it.
| resolvedVia | Input | verified | What happened |
|---|---|---|---|
ecli-corpus | ECLI | true | A decision LexAPI holds carries this ECLI. |
eli-corpus | ELI | true | An act LexAPI holds carries exactly this ELI. |
eli-cellar | ELI | true | Looked up in the Publications Office’s Cellar register. |
eli | ELI | false | Cellar was unreachable; the number was derived from the ELI’s pattern. Resolve it again later. |
url | EUR-Lex link | false | Read off the link. /resolve does not check that the document exists. |
celex | CELEX number | false | Kept as given. /resolve does not check that the document exists. |
An identifier that cannot be resolved answers 404. An ELI that cannot be checked because Cellar is unreachable, and has no pattern to fall back on, answers 502.
The same lookup, from your code or your agent.
Install with pip install lexapi-client or npm install @lexapi/client.
from lexapi import LexAPI
client = LexAPI(api_key="lex_your_key")
identifiers = [
"ECLI:EU:C:2020:559",
"http://data.europa.eu/eli/dec/2019/166/oj",
"https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX%3A32016R0679",
]
for identifier in identifiers:
resp = client.resolve(identifier)
print(resp.identifier_type, resp.celex, resp.resolved_via, "verified" if resp.verified else "not verified")import { LexAPI } from "@lexapi/client";
const client = new LexAPI({ apiKey: "lex_your_key" });
const identifiers = [
"ECLI:EU:C:2020:559",
"http://data.europa.eu/eli/dec/2019/166/oj",
"https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX%3A32016R0679",
];
for (const identifier of identifiers) {
const resp = await client.resolve(identifier);
console.log(resp.identifierType, resp.celex, resp.resolvedVia, resp.verified ? "verified" : "not verified");
}ecli 62018CJ0311 ecli-corpus verified
eli 32019D0003(01) eli-cellar verified
url 32016R0679 url not verifiedIn an MCP client
The MCP server has the same lookup as the tool lex_resolve. Connect Claude Code, then ask: Using LexAPI, what is the CELEX number of ECLI:EU:C:2020:559?
claude mcp add --transport http lexapi https://mcp.lex-api.com/v1
Asked & answered.
N° 01What is the difference between a CELEX number, an ELI and an ECLI?+
N° 02Can I convert an ELI to a CELEX number without a lookup?+
N° 03Why does a valid ECLI return 404?+
N° 04What does verified: false mean in a /resolve answer?+
Keep building.
- EU law citation graph APIList what an act or judgment cites and what cites, amends, corrects or repeals it, as typed edges.
- European case law APISearch Court of Justice case law by meaning, resolve an ECLI, read the judgment.
- Legal data API for AI agentsThe MCP server, hosted or local, the REST API and the SDKs, all on the same credit pool.
- QuickstartA first request by curl, MCP, Python and TypeScript.
- API referenceEvery endpoint, parameter, response field and error.
- MCP serverSetup for Claude, Cursor and VS Code, and the tool list.
- PricingPlans, credit pools and what each call costs.
LexAPI returns source texts and their identifiers. It does not assess compliance and gives no legal advice.