ElectionGuide API: Get election results
Gets a country's most recent held national election or referendum on ElectionGuide, optionally for a year and election type, with turnout and published candidate, party or option results.
Unofficial. Not affiliated with or endorsed by ElectionGuide.
Inputs
Values from the run on Oct 31, 2026, shown under Output.
- Year optional
year Election year, for example 2025. Omit for the most recent held election.
Not set
Whole number from 1900 to 2100.
- Country, required
country Country name, for example Germany.
Germany
- Election Type optional
election_type Election category, for example legislative. Defaults to any.
any (default)
One of
any,presidential,legislative,referendum.
Input as JSON
{ "country": "Germany"}Output
{ "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}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"electionguide.org/get_election_results","input":{"country":"Germany"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "electionguide.org/get_election_results" , "input": { "country": "Germany" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "electionguide.org/get_election_results" , "input": { "country": "Germany" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run electionguide.org/get_election_results# with {"country":"Germany"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "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." }, "country": { "type": "string", "description": "Country name, for example Germany." }, "election_type": { "enum": [ "any", "presidential", "legislative", "referendum" ], "type": "string", "default": "any", "description": "Election category, for example legislative. Defaults to any." } }}Output schema
{ "type": "object", "required": [ "country", "election_name", "election_type", "date", "registered_voters", "votes_cast", "turnout_percent", "results", "note", "link" ], "properties": { "date": { "type": "string", "format": "date" }, "link": { "type": "string", "format": "uri" }, "note": { "type": [ "string", "null" ] }, "country": { "type": "string" }, "results": { "type": "array", "items": { "type": "object", "required": [ "name", "party", "votes", "vote_share_percent", "seats_won" ], "properties": { "name": { "type": "string" }, "party": { "type": [ "string", "null" ] }, "votes": { "type": [ "integer", "null" ] }, "seats_won": { "type": [ "integer", "null" ] }, "vote_share_percent": { "type": [ "number", "null" ] } }, "additionalProperties": false } }, "votes_cast": { "type": [ "integer", "null" ] }, "election_name": { "type": "string" }, "election_type": { "enum": [ "presidential", "legislative", "referendum" ], "type": "string" }, "turnout_percent": { "type": [ "number", "null" ] }, "registered_voters": { "type": [ "integer", "null" ] } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
electionguide.org/get_election_results- Returns
- election name, type, date, registered voters, votes cast, turnout, results with votes, vote share and seats, link
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method electionguide.org/get_election_results with the inputs above.
Ask your agent
- What were the results of Germany's 2025 legislative election, including turnout and seats won by each party?
- Pull up the latest presidential election in Brazil from electionguide.org with vote shares for each candidate
- How did the most recent referendum in Switzerland turn out? I need registered voters, votes cast, and the yes/no breakdown
- Show me Kenya's 2022 presidential election numbers: turnout and how many votes each candidate got
- Check ElectionGuide for the last national election held in Indonesia and give me the party results
See more
Looks up a World Bank statistic for a country and returns its annual values and latest value for the selected years.
data.worldbank.org/get_country_statisticLists 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.
ballotpedia.org/list_ballot_measuresRanks countries by a World Development Indicators statistic for a given year, or for the latest year with broad country coverage. Regional aggregates and countries without data for that year are left out.
worldbank.org/compare_countriesLooks up a country's passport on Passport Index and returns its global rank, mobility score, visa requirement counts and optionally every destination's requirement.
passportindex.org/get_passport_rankReturns the main-race finishing order and fastest lap for a Formula 1 Grand Prix. Defaults to the most recent completed race in the current season.
formula1.com/get_race_resultsReturns seven key economic indicators for a country from its public Trading Economics overview: GDP growth rate, inflation rate, interest rate, unemployment rate, government debt to GDP, currency and stock market. Indicators absent from the overview are null; the US dollar index is not reported as a USD exchange rate.
tradingeconomics.com/get_country_overviewGets singles match results round by round for an ATP tournament and year, including the champion, dates, surface and category. Without a year it uses the most recent listed edition.
atptour.com/get_tournament_resultsFinds the Our World in Data chart that best matches a statistic and returns its country-by-year numeric values, definition and source.
ourworldindata.org/get_statistic