Skip to content

Search legislation and court decisions

POST
/v1/search
curl --request POST \
--url 'https://api.pandex.io/v1/search?format=json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "cites": "example", "court": "example", "date_from": "example", "date_to": "example", "doc_type": "example", "facets": true, "jurisdiction": "example", "kind": "legislation", "lang": "example", "limit": 1, "max_tokens": 1, "mode": "hybrid", "offset": 1, "query": "example", "sort": "relevance", "source": "example", "within": "example" }'

Find passages of legislation and court decisions. Answers with the passages themselves (an article, a paragraph of a judgment), each with its document, date, id and url. A query that names a text (“art. 6:162 BW”, “§ 823 BGB”, “ECLI:NL:HR:2019:2006”, “32016R0679 art 17”) is answered with that text first. Write the query in the language of the documents; set jurisdiction when you know it.

The MCP tool search takes the same arguments. GET with the arguments as a query string works too.

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
cites

Only passages that cite this document or article: an id, id#element, or a citation.

string
court

Words from the court’s name, e.g. “Hoge Raad”, “Bundesgerichtshof”, “Grand Chamber”.

string
date_from

Earliest document date, YYYY-MM-DD.

string
date_to

Latest document date, YYYY-MM-DD.

string
doc_type

A document type as shown in results, e.g. regulation, directive, act, judgment, opinion.

string
facets

Also count the passages that hold every word by jurisdiction, source and year.

boolean
jurisdiction

One or more of: at, be, br, ca (with its parts, each also asked alone: ca-bc, ca-on), ch (with its parts, each also asked alone: ch-ag, ch-ar, ch-bl, ch-bs, ch-ge, ch-gl, ch-gr, ch-ju, ch-lu, ch-ne, ch-nw, ch-sg, ch-sh, ch-so, ch-sz, ch-tg, ch-ti, ch-ur, ch-vd, ch-zg, ch-zh), coe, cw, cz, de, dj, dk, es, eu, fi, fr, gb, it, lu, mt, mx, ng, nl, pl, pt, se, tn, us (with its parts, each also asked alone: us-co). Comma-separated.

string
kind

Only laws, only court decisions, or only treaties.

string
Allowed values: legislation decision treaty
lang

Two-letter language to match and answer in (texts that exist in several languages). Default: the query’s language.

string
limit

Passages to return, 1–20. Default 5.

integer
max_tokens

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

integer
mode

Hybrid (default): words and meaning (decisions: both together; laws: meaning when no passage holds every word); text: only words; meaning: only meaning.

string
Allowed values: hybrid text meaning
offset

Results to skip, for the next page: the answer says the offset of the next one.

integer
query
required

Words, a question, or a citation. Put a phrase in double quotes to require it literally.

string
sort

Relevance (default); date: newest first; date_asc: oldest first; cited: most cited first. The last three order the passages that hold every word.

string
Allowed values: relevance date date_asc cited
source

Source ids from list_sources, comma-separated.

string
within

Only passages of this document: an id or a citation.

string

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

object
facets

With facets: passages holding every word, by jurisdiction, source and year.

object
jurisdiction
Array<array>
source
Array<array>
year
Array<array>
hits

The passages, best first.

Array<object>

A passage: an article of a law, a paragraph of a decision.

object
by

How it was found: name, text, meaning, text+meaning, filter.

string
cited_by

How many documents cite it: the provision for a law, the decision for a decision.

integer
cited_whole

How many documents cite the law as a whole.

integer | null
cut

Text is a part of the passage.

boolean
date

The date of the document, YYYY-MM-DD.

string | null
doc_type

Act, regulation, directive, judgment, opinion…

string
element

The passage within it: an article (art_17), a paragraph (p_8).

string
element_last

A passage of a decision found by meaning runs from element to this one.

string
id

The document: {source}:{its own id}. Pass it to the other operations.

string
issuer

The legislator or court.

string | null
kind

Legislation, decision or treaty.

string
lang

The language of the text shown.

string
path

Where the passage stands: its part, chapter and article.

string
quoted

Most of the text shown is what the decision quotes, not its own words.

boolean
score
number
sim

Found by meaning: how alike the passage and the question are.

number
since_at_least

Valid_from is only the start of the oldest wording held: the wording is that old or older.

boolean
text

The passage in its official wording.

string
title

The title, or the short name the text goes by.

string
title_full

The full title, where title is the short name.

string
url

The document at its publisher.

string | null
valid_from

The day the wording shown came into force, where the source says so.

string | null
ms

Milliseconds taken.

integer
next_offset

Pass as offset for the next page.

integer | null
note

A word on the answer: what was understood, what is missing.

string | null
offset

Results skipped.

integer
total

Passages that match the words and filters.

integer | null
total_documents

Documents those passages are in.

integer | null
total_of

What the totals count: every_word, or some_words when no passage holds every word.

string | null

Example generated

{
"facets": {
"jurisdiction": [
[
"example"
]
],
"source": [
[
"example"
]
],
"year": [
[
"example"
]
]
},
"hits": [
{
"by": "example",
"cited_by": 1,
"cited_whole": 1,
"cut": true,
"date": "example",
"doc_type": "example",
"element": "example",
"element_last": "example",
"id": "example",
"issuer": "example",
"kind": "example",
"lang": "example",
"path": "example",
"quoted": true,
"score": 1,
"sim": 1,
"since_at_least": true,
"text": "example",
"title": "example",
"title_full": "example",
"url": "example",
"valid_from": "example"
}
],
"ms": 1,
"next_offset": 1,
"note": "example",
"offset": 1,
"total": 1,
"total_documents": 1,
"total_of": "example"
}

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"
}