Sessions & states

The two reference lists everything else is keyed against: the 52 jurisdictions Delilah covers, and every legislative session within them.

Both paths are relative to https://delilah-api.jsv21b.workers.dev and require an X-API-Key header (Authentication). Both are cached for an hour, so they are cheap to call on startup and hold in memory rather than re-fetching per request. Field names in the samples are exactly what the API returns; values written as <type> are placeholders.

List legislative sessions

GET/v1/sessions

Sessions newest first, optionally narrowed to one jurisdiction. The session_id values here are what you pass to /v1/bills?session_id=.

ParameterTypeRequiredDescription
statestringOptional2-letter postal code (e.g. FL), DC, or US for Congress.
limitintegerOptionalMax rows. Defaults to 100, clamped to 500.
bash
curl "https://delilah-api.jsv21b.workers.dev/v1/sessions?state=FL" \
  -H "X-API-Key: dk_live_…"
json
{
  "data": [
    {
      "session_id": "<int>",
      "state_id": "<int>",
      "state_abbr": "<string>",
      "year_start": "<int>",
      "year_end": "<int>",
      "special": "<int>",
      "session_tag": "<string>",
      "session_title": "<string>",
      "session_name": "<string>",
      "sine_die": "<int>",
      "session_start_date": "<date>",
      "actual_sine_die_date": "<date>",
      "expected_sine_die_date": "<date>",
      "prefile": "<int>",
      "prior": "<int>",
      "source_url": "<string>"
    }
  ]
}

sine_die is the flag for “this session has adjourned”, so sine_die = 0 is the test for a session still sitting. session_start_date and actual_sine_die_date answer the sharper question of when it sat, and are filled in wherever the legislature publishes them — expect nulls in the states that do not. special marks a special session, and prefile and prior mark the prefile window and prior-session rollovers.

List jurisdictions

GET/v1/states

All 52 jurisdictions — the 50 states, the District of Columbia, and the federal Congress — in alphabetical order by code. This endpoint takes no parameters.

bash
curl "https://delilah-api.jsv21b.workers.dev/v1/states" \
  -H "X-API-Key: dk_live_…"
json
{
  "data": [
    {
      "state_id": "<int>",
      "state_abbr": "<string>",
      "state_name": "<string>",
      "capitol": "<string>"
    }
  ]
}

state_abbr is the value every other endpoint’s state filter expects. Two codes are worth memorising because they are not postal abbreviations of states: US is the federal Congress and DC is the District of Columbia.