Overview
The Federal Election Commission (FEC) API offers a direct interface to a vast dataset of United States federal campaign finance information. Established in 1975, the FEC is an independent regulatory agency responsible for enforcing campaign finance law in the U.S. federal elections. Its API makes this public data accessible programmatically, enabling developers, data scientists, journalists, and academics to build applications, perform analyses, and conduct research related to political funding and election spending. The API provides access to granular data points, including individual contributions, committee financial summaries, independent expenditures, and election results.
The FEC API is particularly valuable for applications requiring historical and real-time insights into campaign funding trends, donor networks, and political spending patterns. Use cases range from interactive data visualizations for journalistic investigations to academic research on the impact of money in politics. Developers can query specific committees, candidates, or election cycles, filter data by various criteria such as contribution amount or date, and retrieve detailed records on financial activities. The API is RESTful, returning data in JSON format, which facilitates integration with a wide range of programming languages and platforms. Accessing most endpoints requires a free API key, which helps manage usage and provides basic authentication without imposing costs.
The data available through the FEC API is comprehensive, encompassing information that includes candidate and committee profiles, financial summaries (receipts, disbursements, debts), individual contributions (donor names, addresses, occupations, employers, amounts), and independent expenditures made by political committees. This level of detail supports in-depth analysis of financial flows within the U.S. political system, making it an essential resource for transparency initiatives and democratic accountability efforts. For example, researchers can track contributions over election cycles, analyze the impact of different donor types, or map the geographic distribution of political funding. The Open Data Initiative of the FEC underscores the agency's commitment to public access to government data, aligning with broader open government principles outlined by bodies like the World Wide Web Consortium (W3C) on Linked Data principles.
Key features
- Candidate and Committee Data: Access profiles, financial summaries, and activity reports for federal candidates and political committees.
- Individual Contribution Data: Retrieve detailed records of contributions from individuals to federal campaigns, including donor information.
- Operating Expenditures: Query data on how campaigns and committees spend money, categorized by purpose and recipient.
- Independent Expenditures: Obtain data on spending by individuals or groups to advocate for or against political candidates, independent of the campaigns themselves.
- Election Results: Access historical and current federal election results data by candidate, district, and election type.
- Filing Information: Retrieve information about campaign finance reports filed by committees, including filing dates and report types.
- Multi-Parameter Querying: Filter and search data using various parameters such as election cycle, candidate ID, committee ID, date range, and amount.
- JSON Output: Data is returned in a standard JSON format, compatible with most programming environments.
- Rate Limiting and API Key Management: Free API key for authenticated access and usage tracking, with clear rate limits specified in the documentation.
Pricing
The FEC API follows a free-to-use public data model. An API key is required to access most endpoints, which is provided at no cost upon registration with the FEC's developer portal. There are no subscription fees, usage charges, or tiered pricing plans for accessing the federal campaign finance data through the API.
| Service Tier | Features | Pricing (As of 2026-05-28) |
|---|---|---|
| Default Access | Full access to all public campaign finance data endpoints, standard rate limits. | Free |
| Increased Rate Limits | Available upon request for specific high-volume use cases. | Free (subject to approval) |
For detailed information on obtaining an API key and usage policies, refer to the FEC API developer documentation.
Common integrations
- Data Visualization Tools: Integration with libraries like D3.js, Tableau, or Power BI for creating interactive charts and dashboards of campaign finance data.
- Journalism Platforms: Used by news organizations to power investigative reporting tools, data-driven stories, and election coverage.
- Academic Research Software: Integrated into statistical packages (e.g., R, Python with Pandas) for quantitative analysis of political funding.
- Political Advocacy Platforms: Used for tracking legislative influence, donor mapping, and public awareness campaigns.
- CRM Systems (e.g., Salesforce): While not a direct integration, data can be imported into CRM systems for donor research and political fundraising intelligence by analyzing constituent engagement.
- Custom Web Applications: Developers build web and mobile apps that display campaign finance data to the public or specific user groups.
Alternatives
- OpenSecrets.org (Center for Responsive Politics): Provides curated, user-friendly data and analysis of money in U.S. politics, often aggregating and interpreting FEC data.
- Vote Smart: Offers comprehensive information on candidates and elected officials, including voting records, issue positions, and campaign finance data from various sources.
- ProPublica Data Store: Provides various datasets, including some campaign finance information, often经过清洗和标准化处理。
- State-level Election Commissions: For state and local election data, individual state election commission APIs or data portals serve as alternatives (e.g., California Fair Political Practices Commission for state-level campaign finance).
Getting started
To begin using the FEC API, you first need to obtain an API key from the official FEC developer portal. Once you have your key, you can make requests to the API endpoints. The following Python example demonstrates how to fetch a list of all active federal candidates:
import requests
import json
# Replace with your actual API key obtained from api.open.fec.gov/developers/
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.open.fec.gov/v1"
# Endpoint to get a list of candidates
endpoint = f"{BASE_URL}/candidates/"
params = {
"api_key": API_KEY,
"per_page": 10, # Number of results per page
"page": 1, # Page number
"sort_hide_null": True,
"sort_nulls_last": True,
"sort": "name" # Sort by candidate name
}
try:
response = requests.get(endpoint, params=params)
response.raise_for_status() # Raise an HTTPError for bad responses (4xx or 5xx)
data = response.json()
print("Successfully fetched candidates:")
for candidate in data['results']:
print(f"- {candidate['name']} (ID: {candidate['candidate_id']})")
except requests.exceptions.HTTPError as http_err:
print(f"HTTP error occurred: {http_err}") # Python 3.6+
except requests.exceptions.ConnectionError as conn_err:
print(f"Connection error occurred: {conn_err}")
except requests.exceptions.Timeout as timeout_err:
print(f"Timeout error occurred: {timeout_err}")
except requests.exceptions.RequestException as req_err:
print(f"An unexpected error occurred: {req_err}")
except KeyError:
print("Could not parse candidates from response. Check API key and endpoint.")
This script constructs a request to the /candidates/ endpoint, passing your API key and specifying parameters for pagination and sorting. It then prints the names and IDs of the first 10 candidates returned. For more detailed examples and a comprehensive list of available endpoints and parameters, consult the FEC API developer documentation.