429.
Endpoints used: POST /statutes/search. Optionally GET /statutes/section/{actId}/body when you want full text rather than the excerpt.
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 Example output:
actId (so you can fetch full text later).Python
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.Related
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.

