Skip to main content
A section can come back in more than one form. The API gives you rendered text directly, plus links to the original files the source publishes. Which formats exist depends on what the underlying government source makes available, so any given field may be null.

Text from the body endpoint

GET /statutes/section/{actId}/body returns the section’s full text in two forms: Use html when you are displaying the section in a UI and want its structure preserved. Use plain when you are feeding the text to an LLM in your stack or doing plain-text processing. Always check available first.

Source URL fields

Search results and the section metadata object carry a set of source URL fields. These point at the original files the publisher hosts. Any of them may be null depending on what that source offers:
The government links (stateHtmlUrl, govInfoHtmlUrl, govInfoPdfUrl) let you deep-link users straight back to authoritative text on the state legislature’s site or govinfo.gov. That is the recommended way to cite a source in your product.

Picking the best available format

Because fields can be null, choose the best format that is present rather than assuming one exists. This helper prefers an official government link, then falls back through the other formats:
For displaying the text itself, prefer html from the /body endpoint. For citing where it came from, prefer an official government link (govInfoHtmlUrl or stateHtmlUrl) so readers can verify against the authoritative source.

Section Identifiers

How to get an actId and fetch a section’s metadata and body.

Corpus Types

The corpusType tokens you filter a search by.