Know when an EU act changes, without polling EUR-Lex.
Put the acts you depend on on a watch list. When one is amended, corrected or repealed, or gets a new consolidated version, LexAPI posts which document changed it to your endpoint, signed. Webhooks are evaluated hourly.
The free plan starts with 500 credits, no card. Your API key is on the dashboard once you confirm your email.
Webhooks need a paid plan. The polling requests on this page work on every plan.
A watch list of acts.
Create a webhook with the CELEX numbers to watch. This one watches the GDPR and the AI Act. Run it with your key in place of lex_your_key and your endpoint in place of the example URL.
curl -X POST "https://lex-api.com/api/v1/webhooks" \
-H "x-api-key: lex_your_key" \
-H "Content-Type: application/json" \
-d '{"name":"GDPR and AI Act watch","url":"https://example.com/lexapi-webhook","watchCelex":["32016R0679","32024R1689"]}'- The answer carries
webhook.secretonce. Store it: you verify deliveries with it. watchCelextakes the CELEX numbers of the acts themselves, not of consolidated versions.urlmust be a public HTTPS endpoint. Redirects are not followed.- A new webhook fires only for documents that appear after it was created.
- Deliveries cost no credits.
The same call with the SDKs
Install with pip install lexapi-client or npm install @lexapi/client.
from lexapi import LexAPI
client = LexAPI(api_key="lex_your_key")
resp = client.webhooks.create("GDPR and AI Act watch", "https://example.com/lexapi-webhook", watch_celex=["32016R0679", "32024R1689"])
print(resp.webhook.id, resp.webhook.status)
print("store this secret:", resp.webhook.secret)import { LexAPI } from "@lexapi/client";
const client = new LexAPI({ apiKey: "lex_your_key" });
const resp = await client.webhooks.create({
name: "GDPR and AI Act watch",
url: "https://example.com/lexapi-webhook",
watchCelex: ["32016R0679", "32024R1689"],
});
console.log(resp.webhook.id, resp.webhook.status);
console.log("store this secret:", resp.webhook.secret);What arrives at your endpoint.
A POST with a JSON body. This delivery reports a new consolidated version of a watched act.
A delivery (abridged){
"event": "watchlist.changes",
"timestamp": "2026-10-05T11:35:50.493Z",
…
"data": {
"count": 1,
"changes": [
{
"watchedCelex": "32008R1272",
"relation": "consolidated_version",
"document": {
"celex": "02008R1272-20270101",
"title": "Regulation (EC) No 1272/2008 of the European Parliament and of the Council of 16 December 2008 on classification, labelling and packaging of substances and mixtures, …",
"documentType": "Consolidated text",
"consolidationDate": "2027-01-01",
"addedAt": "2026-09-29T18:38:19.634Z",
"url": "https://eur-lex.europa.eu/legal-content/EN/ALL/?uri=CELEX:02008R1272-20270101",
…
}
}
]
}
}relationis one ofamended_by,corrected_by,repealed_by,consolidated_version.document.celexis the document that changes the watched act. Read it with the document endpoint.- A consolidated version’s
consolidationDateis the date that version applies from. It can be in the future. - A failed delivery is retried for about 24 hours. Each retry keeps the same
delivery.id: deduplicate on it.
Check the signature before you trust it.
Every delivery carries X-Webhook-Signature: the HMAC-SHA256 of the request body, hex-encoded, keyed with the webhook’s secret. Compute it over the raw body bytes.
const crypto = require('crypto');
const express = require('express');
const app = express();
app.post('/lexapi-webhook', express.raw({ type: 'application/json' }), (req, res) => {
const signature = req.get('X-Webhook-Signature') || '';
const expected = crypto
.createHmac('sha256', process.env.LEXAPI_WEBHOOK_SECRET)
.update(req.body) // raw Buffer — exactly the bytes LexAPI signed
.digest('hex');
// Timing-safe comparison (compare digests as bytes, guard length first)
const a = Buffer.from(expected, 'hex');
const b = Buffer.from(signature, 'hex');
if (b.length !== a.length || !crypto.timingSafeEqual(a, b)) {
return res.status(401).send('invalid signature');
}
const event = JSON.parse(req.body);
// Replay guard: the signed payload carries `timestamp` — reject stale events
if (Math.abs(Date.now() - Date.parse(event.timestamp)) > 5 * 60 * 1000) {
return res.status(401).send('stale event');
}
// …process event…
res.status(200).end(); // respond within 10s — LexAPI times out after that
});The signature covers the body only, and there is no nonce: check timestamp for freshness, as above. Answer with a 2xx within 10 seconds and process the event afterwards.
New documents that match filters.
A webhook can also fire for new documents: give it searchCriteria instead of, or next to, a watch list. This one reports new regulations with both words in the title.
curl -X POST "https://lex-api.com/api/v1/webhooks" \
-H "x-api-key: lex_your_key" \
-H "Content-Type: application/json" \
-d '{"name":"New AI regulations","url":"https://example.com/lexapi-webhook","searchCriteria":{"query":"artificial intelligence","documentType":"regulation"}}'querymatches words of the document title, not the full text. Every term must match.- Other filters:
author,subdomain,dateFrom,dateToandyear. A filter the API cannot apply is refused with a 400, not ignored. - Which documents count as new is decided by when they appeared on EUR-Lex.
dateFrom,dateToandyearfilter on the document date.
Amendments, corrigenda and repeals, by request.
Without a webhook, ask for the edges yourself. This lists what amends, corrects or repeals the AI Act; compare it with the last answer you stored.
curl — changes to one actcurl "https://lex-api.com/api/v1/citations/cited-by/32024R1689?citationType=amendment,corrigendum,repeal&limit=20" \ -H "x-api-key: lex_your_key"
{
"success": true,
"targetDocument": "32024R1689",
"totalEdges": 5,
"citedBy": [
{
"id": "32024R1689R(01)",
"celexNumber": "32024R1689R(01)",
"citations": [
{ "citationType": "corrigendum", "provenance": "cellar", "extractedAt": "2026-11-18T10:09:29.987Z", … }
],
…
},
…
{
"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", "extractedAt": "2026-11-18T10:09:29.987Z", … }
],
…
}
],
"relationSync": { "source": "cellar", "status": "fresh", "syncedAt": "2026-11-18T10:09:30.014Z" },
"credits": { "operation_weight": 1, … }
}Costs 1 credit. relationSync says when these edges were last refreshed; a read refreshes them when they are more than 7 days old.
curl "https://lex-api.com/api/v1/documents/recent?days=2&limit=10" \ -H "x-api-key: lex_your_key"
Costs 3 credits per page of results. days is the look-back window.
Asked & answered.
N° 01How do I get notified when an EU regulation or directive is amended?+
N° 02How soon does a change arrive?+
N° 03How do I know a delivery came from LexAPI?+
N° 04What happens if my endpoint is down?+
Keep building.
- EU law citation graph APIList what an act or judgment cites and what cites, amends, corrects or repeals it, as typed edges.
- EU law on a dateThe consolidated version listed for a date, or the act as published, and one article of it.
- Transposition measures APIThe measures each member state notified to the Commission for an EU directive, by CELEX number.
- 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.