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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zip | No | ZIP code — finds races covering this ZIP. Search mode only. | |
| mode | No | search = candidates in a race with financial totals. 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. | |
| office | Yes | Office sought: H=House, S=Senate, P=President. | |
| district | No | Two-digit district number (e.g. "07"). Required for house unless zip is provided. | |
| 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 no election results matched — echoes filters and suggests how to broaden. | |
| results | No | Election race result set; candidate financial rows in search mode, a single aggregate summary row in summary mode. | |
| pagination | No | Page-based pagination metadata. | |
| totalCount | No | Total matching candidates 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. |