# Harvard Dataverse: MIT Election Data and Science Lab returns · Query returns

Get industry and reference data with Harvard Dataverse: MIT Election Data and Science Lab returns · Query returns from Alexandria through one Spiral API key. Historical baselines for one race: how a state or district voted, candidate and party totals, turnout (total votes), vote mode splits, and precinct or county detail from MEDSL files. It runs in the background and returns structured JSON. Pay as you go, with no subscription.

- Provider: Alexandria
- Category: Industry Data
- Runs: In the background
- Returns: json
- Tool id: `alexandria` / `dataverse-harvard-edu/elections/query_returns`
- Page: https://spiral.ai/tools/alexandria/dataverse-harvard-edu/elections/query_returns

## Pricing

$0.00873 per call.

## Limits

- Longest queue wait: 1 hour
- Run deadline: 5 minutes
- Longest run, end to end: 225 minutes
- Largest inline input: 1 MB
- Largest input file: 2 GB
- Largest output: 5 GB

## Input

| Field | Kind | Allowed | Default | Description |
| --- | --- | --- | --- | --- |
| `doi` (required) | text |  | — | Dataset DOI: doi:10.7910/DVN/PEJ5QU, 10.7910/DVN/PEJ5QU or https://doi.org/10.7910/DVN/PEJ5QU. |
| `mode` | text |  | — | Vote mode, e.g. TOTAL, ELECTION DAY, ABSENTEE. |
| `year` | number | 1789 to 2100 | — | year |
| `limit` | number | 1 to 1000 | — | Maximum rows, default 200. |
| `party` | text |  | — | Substring of party_detailed, party_simplified or party, e.g. DEMOCRAT. |
| `stage` | text |  | — | Election stage, e.g. gen or pri. |
| `state` | text |  | — | State name (GEORGIA) or postal code (GA), case-insensitive exact match. |
| `county` | text |  | — | County name (exact, case-insensitive) or county FIPS code. |
| `office` | text |  | — | Substring of the office column, e.g. SENATE, US HOUSE, GOVERNOR. |
| `offset` | number | 0 to … | — | Byte offset to resume at: the previous answer's `next_offset`. Default 0. |
| `file_id` | number | 1 to … | — | File id from `get_dataset`. |
| `district` | text |  | — | District; numbers compare numerically (5 = 005), otherwise exact (statewide). |
| `candidate` | text |  | — | Substring of the candidate name as MEDSL prints it (upper case, e.g. OSSOFF). |
| `file_name` | text |  | — | File name (label or original name) from `get_dataset`, e.g. 1976-2024-senate-state.tab. |

## Example

```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
    }
  }'
```

Try it in the Playground: https://spiral.ai/start?provider=alexandria&model=dataverse-harvard-edu%2Felections%2Fquery_returns

## Common questions

### Harvard Dataverse: MIT Election Data and Science Lab returns · Query returns

**How much does Harvard Dataverse: MIT Election Data and Science Lab returns · Query returns cost?**

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

**How do I use Harvard Dataverse: MIT Election Data and Science Lab returns · Query returns through an API?**

Send `POST /v1/runs` with `"provider": "alexandria"`, `"model": "dataverse-harvard-edu/elections/query_returns"` and the input fields on this page, using one Spiral API key. It runs in the background: poll the run, or name a webhook to be told when it finishes.

**Do I need an account with Alexandria to use Harvard Dataverse: MIT Election Data and Science Lab returns · Query returns?**

No. Spiral runs it on its own Alexandria account and charges your Spiral balance.

**Can my AI agent use Harvard Dataverse: MIT Election Data and Science Lab returns · Query returns?**

Yes. Agents find and run it through Spiral's MCP server, CLI or agent skill, with the same API key.

