Documents

Full document retrieval and article-level structure.

Retrieve Document

GET/v1.1/document/retrieve_documentOpen in Swagger
Retrieve full document content and metadata by identifier.

Parameters

DocumentIdentifierstringrequired

Unique identifier of the document to retrieve.

e.g. 32019L0001
markdownbooleandefault: false

When 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

identifierstring

Unique document identifier.

secondaryIdentifierstring | null

Secondary document identifier.

tertiaryIdentifierstring | null

Tertiary document identifier.

languagestring | null

Document language code.

datestring | null

Document date in YYYY-MM-DD format.

titlestring | null

Document title.

sourcestring | null

Issuing entity name (e.g. court or legislative body).

jurisdictionstring | null

Jurisdiction name for the document.

portalstring | null

Portal domain the document originates from.

sourceUrlstring | null

Source URL to the original document.

sourcePdfstring | null

Source URL to the PDF rendition when available.

sourcesobject[] | null

Hierarchical list of source entries.

idstring

Unique identifier.

parentIdstring | null

Parent node identifier.

namestring | null

Full display name.

documentTypesobject[] | null

Hierarchical list of document-type classification entries.

idstring

Unique identifier.

parentIdstring | null

Parent node identifier.

namestring | null

Full display name.

textstring | null

Full text content of the document.

htmlstring | null

HTML rendition of the full document.

markdownstring | null

Markdown rendition of the document (only present when markdown=true).

yearinteger | null

Publication year.

inForceboolean | null

Whether the document is currently in force.

referencedinteger | null

Number of documents that reference this document.

summarystring | null

AI-generated summary of the document.

publicAccessboolean | null

Whether 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

401Missing or invalid API key
403Forbidden by role or jurisdiction scope
422Request validation error
500Internal server error

List Document Articles

GET/v1.1/document/articlesOpen in Swagger
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. Set `hierarchy=true` to receive a nested tree structure where child articles are nested under their parent elements based on the `level` field.

Parameters

DocumentIdentifierstringrequired

Unique identifier of the document to list articles for.

e.g. 32016R0679
hierarchybooleandefault: true

When true (default), returns articles as a nested tree structure based on hierarchy levels. When false, returns a flat list.

includeHtmlbooleandefault: false

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

elementIdentifierstring

Unique article/element identifier. Use as article_reference_id in reference search.

elementTitlestring | null

Article title (e.g. 'Article 1').

elementSubTitlestring | null

Article subtitle.

elementHtmlstring | null

HTML content of the article/element.

referenceCountinteger

Number of documents referencing this article.

levelinteger

Hierarchy level within the document.

globalOrderinteger

Sort order within the document.

childrenobject[] | null

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

Errors

401Missing or invalid API key
403Forbidden by role or jurisdiction scope
422Request validation error
500Internal server error
esc
↑↓ navigateenter openesc close