API Reference
Complete reference for the Moonlit Legal Intelligence API. Search Dutch and European legal documents, retrieve full texts, and interact with Luna, our AI research assistant.
Base URL
https://api.moonlit.ai/v1.1Authentication
Ocp-Apim-Subscription-KeyRate Limit
50,000 requests / month
Response Format
JSON
Authentication
All API requests must include your subscription key in the Ocp-Apim-Subscription-Key header. Get in touch with our team to get your API key.
Keep your API key secret. Do not expose it in client-side code or public repositories. If your key is compromised, contact our team immediately.
curl -X POST "https://api.moonlit.ai/v1.1/search/keyword_search" \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-d '{"query": "huurrecht opzegging", "jurisdictions": ["Netherlands"]}'Base URL
All API endpoints are relative to the following base URL:
https://api.moonlit.ai/v1.1For example, the keyword search endpoint is available at https://api.moonlit.ai/v1.1/search/keyword_search.
Errors
The API uses standard HTTP status codes to indicate the success or failure of a request. Codes in the 2xx range indicate success, 4xx range indicate a client error, and 5xx range indicate a server error.
| Status Code | Meaning | Description |
|---|---|---|
400 | Bad Request | The request body is malformed or missing required parameters. |
401 | Unauthorized | The API key is missing or invalid. |
403 | Forbidden | Your API key does not have permission to access this resource. |
422 | Validation Error | The request body failed validation. Check required fields and parameter types. |
429 | Rate Limited | You have exceeded your monthly request quota. Contact our team to discuss your plan. |
500 | Server Error | An unexpected error occurred on our end. Try again or contact support if the issue persists. |
504 | Gateway Timeout | The search timed out. This can happen with complex hybrid or semantic queries. Try narrowing your filters or reducing num_results. |
Error Response Format
{
"error": {
"code": 401,
"message": "Invalid or missing API key."
}
}Which search should you use?
→ Hybrid Search (best default)
→ Need max precision? Add reranking
→ Keyword Search
→ Sort by date or citations with sort_type
→ Semantic Search
→ Need max precision? Add reranking
→ Luna API (streaming research assistant)
/v1.1/search/keyword_searchKeyword Search
Search legal documents by exact terms and boolean expressions. Supports filtering by jurisdiction, portal, field of law, and date range. Filter values are validated server-side. Retrieve accepted values from the filter endpoints before applying them: - GET /v1.1/search/filters/documenttypes — accepted documentTypes IDs - GET /v1.1/search/filters/jurisdictions_portals — accepted jurisdiction names and portal values - GET /v1.1/search/filters/trees — accepted fieldsOfLaw IDs
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
documentTypes | string[] | No | Filter by document type. Only accepts IDs returned by GET /v1.1/search/filters/documenttypes. Example IDs: '18fead608f1a4dcb5671b9fc8aeab4d1' (Laws and regulations), '04b42e5bf858a66de2229227deaa21e3' (Decisions). |
jurisdictions | string[] | No | Filter by jurisdiction. Only accepts names returned by GET /v1.1/search/filters/jurisdictions_portals. |
portals | string[] | No | Filter by portal. Use the `value` field returned by GET /v1.1/search/filters/jurisdictions_portals. Can be combined with jurisdictions — e.g. pairing 'Netherlands' in jurisdictions with '1|eur-lex.europa.eu' in portals searches all documents from the Netherlands and documents from eur-lex.europa.eu. |
fieldsOfLaw | string[] | No | Filter by field of law. Only accepts IDs returned by GET /v1.1/search/filters/trees. |
from_date | string | No | Inclusive lower date bound (YYYY-MM-DD). Requires until_date when set. |
until_date | string | No | Inclusive upper date bound (YYYY-MM-DD). Requires from_date when set. |
sources | string[] | No | Filter by source (issuing entity such as a court or legislative body). Only accepts the `value` field from items returned by GET /v1.1/search/filters/sources. For example, if the filter endpoint returns `{"name": "Hof van Cassatie", "value": "c1f4502e43dc2c11969f4f201194fc07", ...}`, pass `"c1f4502e43dc2c11969f4f201194fc07"` in this array. |
reference_identifier | string | No | Document identifier to find references for. When set, results are restricted to documents that reference or are referenced by this document (depending on reference_direction). |
reference_direction | integer | No | Direction of the reference relationship. 0 = to (documents that reference/cite reference_identifier), 1 = made_by (documents referenced by reference_identifier), 2 = both directions combined. Only used when reference_identifier is set. Possible values: 0, 1, 2. |
article_reference_id | string | No | Article-level identifier to narrow reference results to a specific article within the referenced document. Use GET /v1.1/document/articles to discover available article identifiers for a document. Only used when reference_identifier is set. |
query | string | Yes | Keyword query. Supports boolean operators and quoted phrases. Use Boolean operators to refine results. Combine terms with AND (both must match), OR (either matches), or NOT (exclude a term). Use parentheses to group expressions, e.g. (fraud OR negligence) AND "GDPR". Quoting controls how strictly terms are matched: "data protection" finds results containing both data and protection anywhere in the text, while double-quoting a phrase (e.g. ""data protection"") matches the exact phrase where the words appear next to each other. Ensure when using quotes in the query to escape the quotes with a backslash. Use '*' for wildcard search. |
sort_type | integer | No | 0 = relevance (default), 1 = newest first, 2 = oldest first, 3 = most cited. Possible values: 0, 1, 2, 3. |
page | integer | No | Page number, starting from 1. Determines which slice of results to return. The server computes the internal offset as (page − 1) × num_results. Default: 1. Min: 1. Max: 1000. |
num_results | integer | No | Maximum number of documents to return per page. Must be between 1 and 100. Default: 10. Min: 1. Max: 100. |
facets | boolean | No | Whether to include facets in the response. Facets are aggregations of the search results. Default: false. |
all_facets | boolean | No | When facets is enabled, controls whether to include all known facet values (including those with count 0) or only values that appear in the current result set. Default: false. |
Example Request
curl -X POST "https://api.moonlit.ai/v1.1/search/keyword_search" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jurisdictions": [
"European Union",
"Netherlands"
],
"query": "\"data protection\" AND (\"Facebook\" OR \"Meta\")",
"num_results": 10
}'Example Response
{
"result": {
"count": 405,
"skip": 0,
"top": 10,
"results": [
{
"identifier": "62018CJ0311",
"secondaryIdentifier": "ECLI:EU:C:2020:559",
"tertiaryIdentifier": "C-311/18",
"portal": "eur-lex.europa.eu",
"startDate": "2018-05-09T00:00:00+00:00",
"endDate": "2020-07-16T00:00:00+00:00",
"highlights": [
"...<span class='bold'>data</span> <span class='bold'>privacy</span>..."
],
"title": "Data Protection Commissioner/Facebook Ireland Limited and Maximillian Schrems (European Court of Justice 16 July 2020, C-311/18, ECLI:EU:C:2020:559)",
"court": "European Court of Justice",
"year": 2020,
"sources": [
{
"id": "02045a9e2de3f3bd6c520ad0317efd0d",
"parentId": "f7875ac0576a21c24937d480f6fde4f1",
"shortName": "European Court of Justice",
"name": "European Court of Justice"
}
],
"fieldsOfLaw": [
{
"id": "6c1022289490f6fca4adcf0e082d2524",
"shortName": "European data protection law",
"name": "European data protection law"
}
],
"documentTypes": [
{
"id": "04b42e5bf858a66de2229227deaa21e3",
"shortName": "Decisions",
"name": "Decisions"
}
],
"language": "EN",
"dataSource": 0,
"referenced": 165,
"literatureReferenced": 103,
"score": 24.674826,
"sourceUrl": "https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:62018CJ0311"
}
],
"facets": {
"DataSources": [
{
"shortName": "EU",
"name": "European Union",
"value": "0",
"count": 128,
"portals": [
{
"name": "eur-lex.europa.eu",
"value": "0|eur-lex.europa.eu",
"count": 59
}
]
}
],
"Portals": [
{
"shortName": "eur-lex.europa.eu",
"name": "eur-lex.europa.eu",
"value": "eur-lex.europa.eu",
"count": 59
}
],
"FieldsOfLaw": [
{
"shortName": "Public law",
"name": "Public law",
"value": "2f6b898befaa9e641cd8ee258cd8f22e",
"count": 1,
"tooltip": "Public law",
"children": []
}
],
"DocumentTypes": [
{
"shortName": "Decisions",
"name": "Decisions",
"value": "04b42e5bf858a66de2229227deaa21e3",
"count": 33,
"tooltip": "Decisions",
"children": []
}
],
"sources": [
{
"shortName": "International courts",
"name": "International courts",
"value": "f7875ac0576a21c24937d480f6fde4f1",
"count": 30,
"tooltip": "International courts",
"children": []
}
]
}
},
"success": true
}/v1.1/search/semantic_searchSemantic Search
Search legal documents by meaning using vector similarity. Best for natural-language questions and concept-based retrieval. **Ranking:** Results are always ranked by vector-similarity score. There is no `sort_type` parameter — unlike keyword search, semantic search does not support sorting by date or citation count. Filter values are validated server-side. Retrieve accepted values from the filter endpoints before applying them: - GET /v1.1/search/filters/documenttypes — accepted documentTypes IDs - GET /v1.1/search/filters/jurisdictions_portals — accepted jurisdiction names and portal values - GET /v1.1/search/filters/trees — accepted fieldsOfLaw IDs
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
documentTypes | string[] | No | Filter by document type. Only accepts IDs returned by GET /v1.1/search/filters/documenttypes. Example IDs: '18fead608f1a4dcb5671b9fc8aeab4d1' (Laws and regulations), '04b42e5bf858a66de2229227deaa21e3' (Decisions). |
jurisdictions | string[] | No | Filter by jurisdiction. Only accepts names returned by GET /v1.1/search/filters/jurisdictions_portals. |
portals | string[] | No | Filter by portal. Use the `value` field returned by GET /v1.1/search/filters/jurisdictions_portals. Can be combined with jurisdictions — e.g. pairing 'Netherlands' in jurisdictions with '1|eur-lex.europa.eu' in portals searches all documents from the Netherlands and documents from eur-lex.europa.eu. |
fieldsOfLaw | string[] | No | Filter by field of law. Only accepts IDs returned by GET /v1.1/search/filters/trees. |
from_date | string | No | Inclusive lower date bound (YYYY-MM-DD). Requires until_date when set. |
until_date | string | No | Inclusive upper date bound (YYYY-MM-DD). Requires from_date when set. |
sources | string[] | No | Filter by source (issuing entity such as a court or legislative body). Only accepts the `value` field from items returned by GET /v1.1/search/filters/sources. For example, if the filter endpoint returns `{"name": "Hof van Cassatie", "value": "c1f4502e43dc2c11969f4f201194fc07", ...}`, pass `"c1f4502e43dc2c11969f4f201194fc07"` in this array. |
reference_identifier | string | No | Document identifier to find references for. When set, results are restricted to documents that reference or are referenced by this document (depending on reference_direction). |
reference_direction | integer | No | Direction of the reference relationship. 0 = to (documents that reference/cite reference_identifier), 1 = made_by (documents referenced by reference_identifier), 2 = both directions combined. Only used when reference_identifier is set. Possible values: 0, 1, 2. |
article_reference_id | string | No | Article-level identifier to narrow reference results to a specific article within the referenced document. Use GET /v1.1/document/articles to discover available article identifiers for a document. Only used when reference_identifier is set. |
query | string | Yes | Natural-language semantic query text. |
page | integer | No | 1-based result page. Default: 1. Min: 1. Max: 1000. |
num_results | integer | No | Results per page. Default: 20. Min: 1. Max: 100. |
Example Request
curl -X POST "https://api.moonlit.ai/v1.1/search/semantic_search" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jurisdictions": [
"European Union",
"Netherlands"
],
"query": "data transfer safeguards",
"num_results": 10
}'Example Response
{
"result": {
"count": 10,
"skip": 0,
"top": 10,
"results": [
{
"identifier": "MNLT:NL:WETTEN:BWBR0012095",
"secondaryIdentifier": "BWBR0012095",
"tertiaryIdentifier": "Besluit voorkoming dubbele belasting 2001",
"portal": "wetten.overheid.nl",
"endDate": "2026-01-01T00:00:00+00:00",
"highlights": [],
"semanticHighlights": [
{
"chunkIdentifier": "MNLT:NL:WETTEN:BWBR0012095#50",
"chunkText": "Deze voortwenteling vindt alleen plaats indien het naar het volgend jaar over te brengen bedrag door de inspecteur is vastgesteld bij voor bezwaar vatbare beschikking. Paragraaf 3. Tegenbewijsregeling Artikel 25aa. Voorkoming van dubbele belasting bij toepassing tegenbewijsregeling Indien in een jaar het belastbare inkomen uit sparen en beleggen wordt bepaald met inachtneming van afdeling 5.6 van de Wet inkomstenbelasting 2001 , vindt hoofdstuk 2, afdeling 4, paragraaf 1 , in dat jaar geen toepassing en wordt de vermindering van belasting bij buitenlands voordeel uit sparen en beleggen vastgesteld met inachtneming van deze paragraaf.",
"startOffset": 38799,
"endOffset": 39448,
"score": 0.8780079
}
],
"title": "Besluit voorkoming dubbele belasting 2001",
"court": "Dutch government",
"year": 2026,
"sources": [
{
"id": "0a49dfeda181ab7609d2d7d613939f34",
"parentId": "b49c23adeaa6a345aa815e401c6d194b",
"shortName": "Nederlandse overheid",
"name": "Nederlandse overheid"
},
{
"id": "b49c23adeaa6a345aa815e401c6d194b",
"shortName": "Legislative bodies",
"name": "Legislative bodies"
}
],
"fieldsOfLaw": [],
"documentTypes": [
{
"id": "18fead608f1a4dcb5671b9fc8aeab4d1",
"shortName": "Laws and regulations",
"name": "Laws and regulations"
},
{
"id": "fbee5d2e827c7307c755601603c91bc3",
"parentId": "18fead608f1a4dcb5671b9fc8aeab4d1",
"shortName": "National law",
"name": "National law"
}
],
"language": "NL",
"dataSource": 1,
"referenced": 20,
"score": 0.8780079,
"sourceUrl": "https://wetten.overheid.nl/id/BWBR0012095/2026-01-01/0",
"chunkId": 0
}
]
},
"success": true
}/v1.1/search/semantic_search_rerankedSemantic Search with Reranking
Same as semantic search but applies a reranker to the results for improved relevance. Uses Google Vertex AI reranking.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
documentTypes | string[] | No | Filter by document type. Only accepts IDs returned by GET /v1.1/search/filters/documenttypes. Example IDs: '18fead608f1a4dcb5671b9fc8aeab4d1' (Laws and regulations), '04b42e5bf858a66de2229227deaa21e3' (Decisions). |
jurisdictions | string[] | No | Filter by jurisdiction. Only accepts names returned by GET /v1.1/search/filters/jurisdictions_portals. |
portals | string[] | No | Filter by portal. Use the `value` field returned by GET /v1.1/search/filters/jurisdictions_portals. Can be combined with jurisdictions — e.g. pairing 'Netherlands' in jurisdictions with '1|eur-lex.europa.eu' in portals searches all documents from the Netherlands and documents from eur-lex.europa.eu. |
fieldsOfLaw | string[] | No | Filter by field of law. Only accepts IDs returned by GET /v1.1/search/filters/trees. |
from_date | string | No | Inclusive lower date bound (YYYY-MM-DD). Requires until_date when set. |
until_date | string | No | Inclusive upper date bound (YYYY-MM-DD). Requires from_date when set. |
sources | string[] | No | Filter by source (issuing entity such as a court or legislative body). Only accepts the `value` field from items returned by GET /v1.1/search/filters/sources. For example, if the filter endpoint returns `{"name": "Hof van Cassatie", "value": "c1f4502e43dc2c11969f4f201194fc07", ...}`, pass `"c1f4502e43dc2c11969f4f201194fc07"` in this array. |
reference_identifier | string | No | Document identifier to find references for. When set, results are restricted to documents that reference or are referenced by this document (depending on reference_direction). |
reference_direction | integer | No | Direction of the reference relationship. 0 = to (documents that reference/cite reference_identifier), 1 = made_by (documents referenced by reference_identifier), 2 = both directions combined. Only used when reference_identifier is set. Possible values: 0, 1, 2. |
article_reference_id | string | No | Article-level identifier to narrow reference results to a specific article within the referenced document. Use GET /v1.1/document/articles to discover available article identifiers for a document. Only used when reference_identifier is set. |
query | string | Yes | Natural-language semantic query text. |
page | integer | No | 1-based result page. Default: 1. Min: 1. Max: 1000. |
num_results | integer | No | Results per page. Default: 20. Min: 1. Max: 100. |
rerankerType | integer | No | 1 = GoogleVertexAiRerank (default). Possible values: 1, 2. |
Example Request
curl -X POST "https://api.moonlit.ai/v1.1/search/semantic_search_reranked" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jurisdictions": [
"European Union",
"Netherlands"
],
"query": "data transfer safeguards",
"num_results": 10
}'Example Response
{
"result": {
"count": 405,
"skip": 0,
"top": 10,
"results": [
{
"identifier": "62018CJ0311",
"secondaryIdentifier": "ECLI:EU:C:2020:559",
"tertiaryIdentifier": "C-311/18",
"portal": "eur-lex.europa.eu",
"startDate": "2018-05-09T00:00:00+00:00",
"endDate": "2020-07-16T00:00:00+00:00",
"highlights": [
"...<span class='bold'>data</span> <span class='bold'>privacy</span>..."
],
"title": "Data Protection Commissioner/Facebook Ireland Limited and Maximillian Schrems (European Court of Justice 16 July 2020, C-311/18, ECLI:EU:C:2020:559)",
"court": "European Court of Justice",
"year": 2020,
"sources": [
{
"id": "02045a9e2de3f3bd6c520ad0317efd0d",
"parentId": "f7875ac0576a21c24937d480f6fde4f1",
"shortName": "European Court of Justice",
"name": "European Court of Justice"
}
],
"fieldsOfLaw": [
{
"id": "6c1022289490f6fca4adcf0e082d2524",
"shortName": "European data protection law",
"name": "European data protection law"
}
],
"documentTypes": [
{
"id": "04b42e5bf858a66de2229227deaa21e3",
"shortName": "Decisions",
"name": "Decisions"
}
],
"language": "EN",
"dataSource": 0,
"referenced": 165,
"literatureReferenced": 103,
"score": 24.674826,
"sourceUrl": "https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:62018CJ0311"
}
],
"facets": {
"DataSources": [
{
"shortName": "EU",
"name": "European Union",
"value": "0",
"count": 128,
"portals": [
{
"name": "eur-lex.europa.eu",
"value": "0|eur-lex.europa.eu",
"count": 59
}
]
}
],
"Portals": [
{
"shortName": "eur-lex.europa.eu",
"name": "eur-lex.europa.eu",
"value": "eur-lex.europa.eu",
"count": 59
}
],
"FieldsOfLaw": [
{
"shortName": "Public law",
"name": "Public law",
"value": "2f6b898befaa9e641cd8ee258cd8f22e",
"count": 1,
"tooltip": "Public law",
"children": []
}
],
"DocumentTypes": [
{
"shortName": "Decisions",
"name": "Decisions",
"value": "04b42e5bf858a66de2229227deaa21e3",
"count": 33,
"tooltip": "Decisions",
"children": []
}
],
"sources": [
{
"shortName": "International courts",
"name": "International courts",
"value": "f7875ac0576a21c24937d480f6fde4f1",
"count": 30,
"tooltip": "International courts",
"children": []
}
]
}
},
"success": true
}/v1.1/search/hybrid_searchHybrid Search
Combines keyword and semantic search. Ideal for long natural-language queries that may contain exact legal citations. The system automatically extracts keyword terms from the query and runs both keyword and semantic searches in parallel, then fuses the ranked result lists. Filter values are validated server-side. Retrieve accepted values from the filter endpoints before applying them: - GET /v1.1/search/filters/documenttypes — accepted documentTypes IDs - GET /v1.1/search/filters/jurisdictions_portals — accepted jurisdiction names and portal values - GET /v1.1/search/filters/trees — accepted fieldsOfLaw IDs
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
documentTypes | string[] | No | Filter by document type. Only accepts IDs returned by GET /v1.1/search/filters/documenttypes. Example IDs: '18fead608f1a4dcb5671b9fc8aeab4d1' (Laws and regulations), '04b42e5bf858a66de2229227deaa21e3' (Decisions). |
jurisdictions | string[] | No | Filter by jurisdiction. Only accepts names returned by GET /v1.1/search/filters/jurisdictions_portals. |
portals | string[] | No | Filter by portal. Use the `value` field returned by GET /v1.1/search/filters/jurisdictions_portals. Can be combined with jurisdictions — e.g. pairing 'Netherlands' in jurisdictions with '1|eur-lex.europa.eu' in portals searches all documents from the Netherlands and documents from eur-lex.europa.eu. |
fieldsOfLaw | string[] | No | Filter by field of law. Only accepts IDs returned by GET /v1.1/search/filters/trees. |
from_date | string | No | Inclusive lower date bound (YYYY-MM-DD). Requires until_date when set. |
until_date | string | No | Inclusive upper date bound (YYYY-MM-DD). Requires from_date when set. |
sources | string[] | No | Filter by source (issuing entity such as a court or legislative body). Only accepts the `value` field from items returned by GET /v1.1/search/filters/sources. For example, if the filter endpoint returns `{"name": "Hof van Cassatie", "value": "c1f4502e43dc2c11969f4f201194fc07", ...}`, pass `"c1f4502e43dc2c11969f4f201194fc07"` in this array. |
reference_identifier | string | No | Document identifier to find references for. When set, results are restricted to documents that reference or are referenced by this document (depending on reference_direction). |
reference_direction | integer | No | Direction of the reference relationship. 0 = to (documents that reference/cite reference_identifier), 1 = made_by (documents referenced by reference_identifier), 2 = both directions combined. Only used when reference_identifier is set. Possible values: 0, 1, 2. |
article_reference_id | string | No | Article-level identifier to narrow reference results to a specific article within the referenced document. Use GET /v1.1/document/articles to discover available article identifiers for a document. Only used when reference_identifier is set. |
query | string | Yes | Natural-language query. The system extracts keyword terms automatically and runs both keyword and semantic searches in parallel, fusing the results. |
page | integer | No | 1-based result page. Default: 1. Min: 1. Max: 1000. |
num_results | integer | No | Results per page. Default: 10. Min: 1. Max: 100. |
semantic_weight | number | No | Weight for semantic search results in RRF fusion (0.0–1.0). Keyword weight is inferred as 1 − semantic_weight. Default: 0.6. Min: 0. Max: 1. |
Example Request
curl -X POST "https://api.moonlit.ai/v1.1/search/hybrid_search" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jurisdictions": [
"European Union",
"Netherlands"
],
"query": "What are the GDPR requirements for cross-border data transfers?",
"num_results": 10,
"semantic_weight": 0.6
}'Example Response
{
"result": {
"count": 405,
"skip": 0,
"top": 10,
"results": [
{
"identifier": "62018CJ0311",
"secondaryIdentifier": "ECLI:EU:C:2020:559",
"tertiaryIdentifier": "C-311/18",
"portal": "eur-lex.europa.eu",
"startDate": "2018-05-09T00:00:00+00:00",
"endDate": "2020-07-16T00:00:00+00:00",
"highlights": [
"...<span class='bold'>data</span> <span class='bold'>privacy</span>..."
],
"title": "Data Protection Commissioner/Facebook Ireland Limited and Maximillian Schrems (European Court of Justice 16 July 2020, C-311/18, ECLI:EU:C:2020:559)",
"court": "European Court of Justice",
"year": 2020,
"sources": [
{
"id": "02045a9e2de3f3bd6c520ad0317efd0d",
"parentId": "f7875ac0576a21c24937d480f6fde4f1",
"shortName": "European Court of Justice",
"name": "European Court of Justice"
}
],
"fieldsOfLaw": [
{
"id": "6c1022289490f6fca4adcf0e082d2524",
"shortName": "European data protection law",
"name": "European data protection law"
}
],
"documentTypes": [
{
"id": "04b42e5bf858a66de2229227deaa21e3",
"shortName": "Decisions",
"name": "Decisions"
}
],
"language": "EN",
"dataSource": 0,
"referenced": 165,
"literatureReferenced": 103,
"score": 24.674826,
"sourceUrl": "https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:62018CJ0311"
}
],
"facets": {
"DataSources": [
{
"shortName": "EU",
"name": "European Union",
"value": "0",
"count": 128,
"portals": [
{
"name": "eur-lex.europa.eu",
"value": "0|eur-lex.europa.eu",
"count": 59
}
]
}
],
"Portals": [
{
"shortName": "eur-lex.europa.eu",
"name": "eur-lex.europa.eu",
"value": "eur-lex.europa.eu",
"count": 59
}
],
"FieldsOfLaw": [
{
"shortName": "Public law",
"name": "Public law",
"value": "2f6b898befaa9e641cd8ee258cd8f22e",
"count": 1,
"tooltip": "Public law",
"children": []
}
],
"DocumentTypes": [
{
"shortName": "Decisions",
"name": "Decisions",
"value": "04b42e5bf858a66de2229227deaa21e3",
"count": 33,
"tooltip": "Decisions",
"children": []
}
],
"sources": [
{
"shortName": "International courts",
"name": "International courts",
"value": "f7875ac0576a21c24937d480f6fde4f1",
"count": 30,
"tooltip": "International courts",
"children": []
}
]
}
},
"success": true
}/v1.1/search/hybrid_search_rerankedHybrid Search with Reranking
Same as hybrid search but applies a reranker to the fused results for improved relevance. Uses Google Vertex AI reranking. The reranker re-scores results after RRF fusion, giving higher-quality ranking at the cost of slightly higher latency. Filter values are validated server-side. Retrieve accepted values from the filter endpoints before applying them: - GET /v1.1/search/filters/documenttypes — accepted documentTypes IDs - GET /v1.1/search/filters/jurisdictions_portals — accepted jurisdiction names and portal values - GET /v1.1/search/filters/trees — accepted fieldsOfLaw IDs
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
documentTypes | string[] | No | Filter by document type. Only accepts IDs returned by GET /v1.1/search/filters/documenttypes. Example IDs: '18fead608f1a4dcb5671b9fc8aeab4d1' (Laws and regulations), '04b42e5bf858a66de2229227deaa21e3' (Decisions). |
jurisdictions | string[] | No | Filter by jurisdiction. Only accepts names returned by GET /v1.1/search/filters/jurisdictions_portals. |
portals | string[] | No | Filter by portal. Use the `value` field returned by GET /v1.1/search/filters/jurisdictions_portals. Can be combined with jurisdictions — e.g. pairing 'Netherlands' in jurisdictions with '1|eur-lex.europa.eu' in portals searches all documents from the Netherlands and documents from eur-lex.europa.eu. |
fieldsOfLaw | string[] | No | Filter by field of law. Only accepts IDs returned by GET /v1.1/search/filters/trees. |
from_date | string | No | Inclusive lower date bound (YYYY-MM-DD). Requires until_date when set. |
until_date | string | No | Inclusive upper date bound (YYYY-MM-DD). Requires from_date when set. |
sources | string[] | No | Filter by source (issuing entity such as a court or legislative body). Only accepts the `value` field from items returned by GET /v1.1/search/filters/sources. For example, if the filter endpoint returns `{"name": "Hof van Cassatie", "value": "c1f4502e43dc2c11969f4f201194fc07", ...}`, pass `"c1f4502e43dc2c11969f4f201194fc07"` in this array. |
reference_identifier | string | No | Document identifier to find references for. When set, results are restricted to documents that reference or are referenced by this document (depending on reference_direction). |
reference_direction | integer | No | Direction of the reference relationship. 0 = to (documents that reference/cite reference_identifier), 1 = made_by (documents referenced by reference_identifier), 2 = both directions combined. Only used when reference_identifier is set. Possible values: 0, 1, 2. |
article_reference_id | string | No | Article-level identifier to narrow reference results to a specific article within the referenced document. Use GET /v1.1/document/articles to discover available article identifiers for a document. Only used when reference_identifier is set. |
query | string | Yes | Natural-language query. The system extracts keyword terms automatically and runs both keyword and semantic searches in parallel, fusing the results. |
page | integer | No | 1-based result page. Default: 1. Min: 1. Max: 1000. |
num_results | integer | No | Results per page. Default: 10. Min: 1. Max: 100. |
semantic_weight | number | No | Weight for semantic search results in RRF fusion (0.0–1.0). Keyword weight is inferred as 1 − semantic_weight. Default: 0.6. Min: 0. Max: 1. |
rerankerType | integer | No | 1 = GoogleVertexAiRerank (default). Possible values: 1, 2. |
Example Request
curl -X POST "https://api.moonlit.ai/v1.1/search/hybrid_search_reranked" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jurisdictions": [
"European Union",
"Netherlands"
],
"query": "What are the GDPR requirements for cross-border data transfers?",
"num_results": 10,
"semantic_weight": 0.6
}'Example Response
{
"result": {
"count": 405,
"skip": 0,
"top": 10,
"results": [
{
"identifier": "62018CJ0311",
"secondaryIdentifier": "ECLI:EU:C:2020:559",
"tertiaryIdentifier": "C-311/18",
"portal": "eur-lex.europa.eu",
"startDate": "2018-05-09T00:00:00+00:00",
"endDate": "2020-07-16T00:00:00+00:00",
"highlights": [
"...<span class='bold'>data</span> <span class='bold'>privacy</span>..."
],
"title": "Data Protection Commissioner/Facebook Ireland Limited and Maximillian Schrems (European Court of Justice 16 July 2020, C-311/18, ECLI:EU:C:2020:559)",
"court": "European Court of Justice",
"year": 2020,
"sources": [
{
"id": "02045a9e2de3f3bd6c520ad0317efd0d",
"parentId": "f7875ac0576a21c24937d480f6fde4f1",
"shortName": "European Court of Justice",
"name": "European Court of Justice"
}
],
"fieldsOfLaw": [
{
"id": "6c1022289490f6fca4adcf0e082d2524",
"shortName": "European data protection law",
"name": "European data protection law"
}
],
"documentTypes": [
{
"id": "04b42e5bf858a66de2229227deaa21e3",
"shortName": "Decisions",
"name": "Decisions"
}
],
"language": "EN",
"dataSource": 0,
"referenced": 165,
"literatureReferenced": 103,
"score": 24.674826,
"sourceUrl": "https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:62018CJ0311"
}
],
"facets": {
"DataSources": [
{
"shortName": "EU",
"name": "European Union",
"value": "0",
"count": 128,
"portals": [
{
"name": "eur-lex.europa.eu",
"value": "0|eur-lex.europa.eu",
"count": 59
}
]
}
],
"Portals": [
{
"shortName": "eur-lex.europa.eu",
"name": "eur-lex.europa.eu",
"value": "eur-lex.europa.eu",
"count": 59
}
],
"FieldsOfLaw": [
{
"shortName": "Public law",
"name": "Public law",
"value": "2f6b898befaa9e641cd8ee258cd8f22e",
"count": 1,
"tooltip": "Public law",
"children": []
}
],
"DocumentTypes": [
{
"shortName": "Decisions",
"name": "Decisions",
"value": "04b42e5bf858a66de2229227deaa21e3",
"count": 33,
"tooltip": "Decisions",
"children": []
}
],
"sources": [
{
"shortName": "International courts",
"name": "International courts",
"value": "f7875ac0576a21c24937d480f6fde4f1",
"count": 30,
"tooltip": "International courts",
"children": []
}
]
}
},
"success": true
}/v1.1/search/reference_searchReference Search
Find documents that reference or are referenced by a given document. Returns a full keyword search response filtered to matching reference documents. Use `reference_direction` to control the lookup: - 0 (to): documents that reference/cite the given document - 1 (made_by): documents referenced by the given document - 2 (both): union of both directions All standard filters (documentTypes, jurisdictions, etc.) can be applied on top of the reference filter. Use `article_reference_id` to narrow results to references of a specific article within the document. Discover available articles via GET /v1.1/document/articles.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
documentTypes | string[] | No | Filter by document type. Only accepts IDs returned by GET /v1.1/search/filters/documenttypes. Example IDs: '18fead608f1a4dcb5671b9fc8aeab4d1' (Laws and regulations), '04b42e5bf858a66de2229227deaa21e3' (Decisions). |
jurisdictions | string[] | No | Filter by jurisdiction. Only accepts names returned by GET /v1.1/search/filters/jurisdictions_portals. |
portals | string[] | No | Filter by portal. Use the `value` field returned by GET /v1.1/search/filters/jurisdictions_portals. Can be combined with jurisdictions — e.g. pairing 'Netherlands' in jurisdictions with '1|eur-lex.europa.eu' in portals searches all documents from the Netherlands and documents from eur-lex.europa.eu. |
fieldsOfLaw | string[] | No | Filter by field of law. Only accepts IDs returned by GET /v1.1/search/filters/trees. |
from_date | string | No | Inclusive lower date bound (YYYY-MM-DD). Requires until_date when set. |
until_date | string | No | Inclusive upper date bound (YYYY-MM-DD). Requires from_date when set. |
sources | string[] | No | Filter by source (issuing entity such as a court or legislative body). Only accepts the `value` field from items returned by GET /v1.1/search/filters/sources. For example, if the filter endpoint returns `{"name": "Hof van Cassatie", "value": "c1f4502e43dc2c11969f4f201194fc07", ...}`, pass `"c1f4502e43dc2c11969f4f201194fc07"` in this array. |
reference_identifier | string | Yes | Document identifier to find references for. |
reference_direction | integer | No | Possible values: 0, 1, 2. |
article_reference_id | string | No | Article-level identifier to narrow reference results to a specific article within the referenced document. Use GET /v1.1/document/articles to discover available article identifiers for a document. Only used when reference_identifier is set. |
query | string | No | Optional keyword query to apply on top of the reference filter. Defaults to '*' (all matching references). Default: *. |
sort_type | integer | No | 0 = relevance (default), 1 = newest first, 2 = oldest first, 3 = most cited. Possible values: 0, 1, 2, 3. |
page | integer | No | 1-based result page. Default: 1. Min: 1. Max: 1000. |
num_results | integer | No | Results per page. Default: 10. Min: 1. Max: 100. |
facets | boolean | No | Whether to include facets in the response. Default: true. |
all_facets | boolean | No | Include zero-count facet values when facets is enabled. Default: false. |
Example Request
curl -X POST "https://api.moonlit.ai/v1.1/search/reference_search" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jurisdictions": [
"European Union",
"Netherlands"
],
"reference_identifier": "32016R0679",
"num_results": 10
}'Example Response
{
"result": {
"count": 405,
"skip": 0,
"top": 10,
"results": [
{
"identifier": "62018CJ0311",
"secondaryIdentifier": "ECLI:EU:C:2020:559",
"tertiaryIdentifier": "C-311/18",
"portal": "eur-lex.europa.eu",
"startDate": "2018-05-09T00:00:00+00:00",
"endDate": "2020-07-16T00:00:00+00:00",
"highlights": [
"...<span class='bold'>data</span> <span class='bold'>privacy</span>..."
],
"title": "Data Protection Commissioner/Facebook Ireland Limited and Maximillian Schrems (European Court of Justice 16 July 2020, C-311/18, ECLI:EU:C:2020:559)",
"court": "European Court of Justice",
"year": 2020,
"sources": [
{
"id": "02045a9e2de3f3bd6c520ad0317efd0d",
"parentId": "f7875ac0576a21c24937d480f6fde4f1",
"shortName": "European Court of Justice",
"name": "European Court of Justice"
}
],
"fieldsOfLaw": [
{
"id": "6c1022289490f6fca4adcf0e082d2524",
"shortName": "European data protection law",
"name": "European data protection law"
}
],
"documentTypes": [
{
"id": "04b42e5bf858a66de2229227deaa21e3",
"shortName": "Decisions",
"name": "Decisions"
}
],
"language": "EN",
"dataSource": 0,
"referenced": 165,
"literatureReferenced": 103,
"score": 24.674826,
"sourceUrl": "https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:62018CJ0311"
}
],
"facets": {
"DataSources": [
{
"shortName": "EU",
"name": "European Union",
"value": "0",
"count": 128,
"portals": [
{
"name": "eur-lex.europa.eu",
"value": "0|eur-lex.europa.eu",
"count": 59
}
]
}
],
"Portals": [
{
"shortName": "eur-lex.europa.eu",
"name": "eur-lex.europa.eu",
"value": "eur-lex.europa.eu",
"count": 59
}
],
"FieldsOfLaw": [
{
"shortName": "Public law",
"name": "Public law",
"value": "2f6b898befaa9e641cd8ee258cd8f22e",
"count": 1,
"tooltip": "Public law",
"children": []
}
],
"DocumentTypes": [
{
"shortName": "Decisions",
"name": "Decisions",
"value": "04b42e5bf858a66de2229227deaa21e3",
"count": 33,
"tooltip": "Decisions",
"children": []
}
],
"sources": [
{
"shortName": "International courts",
"name": "International courts",
"value": "f7875ac0576a21c24937d480f6fde4f1",
"count": 30,
"tooltip": "International courts",
"children": []
}
]
}
},
"success": true
}/v1.1/search/filters/documenttypesList Document Types
Returns document type IDs structured as a hierarchical tree with nested child categories for filtering search endpoints.
Example Request
curl "https://api.moonlit.ai/v1.1/search/filters/documenttypes" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"Example Response
{
"DocumentTypes": [
{
"name": "value",
"id": "value",
"children": [
"..."
]
}
]
}/v1.1/search/filters/jurisdictions_portalsList Jurisdictions and Portals
Returns jurisdiction names and their portals. Use each portal's `value` field as the canonical `portals` filter input for search endpoints.
Example Request
curl "https://api.moonlit.ai/v1.1/search/filters/jurisdictions_portals" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"Example Response
[
{
"name": "value",
"count": 0,
"portals": [
{
"name": "value",
"value": "value",
"count": 0
}
]
}
]/v1.1/search/filters/treesList Fields-of-Law Tree
Returns hierarchical fields-of-law for use in search filters.
Example Request
curl "https://api.moonlit.ai/v1.1/search/filters/trees" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"Example Response
{
"FieldsOfLaw": [
{
"name": "value",
"id": "value",
"children": [
"..."
]
}
]
}/v1.1/search/filters/sourcesList Sources
Returns the hierarchical list of sources available for filtering search endpoints. Sources are issuing entities such as Supreme Courts, Courts of Appeal, and Legislative bodies. Each item contains a `value` field — pass that value in the `sources` array of keyword or semantic search requests to filter results by source. Optionally narrow the returned sources by providing `jurisdictions` and/or `portals` as query parameters.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
jurisdictions | string | No | Comma-separated jurisdiction names from /v1.1/search/filters/jurisdictions_portals. |
portals | string | No | Comma-separated portal values from /v1.1/search/filters/jurisdictions_portals. |
Example Request
curl "https://api.moonlit.ai/v1.1/search/filters/sources" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"Example Response
{
"Sources": [
{
"name": "value",
"value": "value",
"count": 0,
"children": [
"..."
],
"parentId": "value"
}
]
}/v1.1/search/semantic_portalsList Semantic Portals
Returns the list of portals currently enabled as semantic-search sources.
Example Request
curl "https://api.moonlit.ai/v1.1/search/semantic_portals" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"Example Response
[
{
"name": "value",
"value": "value"
}
]/v1.1/document/retrieve_documentRetrieve Document
Retrieve full document content and metadata by identifier.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
DocumentIdentifier | string | Yes | Unique identifier of the document to retrieve. |
Example Request
curl "https://api.moonlit.ai/v1.1/document/retrieve_document?DocumentIdentifier=32019L0001" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"Example Response
{
"identifier": "32019L0001",
"language": "EN",
"date": "2018-12-11",
"source": "European Parliament",
"jurisdiction": "European Union",
"portal": "eur-lex.europa.eu",
"sourceUrl": "https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32019L0001",
"sourcePdf": "https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=32019L0001",
"sources": [
{
"id": "b49c23adeaa6a345aa815e401c6d194b",
"name": "Legislative bodies"
},
{
"id": "c9aca61be7de06a023b67cc6ab78bf72",
"parentId": "b49c23adeaa6a345aa815e401c6d194b",
"name": "European Parliament"
}
],
"documentTypes": [
{
"id": "87a86c141d2c0649a699745ba63e4c6b",
"parentId": "18fead608f1a4dcb5671b9fc8aeab4d1",
"name": "European law"
},
{
"id": "18fead608f1a4dcb5671b9fc8aeab4d1",
"name": "Laws and regulations"
},
{
"id": "f01159d4ed0dc13c024b743d514e1401",
"parentId": "8dba0d10dfdf2460a34ddf4eeb7b6584",
"name": "EU directives"
},
{
"id": "8dba0d10dfdf2460a34ddf4eeb7b6584",
"parentId": "87a86c141d2c0649a699745ba63e4c6b",
"name": "EU secondary law"
}
],
"text": "14.1.2019 EN Official Journal of the European Union...",
"html": "<h1>DIRECTIVE (EU) 2019/1 OF THE EUROPEAN PARLIAMENT...",
"year": 2019,
"inForce": true,
"summary": "This directive establishes common rules for the internal market..."
}/v1.1/document/articlesList Document Articles
Returns the list of articles/elements within a composite document (e.g. a law or regulation). Each article includes its identifier, title, hierarchy level, and the number of documents that reference it. Use the `elementIdentifier` from the response as the `article_reference_id` parameter in reference search to narrow results to a specific article.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
DocumentIdentifier | string | Yes | Unique identifier of the document to list articles for. |
Example Request
curl "https://api.moonlit.ai/v1.1/document/articles?DocumentIdentifier=32016R0679" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"Example Response
[
{
"elementIdentifier": "value",
"elementTitle": "value",
"elementSubTitle": "value",
"referenceCount": 0,
"level": 0,
"globalOrder": 0
}
]/v1.1/luna/initialize_chatInitialize a Luna research chat session
Creates a new research chat session and returns a chat_id for subsequent questions.
Example Request
curl -X POST "https://api.moonlit.ai/v1.1/luna/initialize_chat" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Example Response
{
"chat_id": "value"
}/v1.1/luna/ask_questionAsk a research question (SSE stream)
Sends a question to an existing Luna research chat session and streams the answer back as Server-Sent Events (SSE).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | string | Yes | Chat session ID returned by initialize_chat |
input | string | Yes | The research question to ask |
jurisdictions | string[] | No | Jurisdiction names to scope the research. Only accepts names returned by GET /v1.1/search/filters/jurisdictions_portals. |
Example Request
curl -N -X POST "https://api.moonlit.ai/v1.1/luna/ask_question" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"input": "What are the key requirements for valid consent under GDPR?",
"jurisdictions": [
"European Union",
"Netherlands"
]
}'Example Response
event: message
data: Based on the relevant case law and legislation...
event: message
data: the key requirements include...
event: sources
data: {"sources": [{"id": "62018CJ0311", "title": "Schrems II", "relevance": 0.96}]}
event: done
data: [DONE]