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.
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 A trimmed single-state response:
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.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.Example output:
Python
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.Related
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.

