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
/v1.1/search/filters/documenttypesParameters
No parameters.
Example request
curl "https://api.moonlit.ai/v1.1/search/filters/documenttypes" \
-H "Authorization: Bearer YOUR_API_KEY"Try it
/v1.1/search/filters/documenttypesNot run yetThe 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.
namestringDocument type label.
idstringDocument type ID.
childrenobject[] | nullNested 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
List Jurisdictions and Portals
/v1.1/search/filters/jurisdictions_portalsParameters
No parameters.
Example request
curl "https://api.moonlit.ai/v1.1/search/filters/jurisdictions_portals" \
-H "Authorization: Bearer YOUR_API_KEY"Try it
/v1.1/search/filters/jurisdictions_portalsNot run yetThe 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
namestringJurisdiction name.
countintegerNumber of indexed documents in this jurisdiction.
portalsobject[]Portals available under this jurisdiction.
namestringPortal hostname.
valuestringCanonical portal filter value to use in search requests.
countintegerNumber of indexed documents for this portal.
articles_supportedbooleanTrue when this portal contains composite documents (laws/regulations), so `GET /v1.1/document/articles` returns article/section trees for it.
idinteger | nullCanonical 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
List Fields-of-Law Tree
/v1.1/search/filters/treesParameters
No parameters.
Example request
curl "https://api.moonlit.ai/v1.1/search/filters/trees" \
-H "Authorization: Bearer YOUR_API_KEY"Try it
/v1.1/search/filters/treesNot run yetThe 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.
namestringField-of-law label.
idstringField-of-law identifier.
childrenobject[] | nullNested child fields.
namestringNode label.
idstringNode identifier.
childrenobject[] | nullNested child nodes.
array of the same shape
Errors
List Sources
/v1.1/search/filters/sourcesParameters
jurisdictionsstring | nullComma-separated jurisdiction names from /v1.1/search/filters/jurisdictions_portals.
portalsstring | nullComma-separated portal values from /v1.1/search/filters/jurisdictions_portals.
document_typesstring | nullComma-separated document type IDs from /v1.1/search/filters/documenttypes. Source counts reflect only documents of these types.
searchstring | nullCase- and accent-insensitive substring match on source name. Matching sources are returned with their full subtree; ancestors of matches are kept.
limitinteger | nullMaximum number of sources kept under each top-level category, ranked by document count. Omit for the full tree. Ignored when `complete=true`.
completebooleandefault: falseReturn 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
/v1.1/search/filters/sourcesNot run yetThe 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.
namestringFull name of the source.
valuestringSource identifier. Use this value in the `sources` array of keyword or semantic search requests to filter by this source.
parentIdstring | nullIdentifier of the parent source.
countintegerNumber of indexed documents for this source.
otherCountinteger | nullNumber of child sources omitted from this node because of the limit.
childrenobject[] | nullNested child sources.
array of the same shape
totalintegerNumber of source nodes in scope before the limit was applied (itself capped by the Elasticsearch bucket limit unless complete=true).
truncatedbooleanTrue when the limit dropped at least one source node or the Elasticsearch bucket limit cut the list.
Errors
List Semantic Portals
/v1.1/search/semantic_portalsParameters
No parameters.
Example request
curl "https://api.moonlit.ai/v1.1/search/semantic_portals" \
-H "Authorization: Bearer YOUR_API_KEY"Try it
/v1.1/search/semantic_portalsNot run yetThe 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
namestringPortal hostname.
valuestringDataSource|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"
}
]