What an EU act said on the date you care about.
Send an EU act and a date. You get the version listed for that date: the newest consolidated version dated on or before it, or the act as published in the Official Journal when there is none. Consolidated versions are documentation without legal force.
The free plan starts with 500 credits, no card. Your API key is on the dashboard once you confirm your email.
Which version for which date.
This asks which version of the GDPR is listed for 1 June 2019. Run it with your key in place of lex_your_key.
curl -X POST "https://lex-api.com/api/v1/legislation/as-of" \
-H "x-api-key: lex_your_key" \
-H "Content-Type: application/json" \
-d '{"document":"32016R0679","asOf":"2019-06-01"}'{
"success": true,
"document": "32016R0679",
"language": "en",
"asOf": "2019-06-01",
"asOfResolved": true,
"asOfVersion": { "celex": "02016R0679-20160504", "kind": "consolidated", "date": "2016-05-04" },
"act": {
"celex": "32016R0679",
"dateOfDocument": "2016-04-27",
"entryIntoForce": "2016-05-24",
"inForceToday": true
},
"consolidated": true,
"consolidatedAsOf": "2016-05-04",
"baseCelex": "32016R0679",
"consolidatedNote": "The act as amended, consolidated as of 2016-05-04; not the authentic text. Only the act as published in the Official Journal is authentic (32016R0679).",
"provenance": {
"sourceIdentifier": "02016R0679-20160504",
"versionIdentifier": "02016R0679-20160504",
…
},
"credits": { "operation_weight": 1, … }
}asOfVersion.kindisconsolidatedoras_published, the act as published in the Official Journal.asOfVersion.dateis the date the consolidated version carries. It can be earlier than the act’s entry into force, as here.baseCelexnames the authentic act. Cite it, not the consolidated version.act.inForceTodayis about today. It says nothing about the date you asked for.documenttakes a CELEX number. For an ELI or a link, resolve it first.- Costs 1 credit.
One article of that version.
Add provision to get the text too: a whole article, an annex, or recitals.
curl -X POST "https://lex-api.com/api/v1/legislation/as-of" \
-H "x-api-key: lex_your_key" \
-H "Content-Type: application/json" \
-d '{"document":"32016R0679","asOf":"2019-06-01","provision":"art_17"}'{
"success": true,
"document": "32016R0679",
"asOf": "2019-06-01",
"asOfResolved": true,
"asOfVersion": { "celex": "02016R0679-20160504", "kind": "consolidated", "date": "2016-05-04" },
"provision": {
"id": "art_17",
"number": "Article 17",
"title": "Right to erasure (‘right to be forgotten’)",
"text": "1. The data subject shall have the right to obtain from the controller the erasure of personal data concerning him or her without undue delay …"
},
"consolidated": true,
"baseCelex": "32016R0679",
…
"credits": { "operation_weight": 1, … }
}provisiontakesart_17,17orArticle 17, an annex such asanx_III, or recitals such asrct_26. Paragraphs and points are not addressable.- Costs 1 credit when LexAPI already holds the version’s text, 4 or 5 when the text is fetched from the source first.
When there is no answer.
When the version or the text cannot be established, the answer is still a 200. It carries a reason and no text. The GDPR on a date before it was adopted:
curlcurl -X POST "https://lex-api.com/api/v1/legislation/as-of" \
-H "x-api-key: lex_your_key" \
-H "Content-Type: application/json" \
-d '{"document":"32016R0679","asOf":"2015-01-01","provision":"art_17"}'{
"success": true,
"document": "32016R0679",
"asOf": "2015-01-01",
"asOfResolved": false,
"asOfReason": "not_yet_adopted",
"act": {
"celex": "32016R0679",
"dateOfDocument": "2016-04-27",
"entryIntoForce": "2016-05-24",
"inForceToday": true
},
…
"credits": { "operation_weight": 1, … }
}Use a text only when asOfResolved is true. Some of the reasons:
| asOfReason | When |
|---|---|
not_yet_adoptednot_yet_in_forceno_longer_in_force | The date is outside the act’s dates. |
amendment_not_consolidated | An act amending this act may have applied by the date, and no listed version is known to include it. |
not_in_language | The version for the date has no text in the language asked for. |
article_not_in_version | With provision: the version has no such article, annex or recital. |
version_list_unavailableversion_lookup_cap | The list of versions could not be read, or a lookup limit was reached. Retry. |
What it does not say.
- It does not say whether an individual provision applied on the date. An act can be in force while some of its provisions apply later.
- A consolidated version is documentation without legal force. Only the act as published in the Official Journal is authentic.
- LexAPI mirrors the official consolidated versions. It does not reconstruct texts.
- When no consolidated version is listed for the date, the answer is the act as published, without later corrigenda.
- It covers acts of the institutions: regulations, directives, decisions. Not treaties, not case law.
Search on a date.
The SDKs have no method for /legislation/as-of yet: call it over HTTP, as above. They do take a date on semantic search, which answers each hit with the version for that date. Install with pip install lexapi-client or npm install @lexapi/client.
from lexapi import LexAPI
client = LexAPI(api_key="lex_your_key")
search = client.semantic_legislation_search("right to erasure of personal data", limit=3, as_of="2017-01-01")
for hit in search.results:
print(hit.law_id, hit.article_ref, "resolved" if hit.as_of_resolved else hit.as_of_reason)import { LexAPI } from "@lexapi/client";
const client = new LexAPI({ apiKey: "lex_your_key" });
const search = await client.semanticLegislationSearch({
query: "right to erasure of personal data",
limit: 3,
asOf: "2017-01-01",
});
for (const hit of search.results) {
console.log(hit.law_id, hit.article_ref, hit.asOfResolved ? "resolved" : hit.asOfReason);
}32018R1725 art_19 not_yet_adopted
02016R0679-20160504 art_17 resolved
02001R0045-20010201 art_16 resolvedThe search costs 5 credits. A version LexAPI does not hold yet is fetched first and charged like a document read.
Asked & answered.
N° 01How do I get an EU act as it stood on a past date?+
N° 02Is a consolidated version legally binding?+
N° 03Does the answer say whether a provision applied on that date?+
N° 04What if the version cannot be established?+
Keep building.
- European legal RAGSemantic search to article text with provenance, citations and the text for a date.
- GDPR APIRead the GDPR by article or recital, cite it, and list what corrects or amends it.
- EU law change monitoringA signed webhook when a watched act is amended, corrected, repealed or consolidated.
- 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.