# Ballotpedia API

> Ballotpedia returns statewide ballot measures and candidate profiles as a workflow and API.

List ballot measures returns statewide measures, election dates, topics, vote meanings, and results for a required state and year. Get candidate returns a candidate or officeholder profile, including election results and background, for a required name and optional state.

- Page: https://fous.com/workflows/ballotpedia
- Handle: `@ballotpedia`
- Category: [Government](https://fous.com/workflows/category/government)
- Source website: https://ballotpedia.org
- Last verified: Sep 29, 2026
- Fous is not affiliated with Ballotpedia.

## Methods

### Get candidate

Operation `get_candidate`, version 1. 1 credit per call.

Get a Ballotpedia candidate or officeholder profile by name, with election results, background, and published links. A state can narrow people with the same name; unreported details are left blank.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `name` | string | yes | `"Alexandria Ocasio-Cortez"` | Candidate or officeholder name, for example Alexandria Ocasio-Cortez. |
| `state` | string | no | `"Texas"` | Optional state name or two-letter code to distinguish candidates, for example New York or NY. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Candidate or officeholder name, for example Alexandria Ocasio-Cortez.",
      "examples": [
        "Alexandria Ocasio-Cortez",
        "John Smith",
        "Bernie Sanders"
      ]
    },
    "state": {
      "type": "string",
      "description": "Optional state name or two-letter code to distinguish candidates, for example New York or NY.",
      "examples": [
        "Texas"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "name": "Alexandria Ocasio-Cortez"
    },
    {
      "name": "John Smith",
      "state": "Texas"
    },
    {
      "name": "Bernie Sanders"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `party` | string or null | `"Democratic Party"` |  |
| `state` | string or null | `"New York"` |  |
| `biography` | string or null | `"Alexandria Ocasio-Cortez graduated from Boston University College of Arts & Sciences in 2011 with a Bachelor of Arts de` |  |
| `elections` | array |  |  |
| `elections[].year` | integer | `2026` |  |
| `elections[].stage` | string | `"Primary"` |  |
| `elections[].office` | string | `"U.S. House New York District 14"` |  |
| `elections[].result` | string | `"Won"` |  |
| `elections[].vote_percentage` | number or null | `86.9` |  |
| `elections[].ballotpedia_link` | string | `"https://ballotpedia.org/Alexandria_Ocasio-Cortez#2026"` |  |
| `full_name` | string | `"Alexandria Ocasio-Cortez"` |  |
| `photo_link` | string or null | `"https://s3.amazonaws.com/ballotpedia-api4/files/thumbs/200/300/Alexandria_Ocasio-Cortez.jpg"` |  |
| `office_since` | string or null | `"2019-01-03"` |  |
| `other_matches` | array |  |  |
| `other_matches[].name` | string | `"John Smith (Mart Independent School District, At-large, Texas, candidate 2025)"` |  |
| `other_matches[].ballotpedia_link` | string | `"https://ballotpedia.org/John_Smith_(Mart_Independent_School_District,_At-large,_Texas,_candidate_2025)"` |  |
| `current_office` | string | `"U.S. House New York District 14"` |  |
| `ballotpedia_link` | string | `"https://ballotpedia.org/Alexandria_Ocasio-Cortez"` |  |
| `campaign_website` | string or null | `"https://www.ocasiocortez.com"` |  |
| `official_website` | string or null | `"https://ocasio-cortez.house.gov/"` |  |
| `social_media_links` | array |  |  |
| `social_media_links[].link` | string | `"https://www.facebook.com/repAOC/"` |  |
| `social_media_links[].platform` | string | `"Facebook"` |  |
| `social_media_links[].account_type` | string | `"Official"` |  |
| `key_positions_or_campaign_themes` | array |  |  |

**Example input**

```json
{
  "name": "Alexandria Ocasio-Cortez"
}
```

**Example output**

```json
{
  "party": "Democratic Party",
  "state": "New York",
  "biography": "Alexandria Ocasio-Cortez graduated from Boston University College of Arts & Sciences in 2011 with a Bachelor of Arts degree in international relations and economics. She was a volunteer organizer for …",
  "elections": [
    {
      "year": 2026,
      "stage": "Primary",
      "office": "U.S. House New York District 14",
      "result": "Won",
      "vote_percentage": 86.9,
      "ballotpedia_link": "https://ballotpedia.org/Alexandria_Ocasio-Cortez#2026"
    },
    {
      "year": 2024,
      "stage": "General",
      "office": "U.S. House New York District 14",
      "result": "Won",
      "vote_percentage": 68.9,
      "ballotpedia_link": "https://ballotpedia.org/Alexandria_Ocasio-Cortez#2024"
    }
  ],
  "full_name": "Alexandria Ocasio-Cortez",
  "photo_link": "https://s3.amazonaws.com/ballotpedia-api4/files/thumbs/200/300/Alexandria_Ocasio-Cortez.jpg",
  "office_since": "2019-01-03",
  "other_matches": [],
  "current_office": "U.S. House New York District 14",
  "ballotpedia_link": "https://ballotpedia.org/Alexandria_Ocasio-Cortez",
  "campaign_website": "https://www.ocasiocortez.com",
  "official_website": "https://ocasio-cortez.house.gov/",
  "social_media_links": [
    {
      "link": "https://www.facebook.com/repAOC/",
      "platform": "Facebook",
      "account_type": "Official"
    },
    {
      "link": "https://x.com/RepAOC",
      "platform": "X",
      "account_type": "Official"
    }
  ],
  "key_positions_or_campaign_themes": [
    "During her campaign, Ocasio-Cortez said she supported policies including universal Medicare, free tuition for public college and trade school, 100% renewable energy, abolishing Immigration and Customs…"
  ]
}
```

### List ballot measures

Operation `list_ballot_measures`, version 1. 1 credit per call.

List statewide ballot measures in a US state and year, in Ballotpedia order, with election dates, topics, measure types, yes/no vote meanings and results. Years without statewide measures return an empty list.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `year` | integer | yes | `2026` | Election year, for example 2024. |
| `state` | string | yes | `"Nevada"` | US state name or two-letter code, for example California. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "state",
    "year"
  ],
  "properties": {
    "year": {
      "type": "integer",
      "description": "Election year, for example 2024.",
      "examples": [
        2026,
        2024,
        2023
      ]
    },
    "state": {
      "type": "string",
      "description": "US state name or two-letter code, for example California.",
      "examples": [
        "Nevada",
        "California",
        "Florida"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "year": 2026,
      "state": "Nevada"
    },
    {
      "year": 2024,
      "state": "California"
    },
    {
      "year": 2024,
      "state": "Florida"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `measures` | array |  | Statewide measures in the order listed by Ballotpedia. |
| `measures[].link` | string | `"https://ballotpedia.org/Nevada_Question_6,_Right_to_Abortion_Initiative_(2026)"` |  |
| `measures[].type` | string or null | `"Citizen-initiated constitutional amendment"` |  |
| `measures[].result` | string | `"upcoming"` |  |
| `measures[].topics` | array |  |  |
| `measures[].measure_name` | string | `"Nevada Question 6"` |  |
| `measures[].election_date` | string | `"2026-11-03"` |  |
| `measures[].no_vote_means` | string | `"A \"no\" vote opposes providing for a state constitutional right to an abortion, providing for the state to regulate ab` |  |
| `measures[].yes_vote_means` | string | `"A \"yes\" vote supports providing for a state constitutional right to an abortion, providing for the state to regulate ` |  |
| `measures[].no_vote_percentage` | number or null | `45.1` |  |
| `measures[].yes_vote_percentage` | number or null | `54.9` |  |

**Example input**

```json
{
  "year": 2026,
  "state": "Nevada"
}
```

**Example output**

```json
{
  "measures": [
    {
      "link": "https://ballotpedia.org/Nevada_Question_6,_Right_to_Abortion_Initiative_(2026)",
      "type": "Citizen-initiated constitutional amendment",
      "result": "upcoming",
      "topics": [
        "Constitutional rights",
        "Abortion"
      ],
      "measure_name": "Nevada Question 6",
      "election_date": "2026-11-03",
      "no_vote_means": "A \"no\" vote opposes providing for a state constitutional right to an abortion, providing for the state to regulate abortion after fetal viability , except where medically indicated to \"protect the lif…",
      "yes_vote_means": "A \"yes\" vote supports providing for a state constitutional right to an abortion, providing for the state to regulate abortion after fetal viability , except where medically indicated to \"protect the l…",
      "no_vote_percentage": null,
      "yes_vote_percentage": null
    },
    {
      "link": "https://ballotpedia.org/Nevada_Question_7,_Require_Voter_Identification_Initiative_(2026)",
      "type": "Citizen-initiated constitutional amendment",
      "result": "upcoming",
      "topics": [
        "Voter ID"
      ],
      "measure_name": "Nevada Question 7",
      "election_date": "2026-11-03",
      "no_vote_means": "A \"no\" vote opposes amending the constitution to require that Nevada residents present a form of photo identification to verify their identity while voting in person, or to verify their identity using…",
      "yes_vote_means": "A \"yes\" vote supports amending the constitution to require that Nevada residents present a form of photo identification to verify their identity while voting in person, or to verify their identity usi…",
      "no_vote_percentage": null,
      "yes_vote_percentage": null
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@ballotpedia",
  "visibility": "public",
  "operation": "get_candidate",
  "version": 1,
  "input": {
    "name": "Alexandria Ocasio-Cortez"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@ballotpedia\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_candidate\",\n  \"version\": 1,\n  \"input\": {\n    \"name\": \"Alexandria Ocasio-Cortez\"\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=120) 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.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@ballotpedia",
  "visibility": "public",
  "operation": "get_candidate",
  "version": 1,
  "input": {
    "name": "Alexandria Ocasio-Cortez"
  },
  "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);
```

Or describe the data in plain language: send `{"api":"@ballotpedia","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Compare statewide measures across election years
- Review yes and no vote meanings and results
- Research candidates’ election histories
- Find candidate background and published links

## FAQ

### Is Fous affiliated with Ballotpedia?

No. Fous is not affiliated with Ballotpedia. This workflow reads the public ballotpedia.org website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a Ballotpedia account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from ballotpedia.org when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### What statewide measures appeared in a state and year?

List ballot measures returns statewide measures for a required state and year.

### How did a ballot measure vote turn out?

List ballot measures includes the measure’s result and yes and no vote percentages.

### What elections has a candidate participated in?

Get candidate returns election years, stages, offices, results, and vote percentages.

## Related

- [FEC API](https://fous.com/workflows/fec.md): FEC provides federal campaign finance data, including candidate fundraising and spending for a two-year period and candidate totals from the latest available filings.
- [ElectionGuide API](https://fous.com/workflows/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.
- [PolitiFact API](https://fous.com/workflows/politifact.md): Fact checks of political claims and public statements.
- [IMDb API](https://fous.com/workflows/imdb.md): IMDb returns movie, TV, person, episode, chart and Parents Guide details, including available weekly rank changes; missing details are null, and unaired or unrated episodes lack ratings.
- [MLB API](https://fous.com/workflows/mlb.md): MLB provides scores, schedules and game details for one date or up to seven days, regular-season division standings defaulting to the current year, and player profiles with regular-season stats for a selected season and career.
- [Social Security Administration API](https://fous.com/workflows/social-security-administration.md): The Social Security Administration reports annual U.S. baby-name ranks and counts nationwide since 1880 and by state since 1960; counts under five are withheld.
- [Congress.gov API](https://fous.com/workflows/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.
- [Yelp API](https://fous.com/workflows/yelp.md): Yelp returns local business matches, public profiles, ratings and up to 60 publicly shown reviews; matches are unsponsored and Yelp-ordered, but later results may lack contact or location details.
- [All Government workflows](https://fous.com/workflows/category/government)
