Skip to content

Read a law, an article or a decision

POST
/v1/document
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.

format
string
Allowed values: json text

Json (default), or text: the answer written for a model to read, as the MCP tool gives it.

Media typeapplication/json
object
at

Read the text in force on this day, YYYY-MM-DD. Default: the current text.

string
cases

With one article of a law: the leading decisions on it. Default true.

boolean
element

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”).

string
from

Continue reading from this element id (given by a previous answer).

string
history

With element: also list the periods of every version of it.

boolean
id
required

An id from a result, or an identifier or citation: an ECLI, a CELEX number, “BGB”, “art. 6:162 BW”.

string
lang

Two-letter language, for texts that exist in several.

string
max_tokens

Size of the answer in tokens, 200–8000. Default 1500.

integer

Example generated

{
"at": "example",
"cases": true,
"element": "example",
"from": "example",
"history": true,
"id": "example",
"lang": "example",
"max_tokens": 1
}

The answer: JSON, or with format=text the text the MCP tool gives a model.

object
cited_by

Documents that cite it.

integer
date

Its date.

string | null
doc_type

Its type.

string
elements

The text, element by element.

Array<object>
object
element

Its id (art_823, chp_2).

string
label

Its number as written.

string
path

Where it stands.

string
since_at_least

Valid_from is only the start of the oldest wording held.

boolean
text

The official wording.

string
valid_from

The day this wording took effect.

string | null
valid_to

The day it ended.

string | null
held_from

The start of the oldest wording held, when the text is older.

string | null
history

With history: the periods of every version of the element, oldest first.

Array<array>
id

The document.

string
identifiers

ECLI, CELEX, ELI and the other names it goes by.

Array<string>
in_force_from

In force from.

string | null
in_force_to

In force until.

string | null
issuer

The legislator or court.

string | null
kind

Legislation, decision or treaty.

string
lang

The language shown.

string
languages

The languages it is held in.

Array<string>
leading

One article asked: the decisions on it that are cited most.

Array<object>
object
among

How many of the documents that cite the same text cite this one too.

integer | null
at

Elements of the citing side.

Array<string>
cited_by

How many documents cite the citing document itself.

integer
date

Its date.

string | null
id

The other document, when it is held.

string | null
issuer

Its legislator or court.

string | null
n

How many times.

integer
quote

The passage the citation stands in.

string | null
relation

Cites, amends, repeals, implements, consolidates, appeals, joins.

string
target

What it points to as written, for a target not held.

string | null
title

Its title.

string | null
to

Elements of the cited side.

Array<string>
leading_total

How many decisions cite the article.

integer
next

Pass as from to read on.

string | null
note

A word on the answer.

string | null
title

Its title.

string
url

At its publisher.

string | null
versions

Versions held.

integer

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.

Media typeapplication/json
object
error
required

What was wrong, and what to pass instead.

string

Example generated

{
"error": "example"
}

The key is not known or was switched off.

Media typeapplication/json
object
error
required

What was wrong, and what to pass instead.

string

Example generated

{
"error": "example"
}

The request came from a page in a browser on another site. Call the API from a server.

Media typetext/plain
string

The limit of the key, or of the address without one, is reached. The message says when to ask again.

Media typeapplication/json
object
error
required

What was wrong, and what to pass instead.

string

Example generated

{
"error": "example"
}