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
Consolidated versions · As published · By date

§ EU law on a date — For developers

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.

Create a free accountQuickstart

§ 01 — Version

Which version for which date.

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

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
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"}'
You get (abridged)
{
  "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.kind is consolidated or as_published, the act as published in the Official Journal.
  • asOfVersion.date is the date the consolidated version carries. It can be earlier than the act’s entry into force, as here.
  • baseCelex names the authentic act. Cite it, not the consolidated version.
  • act.inForceToday is about today. It says nothing about the date you asked for.
  • document takes a CELEX number. For an ELI or a link, resolve it first.
  • Costs 1 credit.

As-of reference

§ 02 — Provision

One article of that version.


Add provision to get the text too: a whole article, an annex, or recitals.

curl
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"}'
You get (abridged)
{
  "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, … }
}
  • provision takes art_17, 17 or Article 17, an annex such as anx_III, or recitals such as rct_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.
§ 03 — Unresolved

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:

curl
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":"2015-01-01","provision":"art_17"}'
You get (abridged)
{
  "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:

asOfReasonWhen
not_yet_adoptednot_yet_in_forceno_longer_in_forceThe date is outside the act’s dates.
amendment_not_consolidatedAn act amending this act may have applied by the date, and no listed version is known to include it.
not_in_languageThe version for the date has no text in the language asked for.
article_not_in_versionWith provision: the version has no such article, annex or recital.
version_list_unavailableversion_lookup_capThe list of versions could not be read, or a lookup limit was reached. Retry.
§ 04 — Limits

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.

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.

Python
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)
TypeScript
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);
}
Both print
32018R1725 art_19 not_yet_adopted
02016R0679-20160504 art_17 resolved
02001R0045-20010201 art_16 resolved

The search costs 5 credits. A version LexAPI does not hold yet is fetched first and charged like a document read.

The search response, field by field

§ 06 — FAQ

Asked & answered.

N° 01How do I get an EU act as it stood on a past date?+
Send the act’s CELEX number and a date to POST /api/v1/legislation/as-of. The answer names the newest consolidated version dated on or before that date, or the act as published in the Official Journal when there is none, and can include one article, annex or recital of it. When that cannot be established, the answer says so and carries no text.
N° 02Is a consolidated version legally binding?+
No. Consolidated versions are documentation without legal force. Only the act as published in the Official Journal is authentic; the answer names it in baseCelex.
N° 03Does the answer say whether a provision applied on that date?+
No. It names the version of the act listed for the date. It does not say whether an individual provision applied on that date: an act can be in force while some of its provisions apply later.
N° 04What if the version cannot be established?+
The answer is still a 200, with asOfResolved: false, a reason in asOfReason and no text. Use a text only when asOfResolved is true.
§ 07 — Next

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.