Pagination

List endpoints page with limit and offset. There is no per_page, no page number, and no cursor.

How it works

Pass limit to set the page size and offset to skip rows. The endpoints that page echo what they applied in a pagination object:

json
{
  "data": [ /* … rows … */ ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "returned": 50
  }
}
  • limit — the page size actually applied, after clamping.
  • offset — the offset applied.
  • returned — how many rows are in this response.

There is no total count. Keep advancing the offset while returned === limit; a short page (or an empty one) means you have reached the end.

bash
# first page
curl "https://delilah-api.jsv21b.workers.dev/v1/bills?state=FL&limit=100" \
  -H "X-API-Key: dk_live_…"

# next page
curl "https://delilah-api.jsv21b.workers.dev/v1/bills?state=FL&limit=100&offset=100" \
  -H "X-API-Key: dk_live_…"

Limits and defaults

An out-of-range limit is clamped rather than rejected, so a request never fails for asking too much. offset caps at 100,000 — for anything deeper, narrow the query (by state, session_id, or updated_since) instead of paging further.

EndpointDefault limitMax limitOffset
/v1/bills50500yes
/v1/legislators100500yes
/v1/legislators/{id}/votes50500yes
/v1/legislators/{id}/bills50500yes
/v1/candidates50500yes
/v1/sessions100500no
/v1/committees100500no
/v1/hearings100500no
/v1/subjects1001000no
/v1/changes2001000no

Bill sub-resources (/sponsors, /history, /texts, /votes, and the rest) return the complete set for that bill and take no pagination parameters.

Recommended sync pattern: the change feed

Rather than re-listing bills, mirror once and then track deltas. Run a server-side job on a cadence:

  1. Backfill your store by paging /v1/bills per state.
  2. Record the summary.server_now value the change feed returns as your cursor.
  3. On each run, call GET /v1/changes?since=<cursor> — optionally filtered by state or reason.
  4. Re-fetch the bills named in the response and store the new summary.server_now.
bash
curl "https://delilah-api.jsv21b.workers.dev/v1/changes?since=2026-08-12T16:00:00Z&state=FL" \
  -H "X-API-Key: dk_live_…"
json
{
  "data": [
    { /* bill_id, bill_number, state_abbr, title, reason_id, reason_name, changed_at */ }
  ],
  "summary": {
    "since": "2026-08-12T16:00:00Z",
    "server_now": "2026-08-12T20:31:54.874Z"
  }
}

Without since the feed returns the last hour. For lower latency than polling, hold open the /v1/stream SSE endpoint or register a webhook — both are described in the API Reference. A cheaper alternative for coarse syncs is /v1/bills?updated_since=…, which filters the bill list itself by last-updated timestamp.