# FEC Campaign Finance Scraper - Candidates & Totals (`fetchsmith/fec-campaign-finance-scraper`) Actor

Search US federal candidates by name/state/office/party/cycle with campaign financial totals, via the official FEC open.fec.gov API. No key needed.

- **URL**: https://apify.com/fetchsmith/fec-campaign-finance-scraper.md
- **Developed by:** [Fetch Smith](https://apify.com/fetchsmith) (community)
- **Categories:** Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 result items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## FEC Campaign Finance Scraper – Candidates & Financial Totals

Search US federal candidates (House, Senate, President) by name, state, office, party and election cycle, and get each candidate's campaign financial totals — receipts, disbursements, cash on hand, individual contributions — in one row. Powered by the FEC's official `api.open.fec.gov` disclosure API. No login, no browser, no API key of your own required.

### Use cases

- **Political/campaign research** — pull every Senate candidate in a state with their fundraising totals in a single dataset instead of clicking through fec.gov one candidate at a time.
- **Journalism & fact-checking** — compare receipts, burn rate (`disbursements` vs `receipts`) and war chests (`cashOnHandEnd`) across a race, with the FEC page URL attached to each row for citation.
- **Watchdog & transparency dashboards** — schedule a run per cycle and diff the totals to track who is raising money and how fast.
- **Small-dollar vs. large-dollar analysis** — `individualUnitemizedContributions` (small-dollar giving as the FEC itself computes it, no subtraction required) against `individualItemizedContributions` (the >$200-aggregate subset) shows how much of a campaign's money comes from grassroots donors versus large ones.
- **Candidate list building** — enumerate everyone who has ever filed for a given office/state/cycle, including long-shot and prior candidates.

### Input

| Field | Type | Description |
|---|---|---|
| `candidateName` | string | Full or partial name to search for (default `"Warren"`). Matches any part of the name — see the FAQ. |
| `state` | string | 2-letter state code, e.g. `"CA"`. Optional. |
| `office` | string | `H` (House), `S` (Senate), `P` (President). Optional. |
| `party` | string | Party code, e.g. `DEM`, `REP`, `IND`, `LIB`. Optional. |
| `electionYear` | integer | Even-numbered election cycle, e.g. `2024`. Optional. |
| `includeTotals` | boolean | Fetch financial totals per candidate (default `true`). Costs one extra request per candidate. |
| `maxResults` | integer | Stop after this many candidates (default `20`, max `500`). |

#### Example: Massachusetts Senate Democrats in the 2024 cycle

```json
{
  "state": "MA",
  "office": "S",
  "party": "DEM",
  "electionYear": 2024,
  "includeTotals": true,
  "maxResults": 50
}
```

Leave `candidateName` empty to browse by filters alone instead of searching by name.

### Output

One item per candidate:

| Field | Description |
|---|---|
| `candidateId` | FEC candidate ID, e.g. `S2MA00170`. Stable across cycles — use it as your join key. |
| `name` | Name as filed, `LAST, FIRST MIDDLE`, uppercase. |
| `party` | Full party name, e.g. `DEMOCRATIC PARTY`. |
| `office` | `House`, `Senate` or `President`. |
| `state`, `district` | State code and 2-digit district (`00` for President, Senate and at-large House). |
| `incumbentChallenge` | `Incumbent`, `Challenger` or `Open seat` (`null` for some older filings). |
| `candidateStatus` | One-letter FEC code — see the FAQ for the decode table. |
| `electionYears` | Years this person has actually been a candidate for. |
| `cycles` | Every two-year cycle the FEC holds data for. Not the same as `electionYears`. |
| `firstFileDate` | Date of their first FEC filing. |
| `fecUrl` | Link to the candidate's page on fec.gov. |
| `receipts`, `disbursements` | Total raised and total spent for the covered period, in USD. |
| `cashOnHandEnd` | Cash on hand at the close of the covered period. |
| `individualContributions` | All contributions from individuals. |
| `individualItemizedContributions` | The itemized (>$200 aggregate) subset of the above. |
| `individualUnitemizedContributions` | The unitemized (small-dollar, ≤$200 aggregate) subset — the FEC's own computed figure, not derived by subtraction. |
| `refundedIndividualContributions` | Individual contributions refunded back to donors during the period. |
| `coverageStartDate`, `coverageEndDate` | The reporting period these totals cover, as ISO timestamps. |

Financial fields are `null` when `includeTotals` is `false` or the candidate has never filed a financial report.

#### Sample row (real output, Elizabeth Warren, Senate)

```json
{
  "candidateId": "S2MA00170",
  "name": "WARREN, ELIZABETH",
  "party": "DEMOCRATIC PARTY",
  "office": "Senate",
  "state": "MA",
  "district": "00",
  "incumbentChallenge": "Incumbent",
  "candidateStatus": "C",
  "electionYears": [2012, 2018, 2024, 2030],
  "cycles": [2012, 2014, 2016, 2018, 2020, 2022, 2024, 2026],
  "firstFileDate": "2011-08-19",
  "fecUrl": "https://www.fec.gov/data/candidate/S2MA00170/",
  "receipts": 4413931.4,
  "disbursements": 4109645.05,
  "cashOnHandEnd": 3754333.02,
  "individualContributions": 4234605.7,
  "individualItemizedContributions": 1373252.85,
  "individualUnitemizedContributions": 2861352.85,
  "refundedIndividualContributions": 30368.08,
  "coverageStartDate": "2025-01-01T00:00:00",
  "coverageEndDate": "2026-06-30T00:00:00"
}
```

### Pricing

`result` — you are charged per candidate row actually returned. Starting a run is free, and a run that finds no matching candidates costs nothing. HTTP-only (no browser), so runs are fast and cheap.

### FAQ

**Why does searching "Warren" return people who aren't named Warren?**
The FEC's search matches the token anywhere in the filed name, including middle names. A Senate search for `Warren` returns 27 candidates, and the first ones alphabetically are `BOYANTON, RICHARD WARREN` and `BROWN, WARREN P` — not Elizabeth Warren. Search the full name (`"Elizabeth Warren"`) to narrow it: all tokens must match.

**What do the `candidateStatus` letters mean?**
Straight from the FEC: `C` = present candidate, `F` = future candidate, `N` = not yet a candidate, `P` = prior candidate. `party`, `office` and `incumbentChallenge` are already decoded to readable text for you; this one field stays as the FEC's raw code so it round-trips cleanly back into FEC queries.

**Why is `district` `"00"` for a Senator?**
`00` is the FEC's placeholder for offices that have no House district — President, Senate, and at-large House seats.

**Are `receipts` lifetime totals?**
No. The FEC stores one totals record per election cycle, and this Actor returns the **most recent** one, with `coverageStartDate`/`coverageEndDate` telling you exactly which period it covers. Elizabeth Warren, for example, has 12 separate totals records on file. If you need a specific past cycle, set `electionYear`.

**Do I have to compute small-dollar giving myself?**
No. `individualUnitemizedContributions` is the FEC's own ≤$200-aggregate figure, returned straight from the same totals record as `individualItemizedContributions` — you don't need to subtract one from `individualContributions` to get it.

**Why do `electionYears` and `cycles` differ?**
`electionYears` are the years the person was on the ballot; `cycles` are every two-year window the FEC holds data for, which includes the off-years in between. In the sample above that's `[2012, 2018, 2024, 2030]` versus `[2012 … 2026]`.

**Do I need my own FEC API key?**
No. The Actor ships with its own `api.data.gov` key, so you are not sharing the throttled public `DEMO_KEY` with every other caller on the internet.

**Is this legal?**
Yes. Federal campaign finance filings are public records that candidates are legally required to disclose, and this reads them from the FEC's own public API. No login, no scraping behind authentication.

**Can I get individual donors' names and addresses?**
Not from this Actor. It returns candidate-level aggregates only.

### Notes

Only public data from the FEC's own public disclosure API. Issues or feature requests: support@fetchsmith.com. Also available as a hosted API at https://fetchsmith.com

### Related guides

- [FEC Campaign Finance JSON API — what the DEMO\_KEY actually lets you do](https://fetchsmith.com/blog/fec-campaign-finance-json-api-demo-key)
- [All FetchSmith tools](https://fetchsmith.com/tools)

### Source code

https://github.com/Fetchsmith/fetchsmith/tree/main/actors/fec-campaign-finance-scraper

# Actor input Schema

## `candidateName` (type: `string`):

Full or partial candidate name to search for (e.g. "Warren" or "Elizabeth Warren"). Leave empty and use state/office/party filters alone to browse instead of searching by name.

## `state` (type: `string`):

Restrict to candidates running in this state, e.g. "CA", "TX". Leave empty for all states.

## `office` (type: `string`):

Restrict to one office.

## `party` (type: `string`):

Restrict to one party code, e.g. "DEM", "REP", "IND", "LIB". Leave empty for all parties.

## `electionYear` (type: `integer`):

Restrict to candidates active in this even-numbered election cycle, e.g. 2024. Leave empty for all cycles.

## `includeTotals` (type: `boolean`):

For each candidate found, fetch their campaign financial totals (receipts, disbursements, cash on hand, individual contributions) from the FEC's totals endpoint. Adds one extra request per candidate.

## `maxResults` (type: `integer`):

Stop after this many candidates.

## Actor input object example

```json
{
  "candidateName": "Warren",
  "state": "",
  "office": "",
  "party": "",
  "includeTotals": true,
  "maxResults": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("fetchsmith/fec-campaign-finance-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("fetchsmith/fec-campaign-finance-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call fetchsmith/fec-campaign-finance-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fetchsmith/fec-campaign-finance-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/MbmObp7bpnEJaHcC5/builds/j7gJYvPRVSCTn67tf/openapi.json
