curl --request GET \
--url https://api.vaquill.ai/api/v1/us/session-laws/changes \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vaquill.ai/api/v1/us/session-laws/changes"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vaquill.ai/api/v1/us/session-laws/changes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vaquill.ai/api/v1/us/session-laws/changes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Feed of changes to the session-law registry
A sync feed of the registry: every state law that began to be served, had its text added, was
corrected, unserved, withdrawn or merged, oldest first, as a cursor over an integer id. Poll it to
keep a copy of the registry current without re-listing it: read from sinceId=0 once, then call
again with the cursor you were given. It covers state session laws only; federal acts (SAL_...)
are not in it.
Cost: 1 credit per page of up to 200 entries (default 50). An empty page is an answer, “nothing changed since your cursor”, and is charged. A request that fails validation (422) is not charged; a failure on our side (500, 503) is refunded.
Walking the feed. Send sinceId=0 for the first page. While hasMore is true, call again with
sinceId set to cursor: id only grows and a page carries the entries after sinceId and
nothing else, so no entry is skipped or repeated between your calls. When hasMore is false you
have caught up as of this call; keep your cursor and ask again later. An empty page has
cursor: null: keep the one you hold. id is assigned in order, but a row can become visible
slightly after a later one if two writers commit at once (writers commit whole batches together, so
this has not happened); a job that cannot miss an entry can re-read the last few hundred ids.
What an entry says. kind is what happened (see its description), sessionLawId the law,
jurisdiction its state, and detectedAt when we recorded it: an upper bound on when the law
changed in the world, not an approval or effective date. Read the law at
GET /us/session-laws/{sessionLawId}, or many at once with POST /us/session-laws/batch. A
withdrawn or merged entry is a tombstone: the law no longer answers there, and a merged entry
carries mergedInto, the sessionLawId to read instead.
Filter. jurisdiction limits the feed to one state, dc or pr, and then hasMore means more
matching entries follow. The response echoes the applied filter as jurisdiction (null when
unfiltered); an empty jurisdiction= is a 422, not “every state”. The cursor is a position in the
whole feed, so the same sinceId means the same point with or without the filter, and a filtered
page can skip ids.
Example
curl "https://api.vaquill.ai/api/v1/us/session-laws/changes?sinceId=0&limit=100" \
-H "Authorization: Bearer $VAQUILL_API_KEY"
let cursor = 0;
for (;;) {
const res = await fetch(`https://api.vaquill.ai/api/v1/us/session-laws/changes?sinceId=${cursor}`, {
headers: { Authorization: `Bearer ${process.env.VAQUILL_API_KEY}` },
});
const page = await res.json();
for (const change of page.changes) handle(change);
if (page.cursor !== null) cursor = page.cursor;
if (!page.hasMore) break;
}
Related endpoints
GET /us/session-laws/listlists the laws of one state, filtered; this feed is how you learn that one changed.POST /us/session-laws/batchreads many laws at once from the ids this feed returns.GET /us/statutes/coveragesays which sessions we hold and how complete each is, in each jurisdiction’ssessionLawsblock.
Nulls. Every response field is present: one with no value is null ([] for a list). The
examples here leave the nulls out.
curl --request GET \
--url https://api.vaquill.ai/api/v1/us/session-laws/changes \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vaquill.ai/api/v1/us/session-laws/changes"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vaquill.ai/api/v1/us/session-laws/changes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vaquill.ai/api/v1/us/session-laws/changes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Authorizations
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.
16 - 255^[\x21-\x7e]+$"3f9c2a1e-7b44-4d0a-9c1e-5a6b7c8d9e0f"
Query Parameters
Return only entries with an id greater than this: the cursor for walking the feed forward. Send 0 (the default) to start from the beginning, then the cursor of your last page. id is an integer that only grows, so this is exact and immune to clock skew. A negative or non-integer value is a 422 and is never charged; a value past the newest id is an empty page, which is charged.
0 <= x <= 92233720368547760001500
Limit the feed to one jurisdiction: a two-letter state code, dc or pr, case-insensitive; the response echoes it as jurisdiction. Omit for every jurisdiction (an empty value is a 422, not "every state"). federal and any unknown code is a 422 and is never charged: federal session laws are not in this feed. The cursor is a position in the whole feed, so a filtered page may have gaps in id.
al, ak, as, az, ar, ca, co, ct, de, dc, fl, ga, gu, hi, id, il, in, ia, ks, ky, la, me, md, ma, mi, mn, ms, mo, mt, ne, nv, nh, nj, nm, ny, nc, nd, mp, oh, ok, or, pa, pr, ri, sc, sd, tn, tx, ut, vt, vi, va, wa, wv, wi, wy "mn"
Response
A page of the feed, oldest first. hasMore and cursor say how to continue; an empty changes is a charged answer.
Response for GET /us/session-laws/changes.
Was this page helpful?

