Search legislation and court decisions
const url = 'https://api.pandex.io/v1/search?format=json';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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"}'};
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/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.
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
Only passages that cite this document or article: an id, id#element, or a citation.
Words from the court’s name, e.g. “Hoge Raad”, “Bundesgerichtshof”, “Grand Chamber”.
Earliest document date, YYYY-MM-DD.
Latest document date, YYYY-MM-DD.
A document type as shown in results, e.g. regulation, directive, act, judgment, opinion.
Also count the passages that hold every word by jurisdiction, source and year.
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.
Only laws, only court decisions, or only treaties.
Two-letter language to match and answer in (texts that exist in several languages). Default: the query’s language.
Passages to return, 1–20. Default 5.
Size of the answer in tokens, 200–8000. Default 1500.
Hybrid (default): words and meaning (decisions: both together; laws: meaning when no passage holds every word); text: only words; meaning: only meaning.
Results to skip, for the next page: the answer says the offset of the next one.
Words, a question, or a citation. Put a phrase in double quotes to require it literally.
Relevance (default); date: newest first; date_asc: oldest first; cited: most cited first. The last three order the passages that hold every word.
Source ids from list_sources, comma-separated.
Only passages of this document: an id or a citation.
Responses
Section titled “Responses”The answer: JSON, or with format=text the text the MCP tool gives a model.
object
With facets: passages holding every word, by jurisdiction, source and year.
object
The passages, best first.
A passage: an article of a law, a paragraph of a decision.
object
How it was found: name, text, meaning, text+meaning, filter.
How many documents cite it: the provision for a law, the decision for a decision.
How many documents cite the law as a whole.
Text is a part of the passage.
The date of the document, YYYY-MM-DD.
Act, regulation, directive, judgment, opinion…
The passage within it: an article (art_17), a paragraph (p_8).
A passage of a decision found by meaning runs from element to this one.
The document: {source}:{its own id}. Pass it to the other operations.
The legislator or court.
Legislation, decision or treaty.
The language of the text shown.
Where the passage stands: its part, chapter and article.
Most of the text shown is what the decision quotes, not its own words.
Found by meaning: how alike the passage and the question are.
Valid_from is only the start of the oldest wording held: the wording is that old or older.
The passage in its official wording.
The title, or the short name the text goes by.
The full title, where title is the short name.
The document at its publisher.
The day the wording shown came into force, where the source says so.
Milliseconds taken.
Pass as offset for the next page.
A word on the answer: what was understood, what is missing.
Results skipped.
Passages that match the words and filters.
Documents those passages are in.
What the totals count: every_word, or some_words when no passage holds every word.
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.
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"}