EU law without writing SPARQL: one REST call, JSON back.
The Publications Office’s Cellar repository has a SPARQL endpoint. For the common questions, such as an act’s dates and identifiers or what amends it, LexAPI answers with one REST call and JSON. It does not replace the endpoint, and this page says where.
The free plan starts with 500 credits, no card. Your API key is on the dashboard once you confirm your email.
An act’s dates and identifiers, two ways.
The question: when was the AI Act adopted, when was it published, and what is its ELI? In SPARQL, sent to https://publications.europa.eu/webapi/rdf/sparql:
PREFIX cdm: <http://publications.europa.eu/ontology/cdm#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?dateOfDocument ?ojPublished ?eli WHERE {
?work cdm:resource_legal_id_celex "32024R1689"^^xsd:string ;
cdm:work_date_document ?dateOfDocument ;
cdm:official-journal-act_date_publication ?ojPublished ;
cdm:resource_legal_eli ?eli .
}
# → 2024-06-13, 2024-07-12, http://data.europa.eu/eli/reg/2024/1689/ojWith LexAPI, by CELEX number. Run this with your key in place of lex_your_key.
curl -X POST "https://lex-api.com/api/v1/documents/metadata" \
-H "x-api-key: lex_your_key" \
-H "Content-Type: application/json" \
-d '{"celexNumber":"32024R1689"}'{
"success": true,
"metadata": {
"celex": "32024R1689",
"title": "Regulation (EU) 2024/1689 … laying down harmonised rules on artificial intelligence … (Artificial Intelligence Act) …",
"documentType": "Regulation",
"author": "Council of the European Union, European Parliament",
"dateOfDocumentISO": "2024-06-13",
"dateOfEffectISO": "2024-08-01",
"dateOfPublicationISO": "2024-07-12",
"eli": "http://data.europa.eu/eli/reg/2024/1689/oj",
"urls": {
"html": "https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32024R1689",
…
},
"inForce": true,
…
},
"credits": { "operation_weight": 1, … }
}- The three values of the query are
dateOfDocumentISO,dateOfPublicationISOandeli. - A field LexAPI could not fill is
nullor left out. - Costs 1 credit when LexAPI already holds the document, 4 or 5 when it is fetched from the source first.
What amends an act, without a graph pattern.
In Cellar, an amendment is a relation between two works that you match in a query. Here it is a filter on one call.
curl — LexAPIcurl "https://lex-api.com/api/v1/citations/cited-by/32024R1689?citationType=amendment&limit=20" \ -H "x-api-key: lex_your_key"
{
"success": true,
"targetDocument": "32024R1689",
"totalEdges": 1,
"citedBy": [
{
"id": "32026R1744",
"celexNumber": "32026R1744",
"title": "Regulation (EU) 2026/1744 of the European Parliament and of the Council of 8 July 2026 amending Regulations (EU) 2024/1689, (EU) 2018/1139 and (EU) 2023/1230 … (Digital Omnibus on AI) …",
"citations": [
{ "citationType": "amendment", "provenance": "cellar", "resolution": null, … }
],
…
}
],
"relationSync": { "source": "cellar", "status": "fresh", "syncedAt": "2026-11-18T10:09:30.014Z" },
"credits": { "operation_weight": 1, … }
}Amendments, corrigenda and repeals of legislation are read from Cellar; relationSync says when. A short or empty list is not proof that nothing amends the act. Costs 1 credit.
What SPARQL does that LexAPI does not.
- Arbitrary queries. The endpoint answers any query you can write over the whole Cellar graph. LexAPI answers the questions its endpoints were built for, and no others.
- Data LexAPI does not hold. Cellar records more about each document, and more documents, than LexAPI mirrors. If a field is not in a LexAPI response, the endpoint is where to look.
- The source itself. LexAPI reads Cellar for part of its data: an answer here is as current as LexAPI’s last read, and the Publications Office’s record is the reference.
- No account. The endpoint is open and run by the Publications Office of the European Union. LexAPI is a commercial service and is not affiliated with it.
Which one for what.
| Topic | Cellar SPARQL | LexAPI |
|---|---|---|
| Questions | Any query you can write over the whole Cellar graph. | A fixed set of endpoints: read, resolve, search, citations, versions. |
| Data | Everything the Publications Office records, including what LexAPI does not hold. | The documents and relations LexAPI holds or fetches on request. |
| Document text | Not searchable; titles are. | Parsed to articles, recitals and annexes, and searchable by meaning. |
| Answer | SPARQL results (bindings or RDF). | JSON with one shape per endpoint, described in an OpenAPI spec. |
| Access | Anonymous; run by the Publications Office. | An API key; a commercial service, not affiliated with the Publications Office. |
Asked & answered.
N° 01Does EUR-Lex have a SPARQL endpoint?+
N° 02Is LexAPI a replacement for the Cellar SPARQL endpoint?+
N° 03How do I get the metadata of an EU act without SPARQL?+
N° 04Is LexAPI affiliated with the Publications Office?+
Keep building.
- CELEX, ELI & ECLI resolverTurn an ECLI, an ELI or a pasted EUR-Lex link into a CELEX number, and see whether the match was confirmed.
- EU law citation graph APIList what an act or judgment cites and what cites, amends, corrects or repeals it, as typed edges.
- EUR-Lex Python clientlexapi-client on PyPI: read articles, follow citations and handle errors, with typed objects.
- 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.