Filters

The valid values for scoping a search: jurisdictions and portals, document types, fields of law, sources, and the portals that support semantic search.

List Document Types

GET/v1.1/search/filters/documenttypes
Returns document type IDs structured as a hierarchical tree with nested child categories for filtering search endpoints.

Parameters

No parameters.

Example request

curl "https://api.moonlit.ai/v1.1/search/filters/documenttypes" \
  -H "Authorization: Bearer YOUR_API_KEY"

Try it

GET/v1.1/search/filters/documenttypesNot run yet
Region

The key stays in this browser tab and is sent only to api.moonlit.ai. Every request counts against your plan like any other call.

This endpoint takes no parameters.

Response

Hierarchical document type tree

DocumentTypesobject[]

Hierarchical document type tree used by search filters.

namestring

Document type label.

idstring

Document type ID.

childrenobject[] | null

Nested child document types.

array of the same shape

{
  "DocumentTypes": [
    {
      "name": "Decisions",
      "id": "04b42e5bf858a66de2229227deaa21e3",
      "children": []
    },
    {
      "name": "Laws and regulations",
      "id": "18fead608f1a4dcb5671b9fc8aeab4d1",
      "children": [
        {
          "name": "National law",
          "id": "fbee5d2e827c7307c755601603c91bc3",
          "children": []
        }
      ]
    }
  ]
}

Errors

400Invalid filter value or page out of range
401Missing or invalid API key
403Forbidden by role or jurisdiction scope
422Request validation error
429Monthly quota exhausted. Sent by the API gateway; the body is {"statusCode": 429, "message": "..."}.
500Internal server error

List Jurisdictions and Portals

GET/v1.1/search/filters/jurisdictions_portals
Returns jurisdiction names and their portals. Use each portal's `value` field as the canonical `portals` filter input for search endpoints.

Parameters

No parameters.

Example request

curl "https://api.moonlit.ai/v1.1/search/filters/jurisdictions_portals" \
  -H "Authorization: Bearer YOUR_API_KEY"

Try it

GET/v1.1/search/filters/jurisdictions_portalsNot run yet
Region

The key stays in this browser tab and is sent only to api.moonlit.ai. Every request counts against your plan like any other call.

This endpoint takes no parameters.

Response

Jurisdictions with their portals

namestring

Jurisdiction name.

countinteger

Number of indexed documents in this jurisdiction.

portalsobject[]

Portals available under this jurisdiction.

namestring

Portal hostname.

valuestring

Canonical portal filter value to use in search requests.

countinteger

Number of indexed documents for this portal.

articles_supportedboolean

True when this portal contains composite documents (laws/regulations), so `GET /v1.1/document/articles` returns article/section trees for it.

idinteger | null

Canonical numeric DataSource ID. Populated only when the caller passes the internal return_integers flag.

The response is a JSON array; each item has the fields below.

[
  {
    "name": "European Union",
    "count": 1069270,
    "portals": [
      {
        "name": "eur-lex.europa.eu",
        "value": "0|eur-lex.europa.eu",
        "count": 806813
      }
    ]
  },
  {
    "name": "Netherlands",
    "count": 3474823,
    "portals": [
      {
        "name": "rechtspraak.nl",
        "value": "1|rechtspraak.nl",
        "count": 2971766
      },
      {
        "name": "wetten.overheid.nl",
        "value": "1|wetten.overheid.nl",
        "count": 173618
      }
    ]
  }
]

Errors

400Invalid filter value or page out of range
401Missing or invalid API key
403Forbidden by role or jurisdiction scope
422Request validation error
429Monthly quota exhausted. Sent by the API gateway; the body is {"statusCode": 429, "message": "..."}.
500Internal server error

List Fields-of-Law Tree

GET/v1.1/search/filters/trees
Returns hierarchical fields-of-law for use in search filters.

Parameters

No parameters.

Example request

curl "https://api.moonlit.ai/v1.1/search/filters/trees" \
  -H "Authorization: Bearer YOUR_API_KEY"

Try it

GET/v1.1/search/filters/treesNot run yet
Region

The key stays in this browser tab and is sent only to api.moonlit.ai. Every request counts against your plan like any other call.

This endpoint takes no parameters.

Response

Successful Response

FieldsOfLawobject[]

Hierarchical tree of fields of law.

namestring

Field-of-law label.

idstring

Field-of-law identifier.

childrenobject[] | null

Nested child fields.

namestring

Node label.

idstring

Node identifier.

childrenobject[] | null

Nested child nodes.

array of the same shape

Errors

400Invalid filter value or page out of range
401Missing or invalid API key
403Forbidden by role or jurisdiction scope
422Request validation error
429Monthly quota exhausted. Sent by the API gateway; the body is {"statusCode": 429, "message": "..."}.
500Internal server error

List Sources

GET/v1.1/search/filters/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. With `limit`, every top-level category with documents is returned and only the `limit` highest-count sources under each are kept; the category carries an `otherCount` of omitted children. `truncated` tells whether anything was cut.

Parameters

jurisdictionsstring | null

Comma-separated jurisdiction names from /v1.1/search/filters/jurisdictions_portals.

e.g. Netherlands,Belgium
portalsstring | null

Comma-separated portal values from /v1.1/search/filters/jurisdictions_portals.

e.g. 0|eur-lex.europa.eu,1|rechtspraak.nl
document_typesstring | null

Comma-separated document type IDs from /v1.1/search/filters/documenttypes. Source counts reflect only documents of these types.

e.g. 18fead608f1a4dcb5671b9fc8aeab4d1
searchstring | null

Case- and accent-insensitive substring match on source name. Matching sources are returned with their full subtree; ancestors of matches are kept.

e.g. Hof van Cassatie
limitinteger | null

Maximum number of sources kept under each top-level category, ranked by document count. Omit for the full tree. Ignored when `complete=true`.

1 to 4000
completebooleandefault: false

Return every source in scope instead of the top `limit`. Requires `jurisdictions` or `portals`; the unscoped list has ~16k sources.

Example request

curl "https://api.moonlit.ai/v1.1/search/filters/sources" \
  -H "Authorization: Bearer YOUR_API_KEY"

Try it

GET/v1.1/search/filters/sourcesNot run yet
Region

The key stays in this browser tab and is sent only to api.moonlit.ai. Every request counts against your plan like any other call.

Response

Successful Response

Sourcesobject[]

Hierarchical tree of sources, highest document counts first.

namestring

Full name of the source.

valuestring

Source identifier. Use this value in the `sources` array of keyword or semantic search requests to filter by this source.

parentIdstring | null

Identifier of the parent source.

countinteger

Number of indexed documents for this source.

otherCountinteger | null

Number of child sources omitted from this node because of the limit.

childrenobject[] | null

Nested child sources.

array of the same shape

totalinteger

Number of source nodes in scope before the limit was applied (itself capped by the Elasticsearch bucket limit unless complete=true).

truncatedboolean

True when the limit dropped at least one source node or the Elasticsearch bucket limit cut the list.

Errors

400Invalid filter value or page out of range
401Missing or invalid API key
403Forbidden by role or jurisdiction scope
422Request validation error
429Monthly quota exhausted. Sent by the API gateway; the body is {"statusCode": 429, "message": "..."}.
500Internal server error

List Semantic Portals

GET/v1.1/search/semantic_portals
Returns the list of portals currently enabled as semantic-search sources.

Parameters

No parameters.

Example request

curl "https://api.moonlit.ai/v1.1/search/semantic_portals" \
  -H "Authorization: Bearer YOUR_API_KEY"

Try it

GET/v1.1/search/semantic_portalsNot run yet
Region

The key stays in this browser tab and is sent only to api.moonlit.ai. Every request counts against your plan like any other call.

This endpoint takes no parameters.

Response

Portals enabled for semantic search

namestring

Portal hostname.

valuestring

DataSource|Portal composite key for filtering.

The response is a JSON array; each item has the fields below.

[
  {
    "name": "eur-lex.europa.eu",
    "value": "0|eur-lex.europa.eu"
  },
  {
    "name": "wetten.overheid.nl",
    "value": "1|wetten.overheid.nl"
  }
]

Errors

400Invalid filter value or page out of range
401Missing or invalid API key
403Forbidden by role or jurisdiction scope
422Request validation error
429Monthly quota exhausted. Sent by the API gateway; the body is {"statusCode": 429, "message": "..."}.
500Internal server error
esc
↑↓ navigateenter openesc close