Rallybase
ใครดำรงตำแหน่งในรัฐบาลสหรัฐฯ พร้อมข้อมูลการเงินภาครัฐ การเลือกตั้ง และองค์กรไม่แสวงหากำไร โดยแต่ละแถวระบุแหล่งที่มา
เอกสาร
API docs
The Rallybase API is in beta. Its data is provided as is, as API Terms 13.1 says, and the API Terms apply: https://rallybase.org/api/terms.
Send your key in the Authorization header. It never goes in the URL. In every example RALLYBASE_KEY stands for your key.
Quickstart
Make your first call
- Get a key. It is free, and it is shown once, when it is made: copy it then. Get a free key
- Put it in your terminal. Paste this line, replace the placeholder with your key, and press Enter. It lasts until you close the terminal window.
export RALLYBASE_KEY="PASTE_YOUR_KEY_HERE"$env:RALLYBASE_KEY = "PASTE_YOUR_KEY_HERE" - Run the call. It asks who represents one street address, the Texas State Capitol in Austin, sent in a header rather than in the URL. Put any US street address in its place.
curl -sS "https://rallybase.org/api/v2/lookup" -H "Authorization: Bearer $RALLYBASE_KEY" -H "x-geocode-address: 1100%20Congress%20Ave%2C%20Austin%2C%20TX%2078701"curl.exe -sS "https://rallybase.org/api/v2/lookup" -H "Authorization: Bearer $env:RALLYBASE_KEY" -H "x-geocode-address: 1100%20Congress%20Ave%2C%20Austin%2C%20TX%2078701"
The answer is JSON. It carries a license line, the snapshot it was read from, the county, and a list of officials, each with the page it was read from.
401 invalid_keyThe key did not arrive. Check step two ran in this same terminal window; the message in the answer says what was wrong with the header.429 rate_limitedA limit was reached. Wait the number of seconds in the Retry-After header, then run the call again.
Look up who represents a street address
Every level for one address: federal, state, county, city and school. The address is URL-encoded and sent in the x-geocode-address header, never in the URL: a URL is cached and logged. We resolve it to a point and do not store it. Coordinates work the same way in the x-rb-lat and x-rb-lng headers. The address below is a placeholder, not a real street: put a real address in its place. An address that cannot be matched answers 404 address_not_found. Set RALLYBASE_KEY in your environment (the first call above shows the line); run this on a server, because a key does not belong in a browser. The JavaScript is a module: save it as a file ending in.mjs and run it with Node 18 or later. The Python needs only the standard library.
# -i prints the status and headers: on a 429, Retry-After says how long to wait. Do not loop or retry blindly.
curl --fail-with-body -sS -i "https://rallybase.org/api/v2/lookup" \
-H "Authorization: Bearer $RALLYBASE_KEY" \
-H "x-geocode-address: 1600%20Example%20St%2C%20Austin%2C%20TX"
Look up a county's officials by FIPS code
A county is a five-digit FIPS code, and it answers the county officials only: a county has no single point, so for federal, state and city officials send an address or coordinates, as in the example above. It needs no address, so it is the call to use when you hold only a county.
# -i prints the status and headers: on a 429, Retry-After says how long to wait. Do not loop or retry blindly.
curl --fail-with-body -sS -i "https://rallybase.org/api/v2/lookup?county=48453" \
-H "Authorization: Bearer $RALLYBASE_KEY"
Contact your representatives: find who, then how their office publishes ways to reach them
Step one is the address lookup. Step two prints each official with the office phone, email and website their office publishes, for state officials, the phone and website for members of Congress (who take messages through a contact form on their website, not an email address), the county office's phone and email where we hold one we can serve, and on each row the page it was read from and the day it was read. City and school rows carry no contact in this API, and neither does a county row we hold none for: their contact details are on the source page. The recipe does not send anything on anyone's behalf.
# Step 1: who holds office at this address, at each level. State rows carry phone, email and website; federal rows carry phone
# and website (members of Congress take messages through a contact form on their website, not an email address); on each row,
# source_url is the page the row was read from.
# -i prints the status and headers: on a 429, Retry-After says how long to wait. Do not loop or retry blindly.
curl --fail-with-body -sS -i "https://rallybase.org/api/v2/lookup" \
-H "Authorization: Bearer $RALLYBASE_KEY" \
-H "x-geocode-address: 1600%20Example%20St%2C%20Austin%2C%20TX"
One example call for each layer
Each layer below is served today. The docs above show the lookup in full; the OpenAPI file at the end of this page lists every path the API serves, with its parameters.
-
Public officials
Who are the county officials for FIPS 48453?GET /api/v2/lookup?county=48453Each row names its source page and the day it was read or recorded. -
Federal bills
Find federal bills about waterGET /api/v2/bills?jurisdiction=us&q=waterSource: congress.gov. Only the federal bills Rallybase has saved. -
Government finance
What did Travis County take in and spend?GET /api/v2/finance?county=48453Source: U.S. Census Bureau, Annual Survey of State and Local Government Finances (the Census of Governments in a census year). Source: U.S. Census Bureau, Annual Survey of School System Finances. -
Elections and registration deadlines
What elections are held for Texas?GET /api/v2/elections?state=TXEach row names its source page. -
Nonprofits
Which food banks in Texas does the IRS list?GET /api/v2/nonprofits?q=food%20bank&state=TXSource: Internal Revenue Service, Exempt Organizations Business Master File. -
ZIP code areas
Which districts might 81130 be in?GET /api/v2/zip?zip=81130Source: U.S. Census Bureau, ZIP Code Tabulation Areas. A ZIP area is an approximation, not a USPS assignment. -
Federal Register
Proposed EPA rules still open for commentGET /api/v2/federal-register?type=proposed_rule&agency=environmental-protection-agency&open_for_comment=trueSource: Office of the Federal Register (unofficial edition), federalregister.gov. -
Federal candidate fundraising
What have Texas's House and Senate candidates raised?GET /api/v2/finance/federal-candidates?state=TXSource: the Federal Election Commission's candidate summary file, read from fec.gov. -
County labor force
What are Travis County's recent monthly unemployment rates?GET /api/v2/labor/county?county=48453Source: Bureau of Labor Statistics (LAUS). BLS.gov cannot vouch for the data or analyses derived from these data after the data have been retrieved from BLS.gov. -
Hospitals and health facilities
Which hospitals are in Travis County?GET /api/v2/health/facilities?county=48453Source: Centers for Medicare & Medicaid Services. -
Federal spending by place
How much federal money was obligated in Travis County?GET /api/v2/spending/places?county=48453Source: USAspending.gov, U.S. Department of the Treasury. -
Public water systems
Which water systems serve Travis County, Texas?GET /api/v2/water/systems?county=48453Source: U.S. Environmental Protection Agency (Envirofacts / ECHO). -
Federal judges
The judges of the Western District of Texas with no termination printedGET /api/v2/courts/federal-judges?court=U.S.%20District%20Court%20for%20the%20Western%20District%20of%20Texas¤t=trueSource: Federal Judicial Center, Biographical Directory of Article III Federal Judges. -
House roll call votes
How did roll call 326 of 2026 go, member by member?GET /api/v2/votes?roll=119-2-326Source: Office of the Clerk, U.S. House of Representatives, roll call votes (clerk.house.gov/evs). -
Property tax rates
What do the taxing units in Travis County charge?GET /api/v2/tax-rates?county=48453Source: Texas Comptroller of Public Accounts. Texas only.
The lookup
GET /api/v2/lookup takes a street address, URL-encoded, in the x-geocode-address header, or coordinates in the x-rb-lat and x-rb-lng headers, and answers every level for that point. A five-digit FIPS code in county answers the county officials only, and so does the county’s Open Civic Data division id in ocd_id, the id a county row carries in its own ocd_id field. The names, ids and pages in this answer are placeholders.
curl "https://rallybase.org/api/v2/lookup" \
-H "Authorization: Bearer $RALLYBASE_KEY" \
-H "x-geocode-address: 1600%20Example%20St%2C%20Austin%2C%20TX"
{
"license": "Data licensed under the Rallybase API Terms: use, display and analysis in your own product or research; no resale or redistribution as a dataset or competing service; attribution with source links when shown publicly.",
"snapshot": {
"id": "snap-example",
"built_at": "2026-10-28T06:00:00.000Z"
},
"freshness": "weekly snapshot",
"county": {
"fips": "48453",
"name": "Travis",
"state": "TX"
},
"officials": [
{
"id": "federal-rep-X000001",
"level": "federal",
"office": null,
"office_label": "U.S. Representative, TX-37",
"name": "Alex Example",
"jurisdiction": "U.S. House of Representatives",
"ocd_id": "ocd-division/country:us/state:tx/cd:37",
"district_key": null,
"party": "Example Party",
"phone": "202-555-0100",
"email": null,
"website": "https://example.house.gov",
"source_url": "https://www.example.gov/members",
"read_at": null,
"read_basis": "not held — officials.last_synced is a sync or load time, not a read date (see recorded)",
"recorded_on": "2026-10-27",
"attribution": null
},
{
"id": "state-ocd-person/00000000-0000-0000-0000-000000000000",
"level": "state",
"office": null,
"office_label": "State Senator, District 14",
"name": "Sam Example",
"jurisdiction": "TX Senate",
"ocd_id": "ocd-division/country:us/state:tx/sldu:14",
"district_key": null,
"party": "Example Party",
"phone": "512-555-0100",
"email": "sam.example@example.gov",
"website": "https://www.example.gov/senate/14",
"source_url": "https://www.example.gov/senate",
"read_at": null,
"read_basis": "not held — officials.last_synced is a sync or load time, not a read date (see recorded)",
"recorded_on": "2026-10-27",
"attribution": null
},
{
"id": "county-official-48453-county_judge",
"level": "county",
"office": "county_judge",
"office_label": "County Judge",
"name": "Jane Example",
"jurisdiction": "Travis County, TX",
"ocd_id": "ocd-division/country:us/state:tx/county:travis",
"district_key": null,
"party": null,
"phone": null,
"email": null,
"website": null,
"source_url": "https://www.example.gov/county-judge",
"read_at": "2026-10-20",
"read_basis": "rb.county_official.fetched_at",
"recorded_on": null,
"attribution": null,
"dates_note": "Source page read on 2026-10-20. No later re-read of this row is recorded."
},
{
"id": "place-official-4805000-mayor-citywide-pat-example",
"level": "place",
"office": null,
"office_label": "Mayor",
"name": "Pat Example",
"jurisdiction": "Austin City Council",
"ocd_id": null,
"district_key": "place_geoid:4805000",
"party": null,
"phone": null,
"email": null,
"website": null,
"source_url": "https://www.example.gov/council",
"read_at": "2026-10-21",
"read_basis": "last_verified_on: a person re-read the city page",
"recorded_on": null,
"attribution": null
}
],
"point": {
"read_at": "2026-10-28T14:03:11.000Z",
"districts": [
{
"name": "Congressional District 37",
"level": "federal",
"state": "TX",
"census_geoid": "4837"
},
{
"name": "State Senate District 14",
"level": "state",
"state": "TX",
"census_geoid": "48014"
}
],
"bodies": [
{
"body_name": "Commissioners Court",
"body_kind": "county_commission",
"seats": 5,
"composition": "A county judge elected countywide and four commissioners elected by precinct.",
"election_method": "mixed",
"citation": "Tex. Const. art. V, § 18",
"source_url": "https://www.example.gov/constitution",
"verified_on": "2026-09-01",
"applies_as": "state_default"
}
],
"place_rosters": [
{
"place_geoid": "4805000",
"place_name": "Austin",
"state": "TX",
"status": "rostered",
"count": 11,
"reason": null,
"checked_at": "2026-09-17"
}
]
},
"coverage": {
"county": "held",
"levels": {
"federal": "served",
"state": "served",
"place": "served",
"school": "none held",
"local": "none held"
},
"held_not_redistributed": 0,
"note": "No row held for this lookup was withheld by the licence filter or the row text rules."
},
"notice": "The Rallybase API is in beta. Its data is provided as is, as API Terms 13.1 says, and the API Terms apply: https://rallybase.org/api/terms."
}
Each official carries an id, the same across lookups while our record of that person is the same (a state legislator first read from the legislature’s own page has a state-row- id until Open States lists them, and a state-ocd-person/ id after), source_url, the public page the row was read from, and read_at, the day it was read, or null with read_basis saying why. A county row may also carry verified_on: the day we last re-read the page and found this holder still named, when that was a later day than read_at. It is absent when we have not re-read the row since it was read, or since our record of the office last changed, and city, school, state and federal rows do not carry it. A county row also carries dates_note, the two dates in words for quoting: the day the page was read, then the later day we read it again, or that no later re-read is recorded. The connector’s county tools give the same sentence. State rows carry the office’s published phone, email and website. State legislators’ rows come from Open States (openstates.org), except a row read from the legislature’s own page, whose source_url is that page. A state legislator’s Open States row has an Open States page or its public dataset of legislators as its source_url, its attribution names Open States, and the daily sync refreshes it from the Open States API when it reaches that state. Federal rows carry the member’s published phone and website: members of the U.S. House and Senate take messages through a contact form on their website, not an email address, so a federal row’s email is null. A county row carries the county office’s phone and email where we hold one we can serve, and null otherwise; a null does not mean the office has none. A county row may also carry contact_url, the office’s own contact or department page on a government site or an office site a government page links to, with contact_url_read_at, the day we read it. It is offered whether or not a phone or email is, and it is absent when we hold none. City and school rows carry none in this API. A level with no rows is explained in coverage.levels: “none held”, “could not check” and “held, not redistributed” are different findings, and none says a government has no officials.
How accurate the rows were on re-check
360 of 363 rows matched their source on re-check (99.2%; 95% interval 97.6–99.7%), November 2026.
Method: a random sample of 395 served county and city officer rows, stratified by how the source page is shared and leaving out board seats, each re-read from its own source page; a row matched when that page printed the stored name (beside the office title in 334 of the 360). The 32 rows whose page could not be read are not in the rate. It measures what we stored against what the page printed that day, not whether the page itself was current. Re-measured quarterly. Where our data comes from has the sources.
Errors
Every answer that is not a 200 is JSON with an error code and a message in plain words. Check the status first, then the code.
The limit field of a 429
per_minutethe key’s lookups in the clock minuteper_daythe key’s lookups in the UTC daystacked_dailythe lower daily limit for free keys that share a network with several othersfree_ip_dailyfree lookups from one network address in a dayfree_asn_dailyfree lookups from one network provider in a dayfree_budgetthe day’s total of free lookups across every free keygeocoder_budgetaddress matching across every key in the minutemonthlythe key’s monthly allowance
When a row is wrong
Each row names its source in source_url and, where we hold one, the day it was read in read_at. If a row is wrong, draft a correction to support@rallybase.org with the row’s id, the field, the snapshot id and where the right value is printed. Leave out the address you looked up. A person reads each one. A correction is a lead: we change a record only after we read the right answer on the government's own page.
The API terms, section 7.1: If a row is wrong or should not be published, tell us at privacy@rallybase.org. We act on these requests within 24 hours.
The free lookup the site uses
The site’s own pages call GET /api/v1/officials/at-point, which takes no key. It stays open for the site. A program calling it, rather than a browser, is held to 10 requests a minute per network, and every answer carries an X-Rallybase-API header pointing here. For programs, use the keyed lookup above: it returns the same officials with snapshot ids, a licence and a monthly allowance.
Limits
These are the Open key’s limits.
- An Open key can make 10 lookups in a clock minute (the minute on the clock, not the 60 seconds after your last call) and 300 in a UTC day.
- A lookup by address counts as 3 of the minute, so 3 address lookups fit in a minute and the next is refused. A lookup by county counts as 1.
- Because the minute is a clock minute, a burst that straddles the turn of a minute can pass up to twice the limit: 10 at the end of one minute and 10 at the start of the next.
- The monthly allowance is 500 lookups per calendar month (UTC).
- Only a request that returns 200 with at least one official counts toward the monthly allowance.
- Past a limit the API answers 429 with a Retry-After header, in seconds, and a body whose limit field names which limit was reached (for example per_minute, per_day or monthly).
By plan
| Plan | In a clock minute | In a UTC day | In a calendar month |
|---|---|---|---|
| Open | 10 | 300 | 500 |
| Builder | 60 | No daily limit | 50,000 |
| Pro | 300 | No daily limit | 1,000,000 |
The API page says which plans can be bought today.
Connect Claude
Rallybase is also a connector for Claude. It reads federal, state, county and city officials, saved bills, elections held for a state, voter registration deadlines, government revenue and spending, property tax rates, nonprofits, Federal Register documents, county jobs figures, community water systems and federal judges. It takes no address: the address lookup is the keyed API above.
Rallybase is in Claude’s connector directory. Add Rallybase to Claude.
Rallybase is also listed on Agensi as a free skill, US Government Research, With Sources. See the skill on Agensi.
- In Claude, open Settings, then Connectors, and choose Add custom connector.
- Paste https://rallybase.org/mcp as the address.
- Claude sends you to the Rallybase Connect page. Log in and choose Allow.
https://rallybase.org/mcp
It can read
County officers; a state’s federal and state officials, with their offices’ published phone, email and website; a city’s officials; saved bills; the elections held for a state; a government’s published revenue and spending; tax-exempt organisations in the IRS file, with a street address where one may be served; Federal Register documents; the voter registration deadlines held for a state’s elections; Texas property tax rates by taxing unit; a county’s monthly labor force and unemployment figures; community water systems and their reported health violations; and federal judges’ service records.
It cannot
It can only read. It cannot change anything on your account or on Rallybase.
What you need
A connection needs a Rallybase account with a key. The free key is enough.
Your allowance
Its lookups count toward your account's monthly allowance. In one day a connection can use up to a tenth of it.
To end it
You can end this link at any time by signing out of all devices, changing your password or revoking your API key.
What Claude can call
lookup_officialsLook up county officersget_officialGet one county officeget_countyGet one county by FIPS codeget_coverageSee what is heldsearch_billsSearch saved billsget_ballotGet upcoming elections for a stateget_state_officialsGet a state's federal and state officialslookup_cityLook up a city's officialsget_financeGet a government's revenue and spendingsearch_nonprofitsSearch tax-exempt organisationssearch_federal_registerSearch Federal Register documentsget_registration_deadlinesGet voter registration deadlines for a stateget_tax_ratesGet the property tax rates of taxing unitsget_county_labor_forceGet a county's labor force and unemploymentsearch_water_systemsSearch community water systemssearch_federal_judgesSearch federal judicial service
Moving from Google Civic
Google retired its two Representatives methods, representativeInfoByAddress and representativeInfoByDivision, on 2025-04-30. Source: developers.google.com/civic-information/docs/v2, read 2026-11-08: the page footer reads "Last updated 2025-04-30 UTC", and the Representatives method pages (representatives/representativeInfoByAddress and representatives/representativeInfoByDivision) answer HTTP 404. We could not retrieve the text of Google’s own notice on that day, so the shutdown date is the page’s last-updated date and the date we recorded earlier, not a quotation.
Read this first: the replacement covers federal, state, county, city and school officials for an address, but it is not a drop-in for the Google responses. Office contact is served for federal and state officials, and a county office’s phone and email where we hold one we can serve; the last list below says what it leaves out.
| Rallybase | Note | |
|---|---|---|
representativeInfoByAddress (address in the query string, key in the query string) | GET /api/v2/lookup with the address in the x-geocode-address header and the key in Authorization: Bearer | Federal, state, county, city and school officials for the address. A key or an address in the URL is refused with 400. |
representativeInfoByDivision (an OCD division id in the path) | GET /api/v2/lookup?ocd_id=<a county's OCD division id> or?county=<5-digit FIPS>, or coordinates in the x-rb-lat and x-rb-lng headers | A county's OCD division id is taken as it is, and answers the county level only, as a county code does. An id for any other kind of division (a state, a district, a city) is refused with unsupported_division: send an address or a point for those. Each row carries its ocd_id where the published list has one. |
| Google field | Rallybase field | Note |
|---|---|---|
officials[].name | officials[].name | The holder's name as served. |
offices[].name | officials[].office_label (and officials[].office, a stable key) | The office as the county page prints it, with the holder's name taken out. |
offices[].divisionId | officials[].ocd_id (and officials[].district_key, officials[].jurisdiction) | The Open Civic Data id, where the published list carries the division. Else it is null. district_key names a city or school district that OCD does not type. |
offices[].levels, offices[].roles | officials[].level | One of federal, state, county, place (a city or town), school or local (any other local government). |
officials[].phones, officials[].emails | officials[].phone, officials[].email | The office's published phone and email. State officials have both. So does a county office where we hold one we can serve. Members of Congress have a phone, but their email is null: they take messages through a form on their website. City and school rows have neither, and so does a county row we hold none for. |
officials[].urls | officials[].website and officials[].source_url | website is the office's own site (federal and state). source_url is a different thing: the public page our row was read from, on each row. |
officials[].party | officials[].party | As the source gives it, or null. County rosters publish none. |
officials[].id (none in Google) | officials[].id | The same id across lookups while our record of that person is the same. The site uses it too. A state legislator first read from the legislature's own page has a state-row- id. Once Open States lists them, it is a state-ocd-person/ id. |
normalizedInput | none | We do not echo or store the address. |
What we hold that Google never did
- A source page on each row (source_url). Where we hold it, the day it was read (read_at); when we do not, read_basis says why. Google's responses carried neither.
- A finding for each level (coverage.levels). "none held", "could not check" and "held, not redistributed" are different findings. None of them says a government has no officials.
- The districts that hold the point, and the governing bodies with their seat counts (point.districts, point.bodies). Seat counts are read from charter or statute.
- The snapshot the answer came from (snapshot.id, snapshot.built_at) and the licence that applies to the data (license).
- A credit the source requires you to show, when one is owed (attribution).
What we do not hold
- Phone numbers and email addresses for city and school officials. Websites for county, city and school officials. We serve the published contact of federal and state offices. We serve a county office's phone and email where we hold one we can serve. For the rest, the contact details are on the source page.
- Mailing addresses, photographs and social media channels, for any official. The fields Google returned for these (address, photoUrl, channels) have no match here.
- Lookup by the OCD division id of anything but a county. Rows carry the id. The lookup takes an address, a point, a county FIPS code or a county's division id.
- Complete local coverage. A county we have not read is reported as "not yet read". A city whose roster we do not hold is listed in point.place_rosters as not_yet.
The OpenAPI description of every path the API serves is a JSON file you can load into a client generator.