Skip to main content
If you keep a list of topics or rough citations, you can ground each one against authoritative text. This recipe walks a batch of inputs, searches each one, takes the best match, and attaches the canonical citation, an excerpt, and the official government source URL back onto your record. It paces requests to respect the rate limit and backs off on a 429. Endpoints used: POST /statutes/search. Optionally GET /statutes/section/{actId}/body when you want full text rather than the excerpt.
The base plan allows 30 requests per minute per key. Space your calls and honor the Retry-After header on a 429 so a large batch does not get throttled. See Rate limits.
1

Define your batch of inputs

Each input is a natural language topic or a rough citation you want to resolve. Scope with corpusType and state where you already know them; omit them to search the whole corpus.
Python
2

Search with rate-limit-aware pacing

Wrap the search call so it sleeps between requests to stay under the per-minute cap, and retries with a backoff when the API returns 429. Failed searches (for example a 404) return no match.
Python
3

Choose the best source URL

Prefer the official government link. govInfoHtmlUrl and stateHtmlUrl point at the authoritative federal and state publishers; htmlUrl is the general source link.
Python
4

Enrich each record

Build the search payload from each input, take the top match, and attach the canonical citation, excerpt, source URL, and actId (so you can fetch full text later).
Python
Example output:
5

Optionally attach full text

When you need the whole section rather than the excerpt, take the actId from a match and call the body endpoint. It returns text only when it is available.
Store the returned actId on your record. It is the stable handle for that section, so a later job can re-fetch metadata or full text without searching again.

Compare a rule across states

Run one query across several states and build a comparison.

Add the corpus as an agent tool

Expose statute search to a tool-calling agent.

Monitor corpus coverage

Detect when new corpora appear so you can re-enrich.

Best practices

Pace requests, cache coverage, and handle errors well.