The GDPR as JSON, one article at a time.
LexAPI returns the General Data Protection Regulation as structured JSON: any article or recital by number, with the identifiers to cite it by and the documents that correct or amend it.
The free plan starts with 500 credits, no card. Your API key is on the dashboard once you confirm your email.
The GDPR is CELEX 32016R0679. Ask for one article with articleId; run this with your key in place of lex_your_key.
curl -X POST "https://lex-api.com/api/v1/documentContent" \
-H "x-api-key: lex_your_key" \
-H "Content-Type: application/json" \
-d '{"celexNumber":"32016R0679","articleId":"6","include":["metadata","articles"]}'{
"success": true,
"document": {
"celex": "32016R0679",
"language": "en",
"title": "Regulation (EU) 2016/679 … (General Data Protection Regulation) …",
"eli": "http://data.europa.eu/eli/reg/2016/679/oj",
"inForce": true,
"urls": {
"html": "https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679",
…
},
"provenance": {
"sourceUrl": "https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0679",
"versionIdentifier": "32016R0679",
…
},
"content": {
"articles": [
{
"id": "art_6",
"number": "Article 6",
"title": "Lawfulness of processing",
"content": "1. Processing shall be lawful only if and to the extent that at least one of the following applies: (a) the data subject has given consent …"
}
]
},
…
},
"credits": { "operation_weight": 1, … }
}articleIdtakes6,art_6orArticle 6.- Cite the article by
document.celex, the articlenumber,document.eliand the EUR-Lex link indocument.urls.html. inForcesays whether the act is in force today, from the records of the Publications Office of the EU. It is left out when the status is unknown, and it does not cover amendments.
Costs 1 credit when LexAPI already holds the document, 4 or 5 when it is fetched from the source first. credits.operation_weight is what you were charged.
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.get_document("32016R0679", include=["metadata", "articles"], article_id="6")
article = resp.document.content.articles[0]
print(resp.document.celex, "-", article.number, "-", article.title)
print(article.content[:120])import { LexAPI } from "@lexapi/client";
const client = new LexAPI({ apiKey: "lex_your_key" });
const resp = await client.getDocument({
celexNumber: "32016R0679",
include: ["metadata", "articles"],
articleId: "6",
});
const article = resp.document.content?.articles?.[0];
console.log(resp.document.celex, "-", article?.number, "-", article?.title);
console.log(article?.content?.slice(0, 120));32016R0679 - Article 6 - Lawfulness of processing
1. Processing shall be lawful only if and to the extent that at least one of the following applies: (a) the data subjectThe recitals, numbered.
include trims the response to the parts you name. With recitals you get the preamble as a list, each recital with its number and text.
curl -X POST "https://lex-api.com/api/v1/documentContent" \
-H "x-api-key: lex_your_key" \
-H "Content-Type: application/json" \
-d '{"celexNumber":"32016R0679","include":["recitals"]}'{
"success": true,
"document": {
"celex": "32016R0679",
"language": "en",
"content": {
"recitals": [
{
"number": 1,
"text": "The protection of natural persons in relation to the processing of personal data is a fundamental right. …"
},
{
"number": 2,
"text": "The principles of, and rules on the protection of natural persons with regard to the processing of their personal data should, whatever their nationality or residence, respect their fundamental rights and freedoms, …"
},
…
]
},
…
},
"credits": { "operation_weight": 1, … }
}The other parts are metadata, fullText, articles, paragraphs, sections, tables and annexes. Same cost as any document read.
What corrects or amends it.
The citation graph lists the documents that point at an act. Filter by edge type with citationType; this asks for the corrigenda and amendments of the GDPR.
curl "https://lex-api.com/api/v1/citations/cited-by/32016R0679?citationType=corrigendum,amendment&limit=20" \ -H "x-api-key: lex_your_key"
{
"success": true,
"targetDocument": "32016R0679",
"totalEdges": 3,
"citedBy": [
…
{
"id": "32016R0679R(02)",
"documentKind": "act",
"celexNumber": "32016R0679R(02)",
"title": "Corrigendum to Regulation (EU) 2016/679 … (General Data Protection Regulation) (OJ L 119, 4.5.2016)",
"citations": [
{ "citationType": "corrigendum", "provenance": "cellar", "resolution": null, … }
],
…
},
…
],
"relationSync": { "source": "cellar", "status": "fresh", "syncedAt": "2026-11-17T22:07:51.645Z" },
…
}- Edge types:
reference,amendment,repeal,corrigendum,implementation,legal-basis,proposal,transposition. - Amendments, corrigenda and repeals of legislation come from the Publications Office’s Cellar repository;
relationSyncsays how fresh they are. reference,implementation,legal-basisandproposaledges come from the documents LexAPI has extracted, so a short or empty list is not proof that nothing cites the act.- For what the GDPR itself cites, call
/citations/cites/32016R0679. Either list costs 1 credit.
Edge types, their sources and the other direction: EU law citation graph API.
Consolidated or authentic.
32016R0679 is the GDPR as published in the Official Journal, the authentic act. LexAPI serves its wording as extracted from EUR-Lex (see fieldProvenance). A CELEX number that starts with 0 is a consolidated text: the act with its amendments integrated, published by the Publications Office as documentation, without legal force.
curl -X POST "https://lex-api.com/api/v1/documentContent" \
-H "x-api-key: lex_your_key" \
-H "Content-Type: application/json" \
-d '{"celexNumber":"02016R0679-20160504","articleId":"17","include":["articles"]}'{
"success": true,
"document": {
"celex": "02016R0679-20160504",
"language": "en",
"inForce": true,
"provenance": {
"sourceUrl": "https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:02016R0679-20160504",
"versionIdentifier": "02016R0679-20160504",
…
},
"content": {
"articles": [
{
"id": "art_17",
"number": "Article 17",
"title": "Right to erasure (‘right to be forgotten’)",
"content": "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 …"
}
]
},
…
},
"credits": { "operation_weight": 1, … }
}provenance.versionIdentifiernames the text you were served.- On a consolidated text,
inForcedescribes the act it consolidates. - When you quote a consolidated text, say so, and cite the act as published as the authentic source.
To find GDPR articles by meaning instead of by number, see European legal RAG.
Asked & answered.
N° 01What is the CELEX number of the GDPR?+
N° 02How do I get one GDPR article as JSON?+
N° 03Does LexAPI return the GDPR as amended or corrected?+
N° 04Does LexAPI tell me whether I comply with the GDPR?+
Keep building.
- European case law APISearch Court of Justice case law by meaning, resolve an ECLI, read the judgment.
- European legal RAGSemantic search to article text with provenance, citations and the text for a date.
- Legal data API for AI agentsThe MCP server, hosted or local, the REST API and the SDKs, all on the same credit pool.
- 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.