Search

Six search endpoints over the same corpus: keyword, semantic, hybrid, their reranked variants, and citation-graph reference search.

POST/v1.1/search/keyword_searchOpen in Swagger
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

querystringrequired

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.

e.g. "data protection" AND ("Facebook" OR "Meta")
documentTypesstring[]

Filter by document type. Only accepts IDs returned by GET /v1.1/search/filters/documenttypes. Example IDs: '18fead608f1a4dcb5671b9fc8aeab4d1' (Laws and regulations), '04b42e5bf858a66de2229227deaa21e3' (Decisions).

jurisdictionsstring[]

Filter by jurisdiction. Only accepts names returned by GET /v1.1/search/filters/jurisdictions_portals.

e.g. ["European Union","Netherlands"]
portalsstring[]

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.

e.g. ["1|eur-lex.europa.eu"]
fieldsOfLawstring[]

Filter by field of law. Only accepts IDs returned by GET /v1.1/search/filters/trees.

documentIdentifiersstring[]

Restrict the search to chunks belonging to these documents. Each value is a Moonlit document identifier (e.g. '32016R0679'). Empty list (or omitted) means no document scoping. Maximum 50 identifiers; exceeding returns 422. Composes with every other filter — e.g. combined with reference_identifier to scope reference search to a specific document.

max 50 itemse.g. ["32016R0679"]
from_datestring | null

Inclusive lower date bound (YYYY-MM-DD). Requires until_date when set.

format YYYY-MM-DDe.g. 2021-01-01
until_datestring | null

Inclusive upper date bound (YYYY-MM-DD). Requires from_date when set.

format YYYY-MM-DDe.g. 2024-12-31
sourcesstring[]

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.

e.g. ["02045a9e2de3f3bd6c520ad0317efd0d"]
reference_identifierstring | null

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

e.g. 32016R0679
reference_directioninteger | null

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.

0 | 1 | 2
article_reference_idstring | null

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.

sort_typeinteger

0 = relevance (default), 1 = newest first, 2 = oldest first, 3 = most cited.

0 | 1 | 2 | 3
pageintegerdefault: 1

Page number, starting from 1. Determines which slice of results to return. The server computes the internal offset as (page − 1) × num_results.

1 to 1000
num_resultsintegerdefault: 10

Maximum number of documents to return per page. Must be between 1 and 100.

1 to 100
facetsbooleandefault: false

Whether to include facets in the response. Facets are aggregations of the search results.

all_facetsbooleandefault: false

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.

Example request

curl -X POST "https://api.moonlit.ai/v1.1/search/keyword_search" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "all_facets": true,
  "documentTypes": [
    "18fead608f1a4dcb5671b9fc8aeab4d1",
    "04b42e5bf858a66de2229227deaa21e3"
  ],
  "facets": true,
  "fieldsOfLaw": [],
  "from_date": "2021-01-01",
  "jurisdictions": [
    "Netherlands"
  ],
  "num_results": 10,
  "page": 1,
  "portals": [
    "1|eur-lex.europa.eu"
  ],
  "query": "\"data protection\" AND (\"Facebook\" OR \"Meta\")",
  "sort_type": 0,
  "sources": [],
  "until_date": "2024-12-31"
}'

Response

Keyword search results

resultobject

Search result payload.

successboolean

Whether upstream query succeeded.

errorany | null

Upstream error payload.

The spec declares result as an open object; its fields are shown in the example below.

{
  "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>..."
        ],
        "semanticHighlights": null,
        "summary": null,
        "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",
            "parentId": null,
            "shortName": "European data protection law",
            "name": "European data protection law"
          }
        ],
        "documentTypes": [
          {
            "id": "04b42e5bf858a66de2229227deaa21e3",
            "parentId": null,
            "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",
        "inForce": null
      }
    ],
    "facets": {
      "DataSources": [
        {
          "shortName": "EU",
          "name": "European Union",
          "value": "0",
          "count": 128,
          "tooltip": null,
          "children": null,
          "parentId": null,
          "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,
          "tooltip": null,
          "children": null,
          "parentId": null
        }
      ],
      "FieldsOfLaw": [
        {
          "shortName": "Public law",
          "name": "Public law",
          "value": "2f6b898befaa9e641cd8ee258cd8f22e",
          "count": 1,
          "tooltip": "Public law",
          "children": [],
          "parentId": null
        }
      ],
      "DocumentTypes": [
        {
          "shortName": "Decisions",
          "name": "Decisions",
          "value": "04b42e5bf858a66de2229227deaa21e3",
          "count": 33,
          "tooltip": "Decisions",
          "children": [],
          "parentId": null
        }
      ],
      "Sources": [
        {
          "shortName": "International courts",
          "name": "International courts",
          "value": "f7875ac0576a21c24937d480f6fde4f1",
          "count": 30,
          "tooltip": "International courts",
          "children": [],
          "parentId": null
        }
      ]
    }
  },
  "success": true,
  "error": null
}

Errors

400Invalid filter value or page out of range
401Missing or invalid API key
403Forbidden by role or jurisdiction scope
422Request validation error
500Internal server error
POST/v1.1/search/semantic_searchOpen in Swagger
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

querystringrequired

Natural-language semantic query text.

e.g. data transfer safeguards
documentTypesstring[]

Filter by document type. Only accepts IDs returned by GET /v1.1/search/filters/documenttypes. Example IDs: '18fead608f1a4dcb5671b9fc8aeab4d1' (Laws and regulations), '04b42e5bf858a66de2229227deaa21e3' (Decisions).

jurisdictionsstring[]

Filter by jurisdiction. Only accepts names returned by GET /v1.1/search/filters/jurisdictions_portals.

e.g. ["European Union","Netherlands"]
portalsstring[]

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.

e.g. ["1|eur-lex.europa.eu"]
fieldsOfLawstring[]

Filter by field of law. Only accepts IDs returned by GET /v1.1/search/filters/trees.

documentIdentifiersstring[]

Restrict the search to chunks belonging to these documents. Each value is a Moonlit document identifier (e.g. '32016R0679'). Empty list (or omitted) means no document scoping. Maximum 50 identifiers; exceeding returns 422. Composes with every other filter — e.g. combined with reference_identifier to scope reference search to a specific document.

max 50 itemse.g. ["32016R0679"]
from_datestring | null

Inclusive lower date bound (YYYY-MM-DD). Requires until_date when set.

format YYYY-MM-DDe.g. 2021-01-01
until_datestring | null

Inclusive upper date bound (YYYY-MM-DD). Requires from_date when set.

format YYYY-MM-DDe.g. 2024-12-31
sourcesstring[]

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.

e.g. ["02045a9e2de3f3bd6c520ad0317efd0d"]
reference_identifierstring | null

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

e.g. 32016R0679
reference_directioninteger | null

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.

0 | 1 | 2
article_reference_idstring | null

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.

pageintegerdefault: 1

1-based result page.

1 to 1000
num_resultsintegerdefault: 20

Results per page.

1 to 100

Example request

curl -X POST "https://api.moonlit.ai/v1.1/search/semantic_search" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "documentTypes": [
    "18fead608f1a4dcb5671b9fc8aeab4d1",
    "04b42e5bf858a66de2229227deaa21e3"
  ],
  "fieldsOfLaw": [],
  "jurisdictions": [],
  "num_results": 20,
  "page": 1,
  "portals": [
    "0|eur-lex.europa.eu"
  ],
  "query": "data transfer safeguards for tech companies",
  "sources": []
}'

Response

Semantic search results

resultobject

Search result payload.

successboolean

Whether upstream query succeeded.

errorany | null

Upstream error payload.

The spec declares result as an open object; its fields are shown in the example below.

{
  "result": {
    "count": 1,
    "skip": 0,
    "top": 10,
    "results": [
      {
        "identifier": "MNLT:NL:WETTEN:BWBR0012095",
        "secondaryIdentifier": "BWBR0012095",
        "tertiaryIdentifier": "Besluit voorkoming dubbele belasting 2001",
        "portal": "wetten.overheid.nl",
        "startDate": null,
        "endDate": "2026-01-01T00:00:00+00:00",
        "highlights": [],
        "semanticHighlights": [
          {
            "chunkIdentifier": "MNLT:NL:WETTEN:BWBR0012095#50",
            "chunkText": "Artikel 25aa. Voorkoming van dubbele belasting bij toepassing tegenbewijsregeling ...",
            "startOffset": 38799,
            "endOffset": 39448,
            "score": 0.8780079
          }
        ],
        "summary": null,
        "title": "Besluit voorkoming dubbele belasting 2001",
        "court": "Dutch government",
        "year": 2026,
        "sources": [
          {
            "id": "0a49dfeda181ab7609d2d7d613939f34",
            "parentId": "b49c23adeaa6a345aa815e401c6d194b",
            "shortName": "Nederlandse overheid",
            "name": "Nederlandse overheid"
          }
        ],
        "fieldsOfLaw": [],
        "documentTypes": [
          {
            "id": "18fead608f1a4dcb5671b9fc8aeab4d1",
            "parentId": null,
            "shortName": "Laws and regulations",
            "name": "Laws and regulations"
          }
        ],
        "language": "NL",
        "dataSource": 1,
        "referenced": 20,
        "literatureReferenced": null,
        "score": 0.8780079,
        "sourceUrl": "https://wetten.overheid.nl/id/BWBR0012095/2026-01-01/0",
        "inForce": null
      }
    ],
    "facets": null
  },
  "success": true,
  "error": null
}

Errors

400Invalid filter value or page out of range
401Missing or invalid API key
403Forbidden by role or jurisdiction scope
422Request validation error
500Internal server error

Semantic Search with Reranking

POST/v1.1/search/semantic_search_rerankedOpen in Swagger
Same as semantic search but applies a reranker to the results for improved relevance. Uses Google Vertex AI reranking.

Parameters

querystringrequired

Natural-language semantic query text.

e.g. data transfer safeguards
documentTypesstring[]

Filter by document type. Only accepts IDs returned by GET /v1.1/search/filters/documenttypes. Example IDs: '18fead608f1a4dcb5671b9fc8aeab4d1' (Laws and regulations), '04b42e5bf858a66de2229227deaa21e3' (Decisions).

jurisdictionsstring[]

Filter by jurisdiction. Only accepts names returned by GET /v1.1/search/filters/jurisdictions_portals.

e.g. ["European Union","Netherlands"]
portalsstring[]

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.

e.g. ["1|eur-lex.europa.eu"]
fieldsOfLawstring[]

Filter by field of law. Only accepts IDs returned by GET /v1.1/search/filters/trees.

documentIdentifiersstring[]

Restrict the search to chunks belonging to these documents. Each value is a Moonlit document identifier (e.g. '32016R0679'). Empty list (or omitted) means no document scoping. Maximum 50 identifiers; exceeding returns 422. Composes with every other filter — e.g. combined with reference_identifier to scope reference search to a specific document.

max 50 itemse.g. ["32016R0679"]
from_datestring | null

Inclusive lower date bound (YYYY-MM-DD). Requires until_date when set.

format YYYY-MM-DDe.g. 2021-01-01
until_datestring | null

Inclusive upper date bound (YYYY-MM-DD). Requires from_date when set.

format YYYY-MM-DDe.g. 2024-12-31
sourcesstring[]

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.

e.g. ["02045a9e2de3f3bd6c520ad0317efd0d"]
reference_identifierstring | null

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

e.g. 32016R0679
reference_directioninteger | null

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.

0 | 1 | 2
article_reference_idstring | null

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.

pageintegerdefault: 1

1-based result page.

1 to 1000
num_resultsintegerdefault: 20

Results per page.

1 to 100
rerankerTypeinteger

1 = GoogleVertexAiRerank (default).

1 | 2

Example request

curl -X POST "https://api.moonlit.ai/v1.1/search/semantic_search_reranked" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "documentTypes": [],
  "fieldsOfLaw": [],
  "jurisdictions": [],
  "num_results": 20,
  "page": 1,
  "portals": [],
  "query": "data transfer safeguards for tech companies",
  "rerankerType": 1,
  "sources": []
}'

Response

Semantic search results, reranked by relevance

resultobject

Search result payload.

successboolean

Whether upstream query succeeded.

errorany | null

Upstream error payload.

The spec declares result as an open object; its fields are shown in the example below.

{
  "result": {
    "count": 1,
    "skip": 0,
    "top": 10,
    "results": [
      {
        "identifier": "MNLT:NL:WETTEN:BWBR0012095",
        "secondaryIdentifier": "BWBR0012095",
        "tertiaryIdentifier": "Besluit voorkoming dubbele belasting 2001",
        "portal": "wetten.overheid.nl",
        "startDate": null,
        "endDate": "2026-01-01T00:00:00+00:00",
        "highlights": [],
        "semanticHighlights": [
          {
            "chunkIdentifier": "MNLT:NL:WETTEN:BWBR0012095#50",
            "chunkText": "Artikel 25aa. Voorkoming van dubbele belasting bij toepassing tegenbewijsregeling ...",
            "startOffset": 38799,
            "endOffset": 39448,
            "score": 0.8780079
          }
        ],
        "summary": null,
        "title": "Besluit voorkoming dubbele belasting 2001",
        "court": "Dutch government",
        "year": 2026,
        "sources": [
          {
            "id": "0a49dfeda181ab7609d2d7d613939f34",
            "parentId": "b49c23adeaa6a345aa815e401c6d194b",
            "shortName": "Nederlandse overheid",
            "name": "Nederlandse overheid"
          }
        ],
        "fieldsOfLaw": [],
        "documentTypes": [
          {
            "id": "18fead608f1a4dcb5671b9fc8aeab4d1",
            "parentId": null,
            "shortName": "Laws and regulations",
            "name": "Laws and regulations"
          }
        ],
        "language": "NL",
        "dataSource": 1,
        "referenced": 20,
        "literatureReferenced": null,
        "score": 0.92,
        "sourceUrl": "https://wetten.overheid.nl/id/BWBR0012095/2026-01-01/0",
        "inForce": null
      }
    ],
    "facets": null
  },
  "success": true,
  "error": null
}

Errors

400Invalid filter value or page out of range
401Missing or invalid API key
403Forbidden by role or jurisdiction scope
422Request validation error
500Internal server error
504Search timed out
POST/v1.1/search/hybrid_searchOpen in Swagger
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

querystringrequired

Natural-language query. The system extracts keyword terms automatically and runs both keyword and semantic searches in parallel, fusing the results.

e.g. What are the GDPR requirements for cross-border data transfers?
documentTypesstring[]

Filter by document type. Only accepts IDs returned by GET /v1.1/search/filters/documenttypes. Example IDs: '18fead608f1a4dcb5671b9fc8aeab4d1' (Laws and regulations), '04b42e5bf858a66de2229227deaa21e3' (Decisions).

jurisdictionsstring[]

Filter by jurisdiction. Only accepts names returned by GET /v1.1/search/filters/jurisdictions_portals.

e.g. ["European Union","Netherlands"]
portalsstring[]

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.

e.g. ["1|eur-lex.europa.eu"]
fieldsOfLawstring[]

Filter by field of law. Only accepts IDs returned by GET /v1.1/search/filters/trees.

documentIdentifiersstring[]

Restrict the search to chunks belonging to these documents. Each value is a Moonlit document identifier (e.g. '32016R0679'). Empty list (or omitted) means no document scoping. Maximum 50 identifiers; exceeding returns 422. Composes with every other filter — e.g. combined with reference_identifier to scope reference search to a specific document.

max 50 itemse.g. ["32016R0679"]
from_datestring | null

Inclusive lower date bound (YYYY-MM-DD). Requires until_date when set.

format YYYY-MM-DDe.g. 2021-01-01
until_datestring | null

Inclusive upper date bound (YYYY-MM-DD). Requires from_date when set.

format YYYY-MM-DDe.g. 2024-12-31
sourcesstring[]

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.

e.g. ["02045a9e2de3f3bd6c520ad0317efd0d"]
reference_identifierstring | null

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

e.g. 32016R0679
reference_directioninteger | null

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.

0 | 1 | 2
article_reference_idstring | null

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.

pageintegerdefault: 1

1-based result page.

1 to 1000
num_resultsintegerdefault: 10

Results per page.

1 to 100
semantic_weightnumberdefault: 0.6

Weight for semantic search results in RRF fusion (0.0–1.0). Keyword weight is inferred as 1 − semantic_weight.

0 to 1

Example request

curl -X POST "https://api.moonlit.ai/v1.1/search/hybrid_search" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "documentTypes": [],
  "fieldsOfLaw": [],
  "jurisdictions": [
    "European Union"
  ],
  "num_results": 10,
  "page": 1,
  "portals": [],
  "query": "What are the GDPR requirements for cross-border data transfers?",
  "semantic_weight": 0.6,
  "sources": []
}'

Response

Hybrid search results ranked by fused RRF score

resultobject

Search result payload.

successboolean

Whether upstream query succeeded.

errorany | null

Upstream error payload.

The spec declares result as an open object; its fields are shown in the example below.

{
  "result": {
    "count": 2,
    "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>..."
        ],
        "semanticHighlights": null,
        "summary": null,
        "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",
            "parentId": null,
            "shortName": "European data protection law",
            "name": "European data protection law"
          }
        ],
        "documentTypes": [
          {
            "id": "04b42e5bf858a66de2229227deaa21e3",
            "parentId": null,
            "shortName": "Decisions",
            "name": "Decisions"
          }
        ],
        "language": "EN",
        "dataSource": 0,
        "referenced": 165,
        "literatureReferenced": 103,
        "score": 0.0325,
        "sourceUrl": "https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:62018CJ0311",
        "inForce": null
      },
      {
        "identifier": "MNLT:NL:WETTEN:BWBR0012095",
        "secondaryIdentifier": "BWBR0012095",
        "tertiaryIdentifier": "Besluit voorkoming dubbele belasting 2001",
        "portal": "wetten.overheid.nl",
        "startDate": null,
        "endDate": "2026-01-01T00:00:00+00:00",
        "highlights": [],
        "semanticHighlights": [
          {
            "chunkIdentifier": "MNLT:NL:WETTEN:BWBR0012095#50",
            "chunkText": "Artikel 25aa. Voorkoming van dubbele belasting bij toepassing tegenbewijsregeling ...",
            "startOffset": 38799,
            "endOffset": 39448,
            "score": 0.8780079
          }
        ],
        "summary": null,
        "title": "Besluit voorkoming dubbele belasting 2001",
        "court": "Dutch government",
        "year": 2026,
        "sources": [
          {
            "id": "0a49dfeda181ab7609d2d7d613939f34",
            "parentId": "b49c23adeaa6a345aa815e401c6d194b",
            "shortName": "Nederlandse overheid",
            "name": "Nederlandse overheid"
          }
        ],
        "fieldsOfLaw": [],
        "documentTypes": [
          {
            "id": "18fead608f1a4dcb5671b9fc8aeab4d1",
            "parentId": null,
            "shortName": "Laws and regulations",
            "name": "Laws and regulations"
          }
        ],
        "language": "NL",
        "dataSource": 1,
        "referenced": 20,
        "literatureReferenced": null,
        "score": 0.0161,
        "sourceUrl": "https://wetten.overheid.nl/id/BWBR0012095/2026-01-01/0",
        "inForce": null
      }
    ],
    "facets": null
  },
  "success": true,
  "error": null
}

Errors

400Invalid filter value or page out of range
401Missing or invalid API key
403Forbidden by role or jurisdiction scope
422Request validation error
500Internal server error
504Search timed out

Hybrid Search with Reranking

POST/v1.1/search/hybrid_search_rerankedOpen in Swagger
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

querystringrequired

Natural-language query. The system extracts keyword terms automatically and runs both keyword and semantic searches in parallel, fusing the results.

e.g. What are the GDPR requirements for cross-border data transfers?
documentTypesstring[]

Filter by document type. Only accepts IDs returned by GET /v1.1/search/filters/documenttypes. Example IDs: '18fead608f1a4dcb5671b9fc8aeab4d1' (Laws and regulations), '04b42e5bf858a66de2229227deaa21e3' (Decisions).

jurisdictionsstring[]

Filter by jurisdiction. Only accepts names returned by GET /v1.1/search/filters/jurisdictions_portals.

e.g. ["European Union","Netherlands"]
portalsstring[]

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.

e.g. ["1|eur-lex.europa.eu"]
fieldsOfLawstring[]

Filter by field of law. Only accepts IDs returned by GET /v1.1/search/filters/trees.

documentIdentifiersstring[]

Restrict the search to chunks belonging to these documents. Each value is a Moonlit document identifier (e.g. '32016R0679'). Empty list (or omitted) means no document scoping. Maximum 50 identifiers; exceeding returns 422. Composes with every other filter — e.g. combined with reference_identifier to scope reference search to a specific document.

max 50 itemse.g. ["32016R0679"]
from_datestring | null

Inclusive lower date bound (YYYY-MM-DD). Requires until_date when set.

format YYYY-MM-DDe.g. 2021-01-01
until_datestring | null

Inclusive upper date bound (YYYY-MM-DD). Requires from_date when set.

format YYYY-MM-DDe.g. 2024-12-31
sourcesstring[]

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.

e.g. ["02045a9e2de3f3bd6c520ad0317efd0d"]
reference_identifierstring | null

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

e.g. 32016R0679
reference_directioninteger | null

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.

0 | 1 | 2
article_reference_idstring | null

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.

pageintegerdefault: 1

1-based result page.

1 to 1000
num_resultsintegerdefault: 10

Results per page.

1 to 100
semantic_weightnumberdefault: 0.6

Weight for semantic search results in RRF fusion (0.0–1.0). Keyword weight is inferred as 1 − semantic_weight.

0 to 1
rerankerTypeinteger

1 = GoogleVertexAiRerank (default).

1 | 2

Example request

curl -X POST "https://api.moonlit.ai/v1.1/search/hybrid_search_reranked" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "documentTypes": [],
  "fieldsOfLaw": [],
  "jurisdictions": [
    "European Union"
  ],
  "num_results": 10,
  "page": 1,
  "portals": [],
  "query": "What are the GDPR requirements for cross-border data transfers?",
  "rerankerType": 1,
  "semantic_weight": 0.6,
  "sources": []
}'

Response

Hybrid search results, reranked by relevance

resultobject

Search result payload.

successboolean

Whether upstream query succeeded.

errorany | null

Upstream error payload.

The spec declares result as an open object; its fields are shown in the example below.

{
  "result": {
    "count": 2,
    "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>..."
        ],
        "semanticHighlights": null,
        "summary": null,
        "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",
            "parentId": null,
            "shortName": "European data protection law",
            "name": "European data protection law"
          }
        ],
        "documentTypes": [
          {
            "id": "04b42e5bf858a66de2229227deaa21e3",
            "parentId": null,
            "shortName": "Decisions",
            "name": "Decisions"
          }
        ],
        "language": "EN",
        "dataSource": 0,
        "referenced": 165,
        "literatureReferenced": 103,
        "score": 0.94,
        "sourceUrl": "https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:62018CJ0311",
        "inForce": null
      },
      {
        "identifier": "MNLT:NL:WETTEN:BWBR0012095",
        "secondaryIdentifier": "BWBR0012095",
        "tertiaryIdentifier": "Besluit voorkoming dubbele belasting 2001",
        "portal": "wetten.overheid.nl",
        "startDate": null,
        "endDate": "2026-01-01T00:00:00+00:00",
        "highlights": [],
        "semanticHighlights": [
          {
            "chunkIdentifier": "MNLT:NL:WETTEN:BWBR0012095#50",
            "chunkText": "Artikel 25aa. Voorkoming van dubbele belasting bij toepassing tegenbewijsregeling ...",
            "startOffset": 38799,
            "endOffset": 39448,
            "score": 0.8780079
          }
        ],
        "summary": null,
        "title": "Besluit voorkoming dubbele belasting 2001",
        "court": "Dutch government",
        "year": 2026,
        "sources": [
          {
            "id": "0a49dfeda181ab7609d2d7d613939f34",
            "parentId": "b49c23adeaa6a345aa815e401c6d194b",
            "shortName": "Nederlandse overheid",
            "name": "Nederlandse overheid"
          }
        ],
        "fieldsOfLaw": [],
        "documentTypes": [
          {
            "id": "18fead608f1a4dcb5671b9fc8aeab4d1",
            "parentId": null,
            "shortName": "Laws and regulations",
            "name": "Laws and regulations"
          }
        ],
        "language": "NL",
        "dataSource": 1,
        "referenced": 20,
        "literatureReferenced": null,
        "score": 0.71,
        "sourceUrl": "https://wetten.overheid.nl/id/BWBR0012095/2026-01-01/0",
        "inForce": null
      }
    ],
    "facets": null
  },
  "success": true,
  "error": null
}

Errors

400Invalid filter value or page out of range
401Missing or invalid API key
403Forbidden by role or jurisdiction scope
422Request validation error
500Internal server error
504Search timed out
POST/v1.1/search/reference_searchOpen in Swagger
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

reference_identifierstringrequired

Document identifier to find references for.

e.g. 32016R0679
documentTypesstring[]

Filter by document type. Only accepts IDs returned by GET /v1.1/search/filters/documenttypes. Example IDs: '18fead608f1a4dcb5671b9fc8aeab4d1' (Laws and regulations), '04b42e5bf858a66de2229227deaa21e3' (Decisions).

jurisdictionsstring[]

Filter by jurisdiction. Only accepts names returned by GET /v1.1/search/filters/jurisdictions_portals.

e.g. ["European Union","Netherlands"]
portalsstring[]

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.

e.g. ["1|eur-lex.europa.eu"]
fieldsOfLawstring[]

Filter by field of law. Only accepts IDs returned by GET /v1.1/search/filters/trees.

documentIdentifiersstring[]

Restrict the search to chunks belonging to these documents. Each value is a Moonlit document identifier (e.g. '32016R0679'). Empty list (or omitted) means no document scoping. Maximum 50 identifiers; exceeding returns 422. Composes with every other filter — e.g. combined with reference_identifier to scope reference search to a specific document.

max 50 itemse.g. ["32016R0679"]
from_datestring | null

Inclusive lower date bound (YYYY-MM-DD). Requires until_date when set.

format YYYY-MM-DDe.g. 2021-01-01
until_datestring | null

Inclusive upper date bound (YYYY-MM-DD). Requires from_date when set.

format YYYY-MM-DDe.g. 2024-12-31
sourcesstring[]

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.

e.g. ["02045a9e2de3f3bd6c520ad0317efd0d"]
reference_directioninteger
0 | 1 | 2
article_reference_idstring | null

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.

querystringdefault: *

Optional keyword query to apply on top of the reference filter. Defaults to '*' (all matching references).

sort_typeinteger

0 = relevance (default), 1 = newest first, 2 = oldest first, 3 = most cited.

0 | 1 | 2 | 3
pageintegerdefault: 1

1-based result page.

1 to 1000
num_resultsintegerdefault: 10

Results per page.

1 to 100
facetsbooleandefault: false

Whether to include facets in the response.

all_facetsbooleandefault: false

Include zero-count facet values when facets is enabled.

Example request

curl -X POST "https://api.moonlit.ai/v1.1/search/reference_search" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "all_facets": false,
  "documentTypes": [],
  "facets": false,
  "fieldsOfLaw": [],
  "jurisdictions": [],
  "num_results": 10,
  "page": 1,
  "portals": [],
  "query": "*",
  "reference_direction": 0,
  "reference_identifier": "32016R0679",
  "sort_type": 0,
  "sources": []
}'

Response

Reference search results

resultobject

Search result payload.

successboolean

Whether upstream query succeeded.

errorany | null

Upstream error payload.

The spec declares result as an open object; its fields are shown in the example below.

{
  "result": {
    "count": 1,
    "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>..."
        ],
        "semanticHighlights": null,
        "summary": null,
        "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",
            "parentId": null,
            "shortName": "European data protection law",
            "name": "European data protection law"
          }
        ],
        "documentTypes": [
          {
            "id": "04b42e5bf858a66de2229227deaa21e3",
            "parentId": null,
            "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",
        "inForce": null
      }
    ],
    "facets": null
  },
  "success": true,
  "error": null
}

Errors

400Invalid filter value or page out of range
401Missing or invalid API key
403Forbidden by role or jurisdiction scope
422Request validation error
500Internal server error
esc
↑↓ navigateenter openesc close