Read a law, an article or a decision
const url = 'https://api.pandex.io/v1/document?format=json';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"at":"example","cases":true,"element":"example","from":"example","history":true,"id":"example","lang":"example","max_tokens":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://api.pandex.io/v1/document?format=json' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "at": "example", "cases": true, "element": "example", "from": "example", "history": true, "id": "example", "lang": "example", "max_tokens": 1 }'Read a document or one part of it in its official wording: a whole short text, one article (element), everything under a chapter, or the text as it stood on a date. One article of a law comes with the leading decisions on it: those cited most by the decisions that cite the article. Long documents come in pieces; the answer says how to continue.
The MCP tool get_document takes the same arguments.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Json (default), or text: the answer written for a model to read, as the MCP tool gives it.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Read the text in force on this day, YYYY-MM-DD. Default: the current text.
With one article of a law: the leading decisions on it. Default true.
The part to read: an element id from a result or outline (art_6:162, art_823, chp_2) or its number as written (“6:162”, “823”, “Annex III”, “recital 26”).
Continue reading from this element id (given by a previous answer).
With element: also list the periods of every version of it.
An id from a result, or an identifier or citation: an ECLI, a CELEX number, “BGB”, “art. 6:162 BW”.
Two-letter language, for texts that exist in several.
Size of the answer in tokens, 200–8000. Default 1500.
Example generated
{ "at": "example", "cases": true, "element": "example", "from": "example", "history": true, "id": "example", "lang": "example", "max_tokens": 1}Responses
Section titled “Responses”The answer: JSON, or with format=text the text the MCP tool gives a model.
object
Documents that cite it.
Its date.
Its type.
The text, element by element.
object
Its id (art_823, chp_2).
Its number as written.
Where it stands.
Valid_from is only the start of the oldest wording held.
The official wording.
The day this wording took effect.
The day it ended.
The start of the oldest wording held, when the text is older.
With history: the periods of every version of the element, oldest first.
The document.
ECLI, CELEX, ELI and the other names it goes by.
In force from.
In force until.
The legislator or court.
Legislation, decision or treaty.
The language shown.
The languages it is held in.
One article asked: the decisions on it that are cited most.
object
How many of the documents that cite the same text cite this one too.
Elements of the citing side.
How many documents cite the citing document itself.
Its date.
The other document, when it is held.
Its legislator or court.
How many times.
The passage the citation stands in.
Cites, amends, repeals, implements, consolidates, appeals, joins.
What it points to as written, for a target not held.
Its title.
Elements of the cited side.
How many decisions cite the article.
Pass as from to read on.
A word on the answer.
Its title.
At its publisher.
Versions held.
Example generated
{ "cited_by": 1, "date": "example", "doc_type": "example", "elements": [ { "element": "example", "label": "example", "path": "example", "since_at_least": true, "text": "example", "valid_from": "example", "valid_to": "example" } ], "held_from": "example", "history": [ [ "example" ] ], "id": "example", "identifiers": [ "example" ], "in_force_from": "example", "in_force_to": "example", "issuer": "example", "kind": "example", "lang": "example", "languages": [ "example" ], "leading": [ { "among": 1, "at": [ "example" ], "cited_by": 1, "date": "example", "id": "example", "issuer": "example", "n": 1, "quote": "example", "relation": "example", "target": "example", "title": "example", "to": [ "example" ] } ], "leading_total": 1, "next": "example", "note": "example", "title": "example", "url": "example", "versions": 1}An argument is missing or wrong, or no text was found for an id. The message says what to pass instead.
object
What was wrong, and what to pass instead.
Example generated
{ "error": "example"}The key is not known or was switched off.
object
What was wrong, and what to pass instead.
Example generated
{ "error": "example"}The request came from a page in a browser on another site. Call the API from a server.
The limit of the key, or of the address without one, is reached. The message says when to ask again.
object
What was wrong, and what to pass instead.
Example generated
{ "error": "example"}