EU law · 24 official languagesArticle-level JSON · typed citation graphMCP server · Claude, Cursor, VS CodeSDKs · Python, TypeScriptFree plan · 500 credits to start
Brussels · CET
Vol. II·Section S — Solutions Desk
CELEX · ELI · ECLI · EUR-Lex links

§ Identifier resolver — For developers

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.

Create a free accountQuickstart

§ 01 — ECLI

From a judgment’s ECLI to its CELEX number.

You need: curl in bash or zsh, and an API key

Send the identifier as it is. Run this with your key in place of lex_your_key.

curl
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"}'
You get (abridged)
{
  "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, … }
}
  • celex is the number every other endpoint takes.
  • urls holds 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.

Resolve reference

§ 02 — ELI

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
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"}'
You get (abridged)
{
  "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/679 resolves 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 EUR-Lex link carries the CELEX number in its uri parameter, here with the colon URL-encoded as a browser copies it.

curl
You get (abridged)
{
  "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.

§ 04 — Confirmed

Was the match confirmed?


Two fields answer it: resolvedVia says how the number was found, verified whether a lookup confirmed it.

resolvedViaInputverifiedWhat happened
ecli-corpusECLItrueA decision LexAPI holds carries this ECLI.
eli-corpusELItrueAn act LexAPI holds carries exactly this ELI.
eli-cellarELItrueLooked up in the Publications Office’s Cellar register.
eliELIfalseCellar was unreachable; the number was derived from the ELI’s pattern. Resolve it again later.
urlEUR-Lex linkfalseRead off the link. /resolve does not check that the document exists.
celexCELEX numberfalseKept 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.

§ 05 — SDKs and MCP

The same lookup, from your code or your agent.


Install with pip install lexapi-client or npm install @lexapi/client.

Python
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")
TypeScript
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");
}
Both print
ecli 62018CJ0311 ecli-corpus verified
eli 32019D0003(01) eli-cellar verified
url 32016R0679 url not verified

In 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 Code
claude mcp add --transport http lexapi https://mcp.lex-api.com/v1

MCP setup for agents

§ 06 — FAQ

Asked & answered.

N° 01What is the difference between a CELEX number, an ELI and an ECLI?+
A CELEX number is the identifier of a document on EUR-Lex, for example 32016R0679 for the GDPR. An ELI (European Legislation Identifier) is a web address for a piece of legislation, for example http://data.europa.eu/eli/reg/2016/679/oj. An ECLI (European Case Law Identifier) identifies a court decision, for example ECLI:EU:C:2020:559. LexAPI reads documents by CELEX number, and its /resolve endpoint turns an ELI, an ECLI or a EUR-Lex link into one.
N° 02Can I convert an ELI to a CELEX number without a lookup?+
Not reliably. The CELEX number cannot always be derived from the ELI: http://data.europa.eu/eli/dec/2019/166/oj is CELEX 32019D0003(01), not 32019D0166. LexAPI looks the ELI up in the Publications Office’s Cellar register and returns the CELEX number recorded there.
N° 03Why does a valid ECLI return 404?+
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.
N° 04What does verified: false mean in a /resolve answer?+
The CELEX number was read off the identifier without a lookup. That is the case for a CELEX number or a EUR-Lex link, where /resolve does not check that the document exists, and for an ELI resolved from its pattern while Cellar was unreachable.
§ 07 — Next

Keep building.


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