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
Regulation (EU) 2016/679 · CELEX 32016R0679

§ GDPR API — For developers

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.

Create a free accountQuickstart

§ 01 — Read

One article, by number.

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

The GDPR is CELEX 32016R0679. Ask for one article with articleId; run this with your key in place of lex_your_key.

curl
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"]}'
You get (abridged)
{
  "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, … }
}
  • articleId takes 6, art_6 or Article 6.
  • Cite the article by document.celex, the article number, document.eli and the EUR-Lex link in document.urls.html.
  • inForce says 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.

Python
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])
TypeScript
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));
Both print
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 subject

Document endpoint reference

§ 02 — Recitals

The 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
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"]}'
You get (abridged)
{
  "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.

§ 03 — Citations

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
curl "https://lex-api.com/api/v1/citations/cited-by/32016R0679?citationType=corrigendum,amendment&limit=20" \
  -H "x-api-key: lex_your_key"
You get (abridged)
{
  "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; relationSync says how fresh they are.
  • reference, implementation, legal-basis and proposal edges 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.

Citation endpoints reference

§ 04 — Versions

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
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"]}'
You get (abridged)
{
  "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.versionIdentifier names the text you were served.
  • On a consolidated text, inForce describes 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.

§ 05 — FAQ

Asked & answered.

N° 01What is the CELEX number of the GDPR?+
32016R0679. The GDPR is Regulation (EU) 2016/679 of the European Parliament and of the Council of 27 April 2016, the General Data Protection Regulation. Its ELI is http://data.europa.eu/eli/reg/2016/679/oj.
N° 02How do I get one GDPR article as JSON?+
POST {"celexNumber": "32016R0679", "articleId": "art_17", "include": ["articles"]} to https://lex-api.com/api/v1/documentContent with your API key in the x-api-key header. art_17 is Article 17, the right to erasure. Without include, the answer also carries the recitals and the full text of the regulation; add "metadata" to include for the title and ELI.
N° 03Does LexAPI return the GDPR as amended or corrected?+
It returns each text under its own CELEX number. 32016R0679 is the regulation as published in the Official Journal. 02016R0679-20160504 is a consolidated version of it: documentation without legal force. POST /api/v1/documents/metadata names the newest one in latestConsolidated. A corrigendum is a document of its own; GET /api/v1/citations/cited-by/32016R0679 with citationType=corrigendum,amendment lists the corrigenda and any act recorded as amending it.
N° 04Does LexAPI tell me whether I comply with the GDPR?+
No. LexAPI returns the text of the regulation and the identifiers to cite it by. It does not assess whether anyone complies with it, and it gives no legal advice.
§ 06 — Next

Keep building.


  • 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.