Count the sections in a scope
Changed onHow many sections sit in a jurisdiction, corpus, code, title, chapter, part, article or federal rule set. The scoping filters (code, article, chapter, part) take the same values and pairing rules as on /us/statutes/search.
Cost: 1 credit. A scope that matches nothing is refunded, because an empty answer here is usually a wrong filter rather than a finding.
Use it to size a job before you run it. Walking a container with /us/statutes/divisions and hydrating what you find is cheap per call and adds up across a whole corpus, so this is the call that tells you what you are about to spend before you spend it.
A natural-language query is refused, on purpose. Search ranks it over a bounded window, so "how many sections match this question" has no answer beyond the size of that window. Without a query this counts a SCOPE, which is exact. Pair the two: count the scope here, enumerate it with /us/statutes/divisions, then rank within it using /us/statutes/search.
Boolean counts. With matchType: "boolean" and a terms-and-connectors query (the syntax of /us/statutes/search), this counts the sections that satisfy the expression within the scope, the same figure a Boolean search reports as totalMatches. isExact: false marks an upper bound: the expression uses an operator the index cannot judge exactly (phrases, /s, /p, proximity, atleastN, wildcards inside proximity) or a filter it does not apply (anything beyond corpusType, state, actStatus and excludeRepealed). Same price; a malformed expression is a 422 and is not charged.
The figure counts SECTIONS. Long sections are stored as several passages and are counted once.
What an unscoped count leaves out. With no corpusType, past editions (annual CFR printings) and proposals (bills) are not counted, exactly as in /us/statutes/search and /us/statutes/coverage; the echo lists them under excludedCategories. Name one in corpusType to count it.
Agreement with /us/statutes/divisions. The browse counts distinct sections, so a section re-ingested additively (a superseded and a current copy under one id) is one section there. A scope of up to 4,000 sections is counted the same way (scope.countBasis is distinctActIds), so the children's sectionCount values sum to this figure. A larger scope reports countBasis: "sectionPoints" with scope.supersededSectionPoints, the most such copies could overstate the figure by.
Request
- Base URLhttps://api.vaquill.ai
- Auth
- HTTP bearer
- or API key in header X-API-Key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
Optional. 16 to 255 visible ASCII characters (a UUIDv4 works). Repeating the same request with the same key replays the original 2xx response for 24 hours without charging again. The same key on a different request is rejected. With the account's cacheQueryDerivedData retention setting off, no body is stored and a retry answers 409 idempotency_replay_unavailable, still without a second charge.
Request body
Example request
{
"query": "retaliat! /s whistleblow!",
"matchType": "boolean",
"titleNumber": 42,
"excludeRepealed": true
}Response
The number of sections in scope, and the scope that produced it.
Example response
{
"count": 43638,
"isExact": true,
"parsedQuery": "retaliat! /s whistleblow!",
"scope": {
"corpusType": "REGULATION",
"state": "tx"
},
"processingTimeMs": 85.2,
"creditsConsumed": 1
}Changes
- info
added the non-success response with the status
- info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status
- info