# FEC API

> FEC provides federal candidate fundraising and spending data as a workflow and API.

Search candidates lists federal candidates by office and election year, ranked by money raised; Senate and House searches need a state.

- Page: https://fous.com/tools/fec
- Handle: `@fec`
- Category: [Government](https://fous.com/tools/category/government)
- Source website: https://fec.gov
- Last verified: Sep 29, 2026

## Methods

### Get candidate fundraising

Operation `get_candidate_fundraising`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get a federal candidate’s fundraising and spending for a two-year filing period from FEC candidate pages. Defaults to the FEC’s current two-year period. If several names match, returns the matching candidate with the most reported fundraising for that period.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `state` | string | no | `"NY"` | State postal abbreviation to distinguish candidates, for example MA. |
| `office` | string | no | `"house"` | Office to distinguish candidates, for example senate. Defaults to any. |
| `candidate` | string | yes | `"Alexandria Ocasio-Cortez"` | Candidate name, for example Elizabeth Warren. |
| `election_year` | integer | no | `2024` | Two-year election cycle, for example 2024. Defaults to the FEC’s current cycle. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "candidate"
  ],
  "properties": {
    "state": {
      "type": "string",
      "description": "State postal abbreviation to distinguish candidates, for example MA.",
      "examples": [
        "NY"
      ]
    },
    "office": {
      "enum": [
        "any",
        "president",
        "senate",
        "house"
      ],
      "type": "string",
      "default": "any",
      "description": "Office to distinguish candidates, for example senate. Defaults to any.",
      "examples": [
        "house"
      ]
    },
    "candidate": {
      "type": "string",
      "description": "Candidate name, for example Elizabeth Warren.",
      "examples": [
        "Alexandria Ocasio-Cortez",
        "Elizabeth Warren"
      ]
    },
    "election_year": {
      "type": "integer",
      "description": "Two-year election cycle, for example 2024. Defaults to the FEC’s current cycle.",
      "examples": [
        2024
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "state": "NY",
      "office": "house",
      "candidate": "Alexandria Ocasio-Cortez",
      "election_year": 2024
    },
    {
      "candidate": "Elizabeth Warren"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `cycle` | integer | `2024` |  |
| `debts` | number or null | `0` |  |
| `party` | string or null | `"Democratic Party"` |  |
| `state` | string or null | `"NY"` |  |
| `office` | string | `"House"` |  |
| `currency` | string | `"USD"` |  |
| `district` | string or null | `"14"` |  |
| `total_spent` | number or null | `16716492.89` |  |
| `cash_on_hand` | number or null | `3734646.88` |  |
| `total_raised` | number or null | `15299235.57` |  |
| `candidate_link` | string | `"https://www.fec.gov/data/candidate/H8NY15148/?cycle=2024&election_full=false"` |  |
| `candidate_name` | string | `"Alexandria Ocasio-Cortez"` |  |
| `fec_candidate_id` | string | `"H8NY15148"` |  |
| `fec_committee_id` | string or null | `"C00639591"` |  |
| `coverage_end_date` | string or null | `"2024-12-31"` |  |
| `individual_contributions` | number or null | `14866494.81` |  |
| `principal_campaign_committee` | string or null | `"Alexandria Ocasio-Cortez For Congress"` |  |
| `incumbent_challenger_open_seat` | string or null | `"Incumbent"` |  |

**Example input**

```json
{
  "state": "NY",
  "office": "house",
  "candidate": "Alexandria Ocasio-Cortez",
  "election_year": 2024
}
```

**Example output**

```json
{
  "cycle": 2024,
  "debts": 0,
  "party": "Democratic Party",
  "state": "NY",
  "office": "House",
  "currency": "USD",
  "district": "14",
  "total_spent": 16716492.89,
  "cash_on_hand": 3734646.88,
  "total_raised": 15299235.57,
  "candidate_link": "https://www.fec.gov/data/candidate/H8NY15148/?cycle=2024&election_full=false",
  "candidate_name": "Alexandria Ocasio-Cortez",
  "fec_candidate_id": "H8NY15148",
  "fec_committee_id": "C00639591",
  "coverage_end_date": "2024-12-31",
  "individual_contributions": 14866494.81,
  "principal_campaign_committee": "Alexandria Ocasio-Cortez For Congress",
  "incumbent_challenger_open_seat": "Incumbent"
}
```

### Search candidates

Operation `search_candidates`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

List federal candidates for an office and election year, ranked by total money raised. Senate and House searches require a state; fundraising and cash balances reflect the latest available filings, and candidates without reported totals may have missing amounts.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `state` | string | no | `"CA"` | State or territory name or two-letter code, for example Texas or TX. Required for Senate and House. |
| `office` | string | yes | `"house"` | Federal office to search, for example house. |
| `district` | integer | no | `12` | House district number, for example 12. Use 0 for an at-large district. |
| `max_results` | integer | no | `5` | Maximum candidates to return, for example 50. |
| `election_year` | integer | yes | `2026` | Election year, for example 2026. |
| `raised_money_only` | string | no | `"no"` | Use yes to include only candidates who have raised money; use no for all candidates. For example yes. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "office",
    "election_year"
  ],
  "properties": {
    "state": {
      "type": "string",
      "description": "State or territory name or two-letter code, for example Texas or TX. Required for Senate and House.",
      "examples": [
        "CA",
        "Texas"
      ]
    },
    "office": {
      "enum": [
        "president",
        "senate",
        "house"
      ],
      "type": "string",
      "description": "Federal office to search, for example house.",
      "examples": [
        "house",
        "senate",
        "president"
      ]
    },
    "district": {
      "type": "integer",
      "maximum": 99,
      "minimum": 0,
      "description": "House district number, for example 12. Use 0 for an at-large district.",
      "examples": [
        12
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 50,
      "maximum": 200,
      "minimum": 1,
      "description": "Maximum candidates to return, for example 50.",
      "x-fous-developer": true,
      "examples": [
        5,
        4
      ]
    },
    "election_year": {
      "type": "integer",
      "maximum": 2100,
      "minimum": 1900,
      "description": "Election year, for example 2026.",
      "examples": [
        2026,
        2028
      ]
    },
    "raised_money_only": {
      "enum": [
        "yes",
        "no"
      ],
      "type": "string",
      "default": "yes",
      "description": "Use yes to include only candidates who have raised money; use no for all candidates. For example yes.",
      "examples": [
        "no"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "state": "CA",
      "office": "house",
      "district": 12,
      "max_results": 5,
      "election_year": 2026,
      "raised_money_only": "no"
    },
    {
      "state": "Texas",
      "office": "senate",
      "max_results": 5,
      "election_year": 2026
    },
    {
      "office": "president",
      "max_results": 4,
      "election_year": 2028
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `candidates` | array |  |  |
| `candidates[].party` | string or null | `"DEMOCRATIC PARTY"` |  |
| `candidates[].state` | string or null | `"California"` |  |
| `candidates[].district` | integer or null | `12` |  |
| `candidates[].incumbency` | string or null | `"Incumbent"` |  |
| `candidates[].candidate_id` | string or null | `"H4CA12154"` |  |
| `candidates[].candidate_url` | string or null | `"https://www.fec.gov/data/candidate/H4CA12154/?cycle=2026"` |  |
| `candidates[].candidate_name` | string or null | `"SIMON, LATEEFAH"` |  |
| `candidates[].candidate_status` | string or null | `"Present candidate"` |  |
| `candidates[].cash_on_hand_usd` | number or null | `777589.88` |  |
| `candidates[].total_raised_usd` | number or null | `1449191.49` |  |
| `candidates[].coverage_end_date` | string or null | `"2026-06-30"` |  |

**Example input**

```json
{
  "state": "CA",
  "office": "house",
  "district": 12,
  "max_results": 5,
  "election_year": 2026,
  "raised_money_only": "no"
}
```

**Example output**

```json
{
  "candidates": [
    {
      "party": "DEMOCRATIC PARTY",
      "state": "California",
      "district": 12,
      "incumbency": "Incumbent",
      "candidate_id": "H4CA12154",
      "candidate_url": "https://www.fec.gov/data/candidate/H4CA12154/?cycle=2026",
      "candidate_name": "SIMON, LATEEFAH",
      "candidate_status": "Present candidate",
      "cash_on_hand_usd": 777589.88,
      "total_raised_usd": 1449191.49,
      "coverage_end_date": "2026-06-30"
    },
    {
      "party": "DEMOCRATIC PARTY",
      "state": "California",
      "district": 12,
      "incumbency": "Challenger",
      "candidate_id": "H6CA12209",
      "candidate_url": "https://www.fec.gov/data/candidate/H6CA12209/?cycle=2026",
      "candidate_name": "JOYCE, JAMIE",
      "candidate_status": "Present candidate",
      "cash_on_hand_usd": 8800.3,
      "total_raised_usd": 31247.25,
      "coverage_end_date": "2026-06-30"
    },
    {
      "party": "REPUBLICAN PARTY",
      "state": "California",
      "district": 12,
      "incumbency": "Challenger",
      "candidate_id": "H6CA12191",
      "candidate_url": "https://www.fec.gov/data/candidate/H6CA12191/?cycle=2026",
      "candidate_name": "FULKERSON, HEATH VINCENT",
      "candidate_status": "Not yet a candidate",
      "cash_on_hand_usd": 0,
      "total_raised_usd": 0,
      "coverage_end_date": null
    }
  ]
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@fec",
  "visibility": "public",
  "operation": "get_candidate_fundraising",
  "version": 1,
  "input": {
    "state": "NY",
    "office": "house",
    "candidate": "Alexandria Ocasio-Cortez",
    "election_year": 2024
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@fec\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_candidate_fundraising\",\n  \"version\": 1,\n  \"input\": {\n    \"state\": \"NY\",\n    \"office\": \"house\",\n    \"candidate\": \"Alexandria Ocasio-Cortez\",\n    \"election_year\": 2024\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@fec",
  "visibility": "public",
  "operation": "get_candidate_fundraising",
  "version": 1,
  "input": {
    "state": "NY",
    "office": "house",
    "candidate": "Alexandria Ocasio-Cortez",
    "election_year": 2024
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/fec`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_candidate_fundraising`: Get candidate fundraising. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `search_candidates`: Search candidates. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-fec https://api.fous.com/mcp/tools/fec --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Compare federal candidates’ fundraising and spending by election cycle
- Find candidates ranked by money raised for an office and year
- Review candidate cash balances and reported fundraising
- Filter candidate searches by state, district, or fundraising status

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this FEC tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a FEC account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from fec.gov when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

### How much has a federal candidate raised and spent?

Get candidate fundraising returns a candidate’s fundraising and spending for a two-year filing period.

### Which candidates raised the most for an office and year?

Search candidates lists federal candidates ranked by total money raised for the selected office and election year.

### How can I find candidates by state or House district?

Search candidates accepts a state for Senate and House searches, and a district number for House searches.

## Related

- [Ballotpedia API](https://fous.com/tools/ballotpedia.md): Ballotpedia provides state and local election information, ballot measure coverage, statewide measure details and results by year, and candidate and officeholder profiles with available background and election results.
- [Congress.gov API](https://fous.com/tools/congress-gov.md): Congress.gov returns federal bills and resolutions matching topic, Congress, status, or chamber, and provides an individual bill’s status, summary, titles, actions, and related bills; summaries may be unavailable.
- [SEC EDGAR API](https://fous.com/tools/sec-edgar.md): SEC EDGAR provides filings, annual and quarterly financials, exact-phrase matches, up to 200 insider trades, and quarterly 13F manager holdings; older filings appear when available.
- [Grants.gov API](https://fous.com/tools/grants-gov.md): U.S. federal grant opportunities and application information.
- [PolitiFact API](https://fous.com/tools/politifact.md): Fact checks of political claims and public statements.
- [FEMA API](https://fous.com/tools/fema.md): FEMA provides public U.S. flood maps and disaster information, including approximate address-based flood risk details and federal disaster declarations by state or county.
- [USAspending API](https://fous.com/tools/usaspending.md): USAspending provides official federal spending data and searchable awards from October 1, 2007 onward; figures and agency account reports may be revised or lag published award updates.
- [ElectionGuide API](https://fous.com/tools/electionguide.md): ElectionGuide provides worldwide election dates and information, including upcoming elections and referendums within six months and the latest held national election or referendum in a specified year, with results when published.
- [All Government tools](https://fous.com/tools/category/government)
