# FEC Campaign Finance Export (`foxk1996/fec-campaign-finance`) Actor

Export campaign contributions and disbursements from the public FEC API by candidate, committee, employer, contributor, recipient, and date range.

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

## Pricing

$10.00 / 1,000 record scrapeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Export

Export structured campaign-finance transactions from the official Federal Election Commission API. This Apify actor is built for journalists, political researchers, compliance analysts, opposition researchers, civic-tech teams, and data vendors who need repeatable FEC contribution and disbursement exports without writing API pagination and normalization code.

### FEC contributions and disbursements by candidate, committee, employer, and date

The actor calls HTTP-only public endpoints at `api.open.fec.gov` and supports Schedule A itemized receipts (contributions) and Schedule B itemized disbursements. You can search by FEC candidate name or candidate ID, provide one or more committee IDs directly, filter contributions by contributor employer or contributor name, filter disbursements by recipient name, and bound results by two-year transaction period plus optional date range. When a candidate is supplied and no committee IDs are provided, the actor resolves the candidate and uses principal committee IDs when the FEC response includes them.

### What you get

Each dataset row is a flat, spreadsheet-friendly finance record with transaction ID, committee ID and name, candidate ID and name when present, contributor or recipient details, city/state/ZIP, employer, occupation, transaction date, amount, memo text, transaction type fields, report year, file number, image number, and direct FEC data URLs. Candidate and committee lookup is used internally to target the right committees, while the exported dataset stays focused on chargeable contribution and disbursement rows.

### Use cases for campaign-finance research

Use this actor to monitor contributions from a specific employer, export itemized receipts for a campaign committee, review disbursement vendors, build local election dashboards, enrich CRM or compliance workflows with public FEC records, or create repeatable research datasets for a reporting beat. The normalized output saves time compared with downloading bulk files and hand-cleaning inconsistent field names.

### How to use

Get a free API key from api.data.gov for the FEC API and paste it into `apiKey`. The default input uses `DEMO_KEY` and a small 2024 Biden contribution sample so a test run finishes quickly, but production exports should use your own key. Choose `contributions`, `disbursements`, or both in `recordTypes`, set `maxResults`, and add candidate, committee, employer, contributor, recipient, and date filters as needed. The actor uses timeouts, a descriptive User-Agent, polite request delays, and exact client-side truncation at `maxResults`.

### Pricing

This actor uses Apify pay-per-event pricing. The single paid event is `record-scraped` at $0.01 per exported transaction record. There are no extra paid events. Local, free, or non-PPE runs are protected by the built-in free-run cap from the reference implementation.

### FAQ

#### Do I need an FEC API key?

Yes. FEC data is public, but `api.open.fec.gov` requires an api.data.gov key. `DEMO_KEY` is included only for quick smoke tests and has shared rate limits.

#### Does this scrape private or login-only data?

No. It only calls public FEC API endpoints over HTTPS. It does not use logins, proxies, or browser scraping.

#### Can I export both receipts and spending?

Yes. Include both `contributions` and `disbursements` in `recordTypes`. The actor stops exactly at `maxResults` across the selected record types.

#### Why use committee IDs?

Committee IDs are the most deterministic way to target a campaign or PAC. Candidate names can be ambiguous, so direct committee IDs are recommended for production jobs.

# Actor input Schema

## `apiKey` (type: `string`):

api.data.gov key for api.open.fec.gov. Use DEMO_KEY only for quick testing; production exports should use your free personal key (optional; free from api.data.gov for higher limits — leave blank to use the shared demo key).
## `recordTypes` (type: `array`):

Which transaction records to export: contributions from Schedule A, disbursements from Schedule B, or both. Options: contributions, disbursements.
## `candidateName` (type: `string`):

Optional candidate name search, such as Biden or Trump. When no Committee IDs are supplied, the actor resolves the candidate and uses principal committee IDs when available.
## `candidateId` (type: `string`):

Optional FEC candidate ID, such as P80000722. Overrides Candidate name for candidate lookup.
## `committeeIds` (type: `array`):

Optional FEC committee IDs, such as C00703975. When provided, these are used directly for contribution and disbursement queries.
## `twoYearTransactionPeriod` (type: `integer`):

FEC two-year transaction period/election cycle used by Schedule A and B, for example 2024. This keeps default searches bounded and fast.
## `fromDate` (type: `string`):

Optional inclusive transaction date lower bound in YYYY-MM-DD format.
## `toDate` (type: `string`):

Optional inclusive transaction date upper bound in YYYY-MM-DD format.
## `employer` (type: `string`):

Optional Schedule A contributor employer filter. Useful for prospecting contributions by employer.
## `contributorName` (type: `string`):

Optional Schedule A contributor name filter.
## `recipientName` (type: `string`):

Optional Schedule B recipient name filter for disbursement exports.
## `maxResults` (type: `integer`):

Maximum number of transaction rows to export across all selected record types. The actor truncates client-side exactly at this cap even if FEC returns more.

## Actor input object example

```json
{
  "apiKey": "DEMO_KEY",
  "recordTypes": [
    "contributions"
  ],
  "candidateName": "Biden",
  "committeeIds": [],
  "twoYearTransactionPeriod": 2024,
  "maxResults": 25
}
````

# 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 = {
    "apiKey": "DEMO_KEY",
    "recordTypes": [
        "contributions"
    ],
    "candidateName": "Biden",
    "committeeIds": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("foxk1996/fec-campaign-finance").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 = {
    "apiKey": "DEMO_KEY",
    "recordTypes": ["contributions"],
    "candidateName": "Biden",
    "committeeIds": [],
}

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

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

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

```

## CLI example

```bash
echo '{
  "apiKey": "DEMO_KEY",
  "recordTypes": [
    "contributions"
  ],
  "candidateName": "Biden",
  "committeeIds": []
}' |
apify call foxk1996/fec-campaign-finance --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=foxk1996/fec-campaign-finance",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "FEC Campaign Finance Export",
        "description": "Export campaign contributions and disbursements from the public FEC API by candidate, committee, employer, contributor, recipient, and date range.",
        "version": "0.1",
        "x-build-id": "aKdwu0IONLjhiHSlx"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/foxk1996~fec-campaign-finance/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-foxk1996-fec-campaign-finance",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/foxk1996~fec-campaign-finance/runs": {
            "post": {
                "operationId": "runs-sync-foxk1996-fec-campaign-finance",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/foxk1996~fec-campaign-finance/run-sync": {
            "post": {
                "operationId": "run-sync-foxk1996-fec-campaign-finance",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "recordTypes",
                    "maxResults"
                ],
                "properties": {
                    "apiKey": {
                        "title": "FEC API key",
                        "type": "string",
                        "description": "api.data.gov key for api.open.fec.gov. Use DEMO_KEY only for quick testing; production exports should use your free personal key (optional; free from api.data.gov for higher limits — leave blank to use the shared demo key)."
                    },
                    "recordTypes": {
                        "title": "Record types",
                        "type": "array",
                        "description": "Which transaction records to export: contributions from Schedule A, disbursements from Schedule B, or both. Options: contributions, disbursements.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "candidateName": {
                        "title": "Candidate name",
                        "type": "string",
                        "description": "Optional candidate name search, such as Biden or Trump. When no Committee IDs are supplied, the actor resolves the candidate and uses principal committee IDs when available."
                    },
                    "candidateId": {
                        "title": "Candidate ID",
                        "type": "string",
                        "description": "Optional FEC candidate ID, such as P80000722. Overrides Candidate name for candidate lookup."
                    },
                    "committeeIds": {
                        "title": "Committee IDs",
                        "type": "array",
                        "description": "Optional FEC committee IDs, such as C00703975. When provided, these are used directly for contribution and disbursement queries.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "twoYearTransactionPeriod": {
                        "title": "Two-year transaction period",
                        "minimum": 1978,
                        "maximum": 2030,
                        "type": "integer",
                        "description": "FEC two-year transaction period/election cycle used by Schedule A and B, for example 2024. This keeps default searches bounded and fast.",
                        "default": 2024
                    },
                    "fromDate": {
                        "title": "From date",
                        "type": "string",
                        "description": "Optional inclusive transaction date lower bound in YYYY-MM-DD format."
                    },
                    "toDate": {
                        "title": "To date",
                        "type": "string",
                        "description": "Optional inclusive transaction date upper bound in YYYY-MM-DD format."
                    },
                    "employer": {
                        "title": "Contributor employer",
                        "type": "string",
                        "description": "Optional Schedule A contributor employer filter. Useful for prospecting contributions by employer."
                    },
                    "contributorName": {
                        "title": "Contributor name",
                        "type": "string",
                        "description": "Optional Schedule A contributor name filter."
                    },
                    "recipientName": {
                        "title": "Disbursement recipient",
                        "type": "string",
                        "description": "Optional Schedule B recipient name filter for disbursement exports."
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of transaction rows to export across all selected record types. The actor truncates client-side exactly at this cap even if FEC returns more.",
                        "default": 25
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
