Skip to main content
Many legal questions are really the same question asked of many jurisdictions: how does each state handle security deposits, non-competes, or breach notice? This recipe runs one query with corpusType=STATE across a list of state codes, keeps the top section per state, and assembles a comparison table of state to citation to excerpt and source link. Endpoints used: GET /statutes/coverage to pick states, then POST /statutes/search.
Call /statutes/coverage first and keep only the states that actually carry the STATE corpus. That way you never run a search against a jurisdiction that has no data to return.
1

Pick states that have the corpus

Read the coverage matrix and collect the codes of state jurisdictions whose corpora includes the corpus you want to compare (here, STATE).
Python
2

Search one state at a time

Send the same query for each state, scoping with corpusType="STATE" and the 2-letter lowercase state code. Keep limit small since you only want the best match per state.
A trimmed single-state response:
3

Pick the best source link per result

Each result carries several optional source URLs. Prefer the official government link when present, falling back gracefully.
Python
4

Assemble the comparison

Iterate over your chosen states, collect the top section for each, and build one row per state. States with no match are recorded so gaps are visible.
Python
Example output:
relevanceScore is a relative rank within a single response. Do not compare scores across states to decide which jurisdiction is “more relevant”; use it only to order results inside one state’s response.

Monitor corpus coverage

Poll the coverage endpoint and diff snapshots over time.

Enrich a citation database

Attach canonical citations, excerpts, and source links to a batch of topics.

Coverage matrix

See which states carry which corpora.

Best practices

Scope queries, pace requests, and handle errors well.