curl --request POST \
--url https://api.vaquill.ai/api/v1/us/statutes/count \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"corpusType": "REGULATION",
"state": "tx",
"code": "tx_26",
"titleNumber": 42,
"chapter": "554",
"part": "240",
"actStatus": "repealed",
"excludeRepealed": true
}
'import requests
url = "https://api.vaquill.ai/api/v1/us/statutes/count"
payload = {
"corpusType": "REGULATION",
"state": "tx",
"code": "tx_26",
"titleNumber": 42,
"chapter": "554",
"part": "240",
"actStatus": "repealed",
"excludeRepealed": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
corpusType: 'REGULATION',
state: 'tx',
code: 'tx_26',
titleNumber: 42,
chapter: '554',
part: '240',
actStatus: 'repealed',
excludeRepealed: true
})
};
fetch('https://api.vaquill.ai/api/v1/us/statutes/count', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vaquill.ai/api/v1/us/statutes/count"
payload := strings.NewReader("{\n \"corpusType\": \"REGULATION\",\n \"state\": \"tx\",\n \"code\": \"tx_26\",\n \"titleNumber\": 42,\n \"chapter\": \"554\",\n \"part\": \"240\",\n \"actStatus\": \"repealed\",\n \"excludeRepealed\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"count": 43638,
"isExact": true,
"scope": {
"corpusType": "REGULATION",
"state": "tx"
},
"processingTimeMs": 85.2,
"creditsConsumed": 1
}{
"detail": "Insufficient API credits."
}{
"detail": "Insufficient API credits."
}{
"detail": "Insufficient API credits."
}{
"detail": "Insufficient API credits."
}Count the sections in a scope
How many sections sit in a jurisdiction, corpus, code, title, chapter or part.
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.
There is no query parameter, on purpose. Search ranks over a bounded
window, so “how many sections match this query” has no answer beyond the size of
that window. 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.
The figure counts SECTIONS. Long sections are stored as several passages and are counted once.
curl --request POST \
--url https://api.vaquill.ai/api/v1/us/statutes/count \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"corpusType": "REGULATION",
"state": "tx",
"code": "tx_26",
"titleNumber": 42,
"chapter": "554",
"part": "240",
"actStatus": "repealed",
"excludeRepealed": true
}
'import requests
url = "https://api.vaquill.ai/api/v1/us/statutes/count"
payload = {
"corpusType": "REGULATION",
"state": "tx",
"code": "tx_26",
"titleNumber": 42,
"chapter": "554",
"part": "240",
"actStatus": "repealed",
"excludeRepealed": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
corpusType: 'REGULATION',
state: 'tx',
code: 'tx_26',
titleNumber: 42,
chapter: '554',
part: '240',
actStatus: 'repealed',
excludeRepealed: true
})
};
fetch('https://api.vaquill.ai/api/v1/us/statutes/count', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vaquill.ai/api/v1/us/statutes/count"
payload := strings.NewReader("{\n \"corpusType\": \"REGULATION\",\n \"state\": \"tx\",\n \"code\": \"tx_26\",\n \"titleNumber\": 42,\n \"chapter\": \"554\",\n \"part\": \"240\",\n \"actStatus\": \"repealed\",\n \"excludeRepealed\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"count": 43638,
"isExact": true,
"scope": {
"corpusType": "REGULATION",
"state": "tx"
},
"processingTimeMs": 85.2,
"creditsConsumed": 1
}{
"detail": "Insufficient API credits."
}{
"detail": "Insufficient API credits."
}{
"detail": "Insufficient API credits."
}{
"detail": "Insufficient API credits."
}Authorizations
API key issued from the developer dashboard. Pass as Authorization: Bearer vq_key_...
Body
Filter-only section count. See POST /us/statutes/count.
Deliberately takes NO query. A count of "sections matching this query"
does not exist: ranking runs over a bounded window, so the honest answer to
that question is the window size rather than a corpus figure. This counts a
SCOPE, which is exact, cheap, and the number an acquisition job actually
needs before it starts walking.
Corpus to count, single or list. Omit to count every corpus.
USC, CFR, STATE, CONSTITUTION, FEDERAL_RULES, STATE_CONSTITUTION, STATE_RULES, EXECUTIVE_ACTION, REGULATION, FEDERAL_REGISTER, FEDERAL_REGISTER_NOTICE, AGENCY_GUIDANCE, SENTENCING_GUIDELINES, US_TAX_TREATY, STATE_AGENCY_GUIDANCE, STATE_AG_OPINION, SESSION_LAW, STATUTE_COMPILATION, AGENCY_ADJUDICATION, CFR_ANNUAL, USC_ANNUAL "REGULATION"
Two-letter jurisdiction code or federal, single or list.
federal, al, ak, az, ar, ca, co, ct, de, dc, fl, ga, hi, id, il, in, ia, ks, ky, la, me, md, ma, mi, mn, ms, mo, mt, ne, nv, nh, nj, nm, ny, nc, nd, oh, ok, or, pa, pr, ri, sc, sd, tn, tx, ut, vt, va, wa, wv, wi, wy "tx"
State code identifier, e.g. tx_26. Pair with state.
"tx_26"
USC or CFR title number.
42
Chapter identifier. Pair with titleNumber or code.
"554"
CFR part identifier. Pair with titleNumber.
"240"
Count only sections carrying this status.
"repealed"
Exclude sections whose status is affirmatively dead. A section with no recorded status is KEPT, because a missing status is not evidence of repeal. The US Code is served from a stored annual edition, so a section repealed after it closed is counted here; see the same field on /search for the measurement.
true
Response
The number of sections in scope, and the scope that produced it.
Response for POST /us/statutes/count.
Sections in scope. This is a SECTION count, not a passage count: long sections are stored as several passages and are counted once.
43638
True when the figure is an exact count rather than an estimate. Present so a future estimated mode cannot be mistaken for this one.
true
The filters that produced this figure, echoed back. A count with no scope attached is not reproducible, and an ignored filter would otherwise be invisible.
{ "corpusType": "REGULATION", "state": "tx" }
Server-side time for this request in milliseconds.
85.2
Credits actually charged for this call.
1
Was this page helpful?

