Documents
Full document retrieval and article-level structure.
Retrieve Document
Parameters
DocumentIdentifierstringrequiredUnique identifier of the document to retrieve.
markdownbooleandefault: falseWhen true, converts the document's HTML to Markdown and includes it in the `markdown` response field. The `html` field is omitted from the response to save bandwidth. Note: adds latency due to an external conversion step.
Example request
curl "https://api.moonlit.ai/v1.1/document/retrieve_document?DocumentIdentifier=32019L0001" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY"Response
Full document with text content and metadata
identifierstringUnique document identifier.
secondaryIdentifierstring | nullSecondary document identifier.
tertiaryIdentifierstring | nullTertiary document identifier.
languagestring | nullDocument language code.
datestring | nullDocument date in YYYY-MM-DD format.
titlestring | nullDocument title.
sourcestring | nullIssuing entity name (e.g. court or legislative body).
jurisdictionstring | nullJurisdiction name for the document.
portalstring | nullPortal domain the document originates from.
sourceUrlstring | nullSource URL to the original document.
sourcePdfstring | nullSource URL to the PDF rendition when available.
sourcesobject[] | nullHierarchical list of source entries.
idstringUnique identifier.
parentIdstring | nullParent node identifier.
namestring | nullFull display name.
documentTypesobject[] | nullHierarchical list of document-type classification entries.
idstringUnique identifier.
parentIdstring | nullParent node identifier.
namestring | nullFull display name.
textstring | nullFull text content of the document.
htmlstring | nullHTML rendition of the full document.
markdownstring | nullMarkdown rendition of the document (only present when markdown=true).
yearinteger | nullPublication year.
inForceboolean | nullWhether the document is currently in force.
referencedinteger | nullNumber of documents that reference this document.
summarystring | nullAI-generated summary of the document.
publicAccessboolean | nullWhether the document is publicly accessible. False for Unknown-jurisdiction documents and Raad van Arbitrage portals; true otherwise.
{
"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",
"parentId": null,
"name": "Legislative bodies"
},
{
"id": "c9aca61be7de06a023b67cc6ab78bf72",
"parentId": "b49c23adeaa6a345aa815e401c6d194b",
"name": "European Parliament"
}
],
"documentTypes": [
{
"id": "87a86c141d2c0649a699745ba63e4c6b",
"parentId": "18fead608f1a4dcb5671b9fc8aeab4d1",
"name": "European law"
},
{
"id": "18fead608f1a4dcb5671b9fc8aeab4d1",
"parentId": null,
"name": "Laws and regulations"
}
],
"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..."
}Errors
List Document Articles
Parameters
DocumentIdentifierstringrequiredUnique identifier of the document to list articles for.
hierarchybooleandefault: trueWhen true (default), returns articles as a nested tree structure based on hierarchy levels. When false, returns a flat list.
includeHtmlbooleandefault: falseWhen true, includes the HTML content of each article/element in the response. When false (default), the elementHtml field is omitted.
Example request
curl "https://api.moonlit.ai/v1.1/document/articles?DocumentIdentifier=32016R0679" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY"Response
List of articles in the document (empty if not a composite document)
elementIdentifierstringUnique article/element identifier. Use as article_reference_id in reference search.
elementTitlestring | nullArticle title (e.g. 'Article 1').
elementSubTitlestring | nullArticle subtitle.
elementHtmlstring | nullHTML content of the article/element.
referenceCountintegerNumber of documents referencing this article.
levelintegerHierarchy level within the document.
globalOrderintegerSort order within the document.
childrenobject[] | nullNested child articles/elements. Only populated when hierarchy=true.
array of the same shape
The response is a JSON array; each item has the fields below.