Openfec Lookup Elections
openfec_lookup_electionsLook up federal election races and candidate financial summaries. Find who's running in a race with fundraising totals, or get an aggregate race summary.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"office": "<office>",
"cycle": "<cycle>"
},
"name": "openfec_lookup_elections"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zip | No | ZIP code — returns a locator (office, state, district, cycle) for each race covering this ZIP, not candidates; pass a locator back as state and district for that race. Search mode only. | |
| mode | No | search = candidates in a race with financial totals; with zip, locators for the races covering that ZIP instead. summary = aggregate race financial summary. | search |
| page | No | Page number (1-indexed). Search mode only; explicit page is rejected in summary mode. Defaults to 1 for search. | |
| cycle | Yes | Election cycle year (even years only, e.g. 2024). | |
| state | No | Two-letter US state code (e.g., AZ, CA). Required for senate/house unless zip is provided. Presidential races are filed under US: omit it or pass US. | |
| office | Yes | Office sought: H=House, S=Senate, P=President. | |
| district | No | Two-digit district number (e.g. "07"); 00 for an at-large House seat (e.g., WY, AK). Required for house unless zip is provided. Presidential and Senate races are filed under 00: omit it or pass 00. | |
| per_page | No | Results per page. Search mode only; defaults to 20. | |
| election_full | No | Expand to full election period (4yr president, 6yr senate, 2yr house). Defaults to true when omitted; a ZIP-scoped search rejects it, since that endpoint has no such parameter. Carries no schema default, so an explicit value is distinguishable from an omission. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Query mode as the server resolved it. Row shapes differ by mode — search rows are per-candidate financial records, summary is one aggregate race row — so read this rather than inferring the shape from the fields present. | |
| error | No | Present when the call failed. Absent on success. | |
| notice | No | Guidance when the response carries no election results: how to broaden a search that matched nothing, or which requested position ran out when results did match. | |
| results | No | Election race result set; candidate financial rows in search mode, race locators (office, state, district, cycle) in a search with zip, a single aggregate summary row in summary mode. | |
| pagination | No | Page-based pagination metadata. | |
| totalCount | No | Total matching candidates, race locators, or race summaries. | |
| search_criteria | No | Echo of the search filters this call applied, as the server parsed them, minus paging arguments. Always present — compare it against what you sent to confirm every filter was honoured. |