{"openapi":"3.1.0","info":{"title":"LegisData API","version":"1.0.0","description":"Commercial REST API over VoterOpinion's aggregated U.S. state legislative data: bill search & detail, legislators, roll-call vote histories, and derived ideology/bipartisan metrics. Chambers are normalized to upper/lower. Authenticate with an API key."},"servers":[{"url":"https://legisdata.dev/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Send your key as 'Authorization: Bearer vd_live_…'."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","unauthorized","forbidden","not_found","rate_limited","quota_exceeded","internal"]},"message":{"type":"string"}}}}},"Pagination":{"type":"object","properties":{"page":{"type":"integer","description":"1-based page number."},"page_size":{"type":"integer","description":"Records per page. Defaults to your plan's max (capped at 100); request fewer with the page-size query parameter."},"returned_count":{"type":"integer","description":"Records in this page."},"total_count":{"type":"integer","description":"Total records matching the query."},"total_pages":{"type":"integer"},"next_url":{"type":["string","null"],"format":"uri","description":"Absolute URL of the next page; null on the last page."},"prev_url":{"type":["string","null"],"format":"uri","description":"Absolute URL of the previous page; null on the first page."}}},"BillSummary":{"type":"object","properties":{"session_year":{"type":["integer","null"]},"bill_number":{"type":["string","null"]},"bill_name":{"type":"string"},"key_words":{"type":["string","null"]},"topics":{"type":"array","items":{"type":"string","enum":["taxes","budget","affordability","crime","immigration","ai","climate","housing","healthcare","agriculture","mining","traffic","wages","other"]}},"chamber":{"type":["string","null"],"description":"Raw originating-chamber label from the source, e.g. 'House'."},"chamber_type":{"type":["string","null"],"enum":["upper","lower",null],"description":"Normalized chamber: upper or lower (null if unmapped)."},"status":{"type":"string","enum":["passed","failed","pending_upper_vote","pending_lower_vote","pending_signature","other"]},"latest_stage":{"type":["string","null"]},"is_resolution":{"type":"boolean"},"summary":{"type":["string","null"],"description":"Plain-language summary of the bill."},"bill_sponsors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"legislator_id":{"type":"string"},"legislator_url":{"type":"string","format":"uri"}}}},"detail_url":{"type":["string","null"],"format":"uri"}}},"BillDetail":{"type":"object","properties":{"session_year":{"type":["integer","null"]},"bill_number":{"type":["string","null"]},"bill_name":{"type":"string"},"key_words":{"type":["string","null"]},"topics":{"type":"array","items":{"type":"string","enum":["taxes","budget","affordability","crime","immigration","ai","climate","housing","healthcare","agriculture","mining","traffic","wages","other"]}},"chamber":{"type":["string","null"]},"chamber_type":{"type":["string","null"],"enum":["upper","lower",null]},"status":{"type":"string","enum":["passed","failed","pending_upper_vote","pending_lower_vote","pending_signature","other"]},"latest_stage":{"type":["string","null"]},"is_resolution":{"type":"boolean"},"summary":{"type":["string","null"],"description":"Plain-language summary of the bill."},"bill_text":{"type":["string","null"],"description":"Full legislative text of the bill, when available (can be large; null if not yet ingested)."},"bipartisan_index":{"type":["number","null"],"description":"0–100; higher = more bipartisan on the latest floor vote."},"popularity_index":{"type":["number","null"],"description":"0–100; share of cast votes that were 'yes'."},"economic_score":{"type":["number","null"],"description":"1 conservative … 3 neutral … 5 liberal (economic axis)."},"social_score":{"type":["number","null"],"description":"1 conservative … 3 neutral … 5 liberal (social axis)."},"velocity":{"type":["number","null"],"description":"Ladder progress ÷ session-time elapsed (>1 ahead of pace)."},"bill_sponsors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"chamber":{"type":["string","null"]},"chamber_type":{"type":["string","null"],"enum":["upper","lower",null]},"party":{"type":["string","null"]},"legislator_id":{"type":"string"},"legislator_url":{"type":"string","format":"uri"}}}},"floor_vote_history":{"type":"array","description":"One entry per floor vote; most_recent flags the latest per chamber_type.","items":{"type":"object","properties":{"chamber":{"type":["string","null"]},"chamber_type":{"type":["string","null"],"enum":["upper","lower",null]},"timestamp":{"type":["string","null"],"format":"date-time"},"most_recent":{"type":"boolean"},"result":{"type":["string","null"],"enum":["pass","fail",null]}}}},"last_roll_call":{"type":"array","description":"Per-member votes on the single most-recent floor vote (empty when no per-member roll call was recorded).","items":{"type":"object","properties":{"name":{"type":"string"},"party":{"type":["string","null"]},"chamber":{"type":["string","null"]},"chamber_type":{"type":["string","null"],"enum":["upper","lower",null]},"timestamp":{"type":["string","null"],"format":"date-time"},"vote":{"type":"string","enum":["yes","no"]},"legislator_id":{"type":"string"},"legislator_url":{"type":"string","format":"uri"}}}}}},"LegislatorSummary":{"type":"object","properties":{"name":{"type":"string"},"chamber":{"type":["string","null"]},"chamber_type":{"type":["string","null"],"enum":["upper","lower",null]},"party":{"type":["string","null"],"enum":["D","R","I",null]},"district":{"type":["string","null"]},"legislator_id":{"type":"string"},"legislator_url":{"type":"string","format":"uri"}}},"LegislatorDetail":{"type":"object","properties":{"legislator_id":{"type":"string"},"name":{"type":"string"},"chamber":{"type":["string","null"]},"chamber_type":{"type":["string","null"],"enum":["upper","lower",null]},"party":{"type":["string","null"],"enum":["D","R","I",null]},"district":{"type":["string","null"]},"website":{"type":["string","null"]},"bio":{"type":["string","null"]},"photo_url":{"type":["string","null"]},"economic_score":{"type":["number","null"],"description":"Computed on request from the legislator's floor votes: 1 conservative … 5 liberal."},"social_score":{"type":["number","null"],"description":"Computed on request from the legislator's floor votes: 1 conservative … 5 liberal."}}},"VoteHistoryRow":{"type":"object","properties":{"session_year":{"type":["integer","null"]},"bill_number":{"type":["string","null"]},"bill_name":{"type":"string"},"vote":{"type":"string","enum":["yes","no"]},"vote_date":{"type":["string","null"],"format":"date"},"key_words":{"type":["string","null"]},"topics":{"type":"array","items":{"type":"string","enum":["taxes","budget","affordability","crime","immigration","ai","climate","housing","healthcare","agriculture","mining","traffic","wages","other"]}},"status":{"type":"string","enum":["passed","failed","pending_upper_vote","pending_lower_vote","pending_signature","other"]},"latest_stage":{"type":["string","null"]},"is_resolution":{"type":"boolean"},"summary":{"type":["string","null"]},"bill_sponsors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"legislator_id":{"type":"string"},"legislator_url":{"type":"string","format":"uri"}}}},"detail_url":{"type":["string","null"],"format":"uri"}}}}},"paths":{"/bill-search/{state}":{"get":{"summary":"Search bills in a state","description":"A page of bills for the given state, newest session first. Combine any of the filters below.","parameters":[{"name":"state","in":"path","required":true,"schema":{"type":"string"},"description":"Two-letter USPS state code, e.g. TX."},{"name":"page","in":"query","schema":{"type":"integer","minimum":1},"description":"1-based page number (default 1)."},{"name":"page-size","in":"query","schema":{"type":"integer","minimum":1,"maximum":100},"description":"Records per page. Defaults to your plan's max (100); values above it are clamped down. Use a smaller page to keep responses light."},{"name":"session-year","in":"query","schema":{"type":"integer"},"description":"Filter to a session year, e.g. 2025."},{"name":"status","in":"query","schema":{"type":"string","enum":["passed","failed","pending_upper_vote","pending_lower_vote","pending_signature","other"]},"description":"Filter to a lifecycle status."},{"name":"topic","in":"query","schema":{"type":"string","enum":["taxes","budget","affordability","crime","immigration","ai","climate","housing","healthcare","agriculture","mining","traffic","wages","other"]},"description":"Filter to bills tagged with this topic."},{"name":"chamber-type","in":"query","schema":{"type":"string","enum":["upper","lower"]},"description":"Originating chamber: upper (senate) or lower (house/assembly)."},{"name":"is-resolution","in":"query","schema":{"type":"string","enum":["y","n"]},"description":"y = resolutions/memorials only; n = proposed laws only."},{"name":"bill-name-like","in":"query","schema":{"type":"string"},"description":"Case-insensitive substring match on the bill title."},{"name":"keyword-like","in":"query","schema":{"type":"string"},"description":"Case-insensitive substring match on the bill's keywords."},{"name":"sponsor-name-like","in":"query","schema":{"type":"string"},"description":"Case-insensitive substring match on a sponsor's name."}],"responses":{"200":{"description":"A page of bills.","content":{"application/json":{"schema":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"data":{"type":"array","items":{"$ref":"#/components/schemas/BillSummary"}}}}}}},"401":{"description":"Missing/invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bill-detail/{state}/{year}/{number}":{"get":{"summary":"Get a single bill with sponsors, floor history, and metrics","description":"Full detail for one bill, including derived scores, per-chamber floor_vote_history, and the last_roll_call (per-member votes on the most-recent floor vote). Pass include-bill-text=1 to also return the full legislative text.","parameters":[{"name":"state","in":"path","required":true,"schema":{"type":"string"},"description":"Two-letter USPS state code, e.g. TX."},{"name":"year","in":"path","required":true,"schema":{"type":"integer"},"description":"Session year, e.g. 2025."},{"name":"number","in":"path","required":true,"schema":{"type":"string"},"description":"Bill number, e.g. 'HB 11' (URL-encode the space)."},{"name":"include-bill-text","in":"query","schema":{"type":"string","enum":["1"]},"description":"Set to 1 to include the bill's full legislative text as bill_text. Omitted by default because it can be multi-megabyte."}],"responses":{"200":{"description":"Bill detail.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BillDetail"}}}}}},"404":{"description":"Unknown bill.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/legislator-search/{state}":{"get":{"summary":"Search legislators in a state","parameters":[{"name":"state","in":"path","required":true,"schema":{"type":"string"},"description":"Two-letter USPS state code, e.g. TX."},{"name":"page","in":"query","schema":{"type":"integer","minimum":1},"description":"1-based page number (default 1)."},{"name":"page-size","in":"query","schema":{"type":"integer","minimum":1,"maximum":100},"description":"Records per page. Defaults to your plan's max (100); values above it are clamped down. Use a smaller page to keep responses light."},{"name":"name-like","in":"query","schema":{"type":"string"},"description":"Case-insensitive substring match on the legislator's name."},{"name":"chamber","in":"query","schema":{"type":"string"},"description":"Raw chamber label match (e.g. 'Senate'). Prefer chamber-type."},{"name":"chamber-type","in":"query","schema":{"type":"string","enum":["upper","lower"]},"description":"upper (senate) or lower (house/assembly)."},{"name":"party","in":"query","schema":{"type":"string","enum":["D","R","I"]}},{"name":"district","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of legislators.","content":{"application/json":{"schema":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"data":{"type":"array","items":{"$ref":"#/components/schemas/LegislatorSummary"}}}}}}}}}},"/legislator-detail/{id}":{"get":{"summary":"Get a legislator with vote-derived ideology scores","description":"Legislator profile. economic_score and social_score are computed on request from the legislator's recorded floor votes.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Legislator id."}],"responses":{"200":{"description":"Legislator detail.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LegislatorDetail"}}}}}},"404":{"description":"Unknown legislator.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/legislator-vote-history/{id}":{"get":{"summary":"A legislator's recorded floor votes","description":"Every yes/no floor vote the legislator cast, newest first, each joined to its bill. The legislator's identity is returned once at the top level.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Legislator id."},{"name":"page","in":"query","schema":{"type":"integer","minimum":1},"description":"1-based page number (default 1)."},{"name":"page-size","in":"query","schema":{"type":"integer","minimum":1,"maximum":100},"description":"Records per page. Defaults to your plan's max (100); values above it are clamped down. Use a smaller page to keep responses light."},{"name":"vote","in":"query","schema":{"type":"string","enum":["yes","no"]},"description":"Filter to yes or no votes."},{"name":"session-year","in":"query","schema":{"type":"integer"},"description":"Filter to a session year, e.g. 2025."},{"name":"status","in":"query","schema":{"type":"string","enum":["passed","failed","pending_upper_vote","pending_lower_vote","pending_signature","other"]},"description":"Filter to a lifecycle status."},{"name":"topic","in":"query","schema":{"type":"string","enum":["taxes","budget","affordability","crime","immigration","ai","climate","housing","healthcare","agriculture","mining","traffic","wages","other"]},"description":"Filter to bills tagged with this topic."},{"name":"chamber-type","in":"query","schema":{"type":"string","enum":["upper","lower"]},"description":"Originating chamber: upper (senate) or lower (house/assembly)."},{"name":"is-resolution","in":"query","schema":{"type":"string","enum":["y","n"]},"description":"y = resolutions/memorials only; n = proposed laws only."},{"name":"bill-name-like","in":"query","schema":{"type":"string"},"description":"Case-insensitive substring match on the bill title."},{"name":"keyword-like","in":"query","schema":{"type":"string"},"description":"Case-insensitive substring match on the bill's keywords."},{"name":"sponsor-name-like","in":"query","schema":{"type":"string"},"description":"Case-insensitive substring match on a sponsor's name."}],"responses":{"200":{"description":"A page of votes with the legislator's identity.","content":{"application/json":{"schema":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"legislator":{"type":"object","properties":{"legislator_id":{"type":"string"},"name":{"type":"string"},"legislator_url":{"type":"string","format":"uri"}}},"data":{"type":"array","items":{"$ref":"#/components/schemas/VoteHistoryRow"}}}}}}},"404":{"description":"Unknown legislator.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}