Get a law document
Retrieve one law document — a statute section, regulation, constitutional provision, guidance document, or a container node (title / chapter / part) — with its verbatim text, hierarchy context, and version history.
Lookup methods (provide exactly ONE):
-
citation— canonical citation (e.g."42 U.S.C. § 1983","Cal. Code Regs. tit. 22, § 51451"). Matching ignores punctuation, spacing, and§/sec./sectionstyle, but not abbreviation differences. -
register_citation— Federal Register or state register citation of a rule document (e.g."89 FR 12345"). -
path— full ltree path (from a search result or a previous get); addcollectionsince paths are only unique per collection. -
id— document UUID (always unambiguous; ids come from search results,children,versions, ormatches).
Currency & versions. By default the lookup resolves to the CURRENT
version (see /laws/search for the derivation). When the document has
version history, versions lists every version with its dates and
currency flags. An id lookup returns that exact version; historical
versions and widened lookups require full historical access.
Container nodes. When the resolved document is not a leaf
(node_type: "PARENT"), children lists its current children in the
code's authored order — navigation rows only (number, citation,
title, sort order; no html), capped at 250 with the true count in
children_total. Fetch a child's text by its id, or navigate up via
the document's parent_id. For containers with many children, search
directly for the target section instead of walking the tree.
Responses are discriminated by status:
found—document+children+versionsambiguous(citation matched several documents) —matchesto pick from-
not_found(HTTP 404) —messageexplains; it may suggest retrying withinclude_historicalwhen only non-current versions exist.
Provide exactly ONE of id, path, citation, register_citation.
- Type: stringcitation
Canonical citation; matching ignores punctuation, spacing, and § / sec. / section style, but not abbreviation differences
- Type: stringcollection
Collection id or human-readable name that disambiguates path/citation/register-citation lookups
- Type: string Format: uuidid
- Type: booleaninclude
_historical Allow resolving superseded or future-effective versions
- Type: stringpath
Full ltree path; pair with collection
- Type: stringregister
_citation Federal Register / state register citation
- application/json
- 400
Validation error (e.g. zero or multiple lookup keys)
- 401
Unauthorized
- 403
Historical access requires a full-access API key
- 404
No document matched
curl https://app.midpage.ai/api/v1/laws/get \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"citation": "42 U.S.C. § 1983"
}'
{
"status": "found",
"document": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"parent_id": "123e4567-e89b-12d3-a456-426614174000",
"collection_id": "string",
"collection_name": "Code of Federal Regulations",
"collection_type": "regulation",
"state": "Federal",
"country": "US",
"path": "string",
"node_type": "LEAF",
"number": "string",
"title": "string",
"citation": "string",
"register_citation": "string",
"effective_date": "2026-07-13",
"publication_date": "2026-07-13",
"source_as_of": "2026-07-13",
"is_current": true,
"is_historical": true,
"sort_order": 1,
"source_url": "string",
"url": "https://example.com",
"html": "string"
},
"children": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"path": "string",
"node_type": "string",
"number": "string",
"title": "string",
"citation": "string",
"sort_order": 1,
"effective_date": "2026-07-13"
}
],
"children_total": 1,
"versions": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"effective_date": "2026-07-13",
"publication_date": "2026-07-13",
"source_as_of": "2026-07-13",
"is_historical": true,
"is_current": true,
"is_requested": true
}
],
"matches": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"collection_id": "string",
"collection_type": "string",
"state": "string",
"path": "string",
"citation": "string",
"title": "string",
"is_current": true
}
],
"message": "string"
}