[Integrations](https://spiral.ai/integrations) › [goose](https://spiral.ai/integrations/goose) › [MIT Election Lab election returns](https://spiral.ai/integrations/goose/mit-election-lab-election-returns)

# How to Use MIT Election Lab election returns in goose

Returns matching election records from a selected MEDSL file, including candidate votes and available geographic detail. Use it to calculate historical margins or compare places after choosing the correct dataset.

|  |  |
| --- | --- |
| Model | MIT Election Lab election returns |
| Available through | Alexandria |
| Category | Industry Data |
| Price | $0.00873 per call. |
| Returns | json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with MIT Election Lab election returns in goose

- Use MIT Election Lab election returns to retrieve Maricopa County, Arizona, presidential records for 2020 and 2024 from the appropriate file, then write a script calculating party vote shares.
- Use MIT Election Lab election returns to retrieve Pennsylvania's 2024 U.S. House records from the appropriate file and build a candidate vote table grouped by district.
- Use MIT Election Lab election returns to look this up and give me the result as a table. Save the result in ./assets.
- Pull the latest numbers from MIT Election Lab election returns and tell me what changed since last week.
- Check MIT Election Lab election returns and summarize what you find in three bullet points.

## How to set up MIT Election Lab election returns in goose

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the extension**: In goose Desktop, open the sidebar, click Extensions, then Add custom extension. Enter:

2. **Sign in**: When goose first connects to Spiral, your browser opens. Sign in to Spiral, pick the organization and click Authorize. No API key. If the browser does not open, goose prints the link to open yourself.

### Use the Spiral skill

1. **Send goose this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run MIT Election Lab election returns**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "alexandria",
    "model": "dataverse-harvard-edu/elections/query_returns",
    "input": {
      "doi": "<doi>",
      "file_id": 1
    }
  }'
```

Then paste one of the prompts above: goose finds MIT Election Lab election returns on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/goose

## MIT Election Lab election returns tools and prices

- [Harvard Dataverse: MIT Election Data and Science Lab returns · Query returns](https://spiral.ai/tools/alexandria/dataverse-harvard-edu/elections/query_returns) (Alexandria): $0.00873 per call.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| mode |  | — | Vote mode, e.g. TOTAL, ELECTION DAY, ABSENTEE. |
| year | 1789 to 2100 | — | year |
| limit | 1 to 1000 | — | Maximum rows, default 200. |
| party |  | — | Substring of party_detailed, party_simplified or party, e.g. DEMOCRAT. |
| stage |  | — | Election stage, e.g. gen or pri. |
| state |  | — | State name (GEORGIA) or postal code (GA), case-insensitive exact match. |

## What can you do with MIT Election Lab election returns in goose?

Build election analysis tables from MEDSL's documented returns and calculate county swings or congressional margins. A coding agent can inspect dataset files, then add calculations that handle voting mode totals and suppressed counts.

### County presidential swing analysis

Find the county presidential dataset, inspect its files, and compare Democratic and Republican margins in Maricopa County, Arizona, for 2016, 2020, and 2024.

### Historical House election tables

Locate the U.S. House returns, check their documentation, and build a table of candidate vote totals and calculated margins for Pennsylvania's 2024 congressional races.

### Local reporting background

Locate and inspect the relevant precinct release, then summarize 2024 presidential results for Wake County, North Carolina, as background for a local election story.

### Voting mode comparison

Find Georgia's 2024 precinct data, inspect its documentation, and compare the presidential vote totals reported for separate voting modes without adding them to overall totals.

### Published result verification

Find the county presidential returns and inspect the source files, then check a reported 2024 candidate margin in Dane County, Wisconsin, against the underlying vote records.

### Election analysis teaching material

Locate the county presidential dataset, review its documentation, and create a worked example calculating candidate vote shares for Allegheny County, Pennsylvania, in 2020 and 2024.

## Overview

- [Alexandria](https://spiral.ai/providers/alexandria)
- [All goose guides](https://spiral.ai/integrations/goose)

## MIT Election Lab election returns in other agents

- [Amp](https://spiral.ai/integrations/amp/mit-election-lab-election-returns)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/mit-election-lab-election-returns)
- [Claude](https://spiral.ai/integrations/claude-desktop/mit-election-lab-election-returns)
- [Claude Code](https://spiral.ai/integrations/claude-code/mit-election-lab-election-returns)
- [Cline](https://spiral.ai/integrations/cline/mit-election-lab-election-returns)
- [Codex](https://spiral.ai/integrations/codex/mit-election-lab-election-returns)
- [Cursor](https://spiral.ai/integrations/cursor/mit-election-lab-election-returns)
- [Devin](https://spiral.ai/integrations/devin/mit-election-lab-election-returns)
- [dots](https://spiral.ai/integrations/dots/mit-election-lab-election-returns)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/mit-election-lab-election-returns)
- [Gemini](https://spiral.ai/integrations/gemini/mit-election-lab-election-returns)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/mit-election-lab-election-returns)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/mit-election-lab-election-returns)
- [Grok](https://spiral.ai/integrations/grok/mit-election-lab-election-returns)
- [Grok Build](https://spiral.ai/integrations/grok-build/mit-election-lab-election-returns)
- [Hermes](https://spiral.ai/integrations/hermes/mit-election-lab-election-returns)
- [Instinct](https://spiral.ai/integrations/instinct/mit-election-lab-election-returns)
- [Manus](https://spiral.ai/integrations/manus/mit-election-lab-election-returns)
- [Muse](https://spiral.ai/integrations/muse/mit-election-lab-election-returns)
- [Muse Code](https://spiral.ai/integrations/muse-code/mit-election-lab-election-returns)
- [n8n](https://spiral.ai/integrations/n8n/mit-election-lab-election-returns)
- [Notion](https://spiral.ai/integrations/notion/mit-election-lab-election-returns)
- [OpenClaw](https://spiral.ai/integrations/openclaw/mit-election-lab-election-returns)
- [opencode](https://spiral.ai/integrations/opencode/mit-election-lab-election-returns)
- [Perplexity](https://spiral.ai/integrations/perplexity/mit-election-lab-election-returns)
- [Raycast](https://spiral.ai/integrations/raycast/mit-election-lab-election-returns)
- [VS Code](https://spiral.ai/integrations/vscode/mit-election-lab-election-returns)
- [Windsurf](https://spiral.ai/integrations/windsurf/mit-election-lab-election-returns)
- [Zapier](https://spiral.ai/integrations/zapier/mit-election-lab-election-returns)

## More goose guides

- [MIT Election Lab dataset search](https://spiral.ai/integrations/goose/mit-election-lab-dataset-search)
- [MorphoSource media record](https://spiral.ai/integrations/goose/morphosource-media-record)
- [MIT Election Lab dataset details](https://spiral.ai/integrations/goose/mit-election-lab-dataset-details)
- [MorphoSource media search](https://spiral.ai/integrations/goose/morphosource-media-search)
- [JPL Horizons state vectors](https://spiral.ai/integrations/goose/jpl-horizons-state-vectors)
- [MorphoSource specimen details](https://spiral.ai/integrations/goose/morphosource-specimen-details)

## Questions about MIT Election Lab election returns in goose

**Can goose use MIT Election Lab election returns?**

Yes. Add Spiral to goose as an MCP server, and goose can find and run MIT Election Lab election returns like any built-in tool.

**How much does MIT Election Lab election returns cost in goose?**

$0.00873 per call. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your goose plan is separate.

**Do I need an Alexandria account to use MIT Election Lab election returns in goose?**

No. Spiral runs MIT Election Lab election returns on its own Alexandria account. You sign in to Spiral once and never paste a key.

**How long does it take to set up MIT Election Lab election returns in goose?**

About two minutes: add the extension, then sign in.

**Does goose wait while MIT Election Lab election returns runs?**

MIT Election Lab election returns runs in the background. goose starts the run, checks on it and gives you the json when it's ready.

**How far back do the election results go?**

Coverage depends on the dataset. MEDSL's county presidential returns span 2000 through 2024, while its U.S. House district returns span 1976 through 2024.

**Is this a live election results source?**

Use MEDSL's precinct releases for historical analysis. The 2024 precinct dataset took over 500 days after polls closed to become ready for release.

**Where does MEDSL get the returns?**

MEDSL starts with state election authorities and collects from county authorities when precinct data is unavailable statewide. It sometimes fills collection gaps using OpenElections.

**Are all precinct vote counts public?**

Some small jurisdictions in California, Kansas, Nevada, and New Mexico withhold counts for privacy. In the 2024 precinct data, an asterisk marks these suppressed counts.

**Why can adding the vote records produce an inflated total?**

Some states report both separate voting modes and TOTAL rows. MEDSL warns that combining those rows can double-count the same votes.

