# ElectionGuide API

> ElectionGuide returns upcoming elections and national election results as a workflow and API.

List upcoming elections returns dates and statuses for elections and referendums within six months; filter by region or country. Get election results returns turnout and published results; provide a country, with an optional year and election category.

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

## Methods

### Get election results

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

Get a country's most recent held national election or referendum in a year, including turnout and published candidate or party results. Some held elections do not have a published result breakdown; candidate party names may be unavailable.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `year` | integer | no | `2024` | Election year, for example 2025. Omit for the most recent held election. |
| `country` | string | yes | `"Germany"` | Country name, for example Germany. |
| `election_type` | string | no | `"presidential"` | Election category, for example legislative. Defaults to any. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "country"
  ],
  "properties": {
    "year": {
      "type": "integer",
      "maximum": 2100,
      "minimum": 1900,
      "description": "Election year, for example 2025. Omit for the most recent held election.",
      "examples": [
        2024,
        2018,
        2012
      ]
    },
    "country": {
      "type": "string",
      "description": "Country name, for example Germany.",
      "examples": [
        "Germany",
        "Ghana",
        "United States"
      ]
    },
    "election_type": {
      "enum": [
        "any",
        "presidential",
        "legislative",
        "referendum"
      ],
      "type": "string",
      "default": "any",
      "description": "Election category, for example legislative. Defaults to any.",
      "examples": [
        "presidential",
        "referendum"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "country": "Germany"
    },
    {
      "year": 2024,
      "country": "Ghana",
      "election_type": "presidential"
    },
    {
      "year": 2018,
      "country": "Ghana",
      "election_type": "referendum"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `date` | string | `"2025-02-23"` |  |
| `link` | string | `"https://www.electionguide.org/elections/id/4574/"` |  |
| `note` | string or null | `"Candidate, party, or referendum option results are not published for this election on ElectionGuide."` |  |
| `country` | string | `"Germany"` |  |
| `results` | array |  |  |
| `results[].name` | string | `"Christian Democratic Union (CDU) (Christlich Demokratische Union Deutschlands)"` |  |
| `results[].party` | string or null | `"Christian Democratic Union (CDU) (Christlich Demokratische Union Deutschlands)"` |  |
| `results[].votes` | integer or null | `11194700` |  |
| `results[].seats_won` | integer or null | `164` |  |
| `results[].vote_share_percent` | number or null | `22.6` |  |
| `votes_cast` | integer or null | `49927315` |  |
| `election_name` | string | `"German Federal Diet"` |  |
| `election_type` | string | `"legislative"` |  |
| `turnout_percent` | number or null | `82.54` |  |
| `registered_voters` | integer or null | `60490603` |  |

**Example input**

```json
{
  "country": "Germany"
}
```

**Example output**

```json
{
  "date": "2025-02-23",
  "link": "https://www.electionguide.org/elections/id/4574/",
  "note": null,
  "country": "Germany",
  "results": [
    {
      "name": "Christian Democratic Union (CDU) (Christlich Demokratische Union Deutschlands)",
      "party": "Christian Democratic Union (CDU) (Christlich Demokratische Union Deutschlands)",
      "votes": 11194700,
      "seats_won": 164,
      "vote_share_percent": 22.6
    },
    {
      "name": "Alternative for Germany (Alternative für Deutschland)",
      "party": "Alternative for Germany (Alternative für Deutschland)",
      "votes": 10327148,
      "seats_won": 152,
      "vote_share_percent": 20.8
    },
    {
      "name": "Social Democratic Party",
      "party": "Social Democratic Party",
      "votes": 8148284,
      "seats_won": 120,
      "vote_share_percent": 16.4
    }
  ],
  "votes_cast": 49927315,
  "election_name": "German Federal Diet",
  "election_type": "legislative",
  "turnout_percent": 82.54,
  "registered_voters": 60490603
}
```

### List upcoming elections

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

List upcoming elections and referendums in the next six months, with dates, statuses and links. Includes countries and territories listed by ElectionGuide.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `region` | string | no | `"africa"` | Region to filter by, such as africa. |
| `country` | string | no | `"Brazil"` | Country name to filter by, such as Brazil. Leave blank for all countries. |
| `max_results` | integer | no | `100` | Maximum number of elections to return, such as 25. |

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "region": {
      "enum": [
        "any",
        "africa",
        "americas",
        "asia_pacific",
        "europe",
        "middle_east"
      ],
      "type": "string",
      "default": "any",
      "description": "Region to filter by, such as africa.",
      "examples": [
        "africa"
      ]
    },
    "country": {
      "type": "string",
      "default": "",
      "description": "Country name to filter by, such as Brazil. Leave blank for all countries.",
      "examples": [
        "Brazil",
        "Atlantis"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 25,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum number of elections to return, such as 25.",
      "x-fous-developer": true,
      "examples": [
        100
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "country": "Brazil"
    },
    {},
    {
      "country": "Atlantis"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `elections` | array |  |  |
| `elections[].link` | string | `"https://www.electionguide.org/elections/id/5091/"` |  |
| `elections[].type` | string | `"Presidential"` |  |
| `elections[].status` | string | `"Confirmed"` |  |
| `elections[].country` | string | `"Brazil"` |  |
| `elections[].election_date` | string | `"2026-10-04"` |  |
| `elections[].election_name` | string | `"Brazilian Presidency"` |  |

**Example input**

```json
{
  "country": "Brazil"
}
```

**Example output**

```json
{
  "elections": [
    {
      "link": "https://www.electionguide.org/elections/id/5091/",
      "type": "Presidential",
      "status": "Confirmed",
      "country": "Brazil",
      "election_date": "2026-10-04",
      "election_name": "Brazilian Presidency"
    },
    {
      "link": "https://www.electionguide.org/elections/id/5090/",
      "type": "Legislative - lower house",
      "status": "Confirmed",
      "country": "Brazil",
      "election_date": "2026-10-04",
      "election_name": "Brazilian Chamber of Deputies"
    },
    {
      "link": "https://www.electionguide.org/elections/id/5089/",
      "type": "Legislative - upper house",
      "status": "Confirmed",
      "country": "Brazil",
      "election_date": "2026-10-04",
      "election_name": "Brazilian Federal Senate"
    }
  ]
}
```

## 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": "@electionguide",
  "visibility": "public",
  "operation": "get_election_results",
  "version": 1,
  "input": {
    "country": "Germany"
  },
  "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\": \"@electionguide\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_election_results\",\n  \"version\": 1,\n  \"input\": {\n    \"country\": \"Germany\"\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": "@electionguide",
  "visibility": "public",
  "operation": "get_election_results",
  "version": 1,
  "input": {
    "country": "Germany"
  },
  "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":"@electionguide","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

- Track upcoming elections and referendums by country or region
- Review election dates and statuses across countries
- Compare published candidate or party votes, seats, and vote shares
- Monitor voter turnout and registered voters by election
- Find a country's most recent held national election

## FAQ

### Is Fous affiliated with ElectionGuide?

No. Fous is not affiliated with ElectionGuide. This workflow reads the public electionguide.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 ElectionGuide account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from electionguide.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 elections are coming up in Brazil?

Use List upcoming elections with Brazil as the country to see scheduled elections and referendums, including dates and statuses.

### Who won a country's most recent national election?

Use Get election results with the country name to see published candidate or party results, when available.

### What was voter turnout for an election?

Use Get election results with the country and, optionally, the election year and category to see turnout when available.

## Related

- [TMDB API](https://fous.com/workflows/tmdb.md): TMDB returns movie and TV details, cast, trailers, releases, viewing services, scheduled upcoming movies, and up to 20 homepage trending titles; future episode details depend on published schedules.
- [Ballotpedia API](https://fous.com/workflows/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.
- [Nager.Date API](https://fous.com/workflows/nager-date.md): Nager.Date returns annual holiday calendars, long weekends, holiday or weekend checks, country details, and up to 50 upcoming holidays within 365 days; coverage varies.
- [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.
- [parkrun API](https://fous.com/workflows/parkrun.md): Free community walking and running events and their public results.
- [Epic Games Store API](https://fous.com/workflows/epic-games-store.md): Epic Games Store provides current and upcoming free games, plus game details including country-specific prices and sales; free-game availability varies by country.
- [World Bank API](https://fous.com/workflows/world-bank.md): World Bank provides country statistics and latest values within selected years, plus country rankings for a chosen year or the latest broadly covered year.
- [Nike API](https://fous.com/workflows/nike.md): Nike returns country-specific listings and details, including prices, sizes, availability and reviews, plus publicly shown upcoming or recently stocked SNKRS releases with local launch times.
- [All Government workflows](https://fous.com/workflows/category/government)
