[Integrations](https://spiral.ai/integrations) › [VS Code](https://spiral.ai/integrations/vscode) › [Ballotpedia sample ballot](https://spiral.ai/integrations/vscode/ballotpedia-sample-ballot)

# How to Use Ballotpedia sample ballot in VS Code

Returns races, candidates, and ballot measures for a location on one election date. Use it to assemble a local ballot guide before requesting candidate profiles or measure explanations.

|  |  |
| --- | --- |
| Model | Ballotpedia sample ballot |
| Available through | Alexandria |
| Category | Maps & Reviews |
| Price | $0.00873 per call. |
| Returns | json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with Ballotpedia sample ballot in VS Code

- Use Ballotpedia sample ballot for latitude 43.07545, longitude -89.38808, on November 5, 2024, and populate our ballot view with the returned races, candidates, and measures.
- Use Ballotpedia sample ballot to look this up and give me the result as a table. Save the result in ./assets.
- Pull the latest numbers from Ballotpedia sample ballot and tell me what changed since last week.
- Check Ballotpedia sample ballot and summarize what you find in three bullet points.
- Pull the newest data from Ballotpedia sample ballot and give me the result as a table.

## How to set up Ballotpedia sample ballot in VS Code

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

### Use Spiral's MCP server

1. **Add the hosted server**: Use Add to VS Code on the console's Agents & MCP page, or run:

```bash
code --add-mcp '{"name":"spiral","type":"http","url":"https://api.spiral.ai/mcp"}'
```

2. **Sign in**: VS Code asks you to sign in when it first starts the server: sign in to Spiral and click Authorize. No API key. Run MCP: List Servers from the Command Palette to check that Spiral is running.

### Use the Spiral skill

1. **Send VS Code 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 Ballotpedia sample ballot**: 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": "ballotpedia-org/districts/ballot_for_date",
    "input": {
      "lat": -90,
      "long": -180,
      "election": "<election>"
    }
  }'
```

Then paste one of the prompts above: VS Code finds Ballotpedia sample ballot on Spiral, shows the price and runs it.

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

## Ballotpedia sample ballot tools and prices

- [Ballotpedia · Ballot for date](https://spiral.ai/tools/alexandria/ballotpedia-org/districts/ballot_for_date) (Alexandria): $0.00873 per call.

## What can you do with Ballotpedia sample ballot in VS Code?

Build a civic lookup that connects public addresses to Ballotpedia districts, ballots, candidates, and serving officials. Use the returned geography and election dates to keep each screen tied to a specific place and contest.

### Public library ballot guide

Start with a library's public address, identify its districts, and build an election-date guide with races, candidate background, and explanations of listed measures.

### Newsroom election assignment brief

Use city hall as a geographic reference for local contests, add statewide races, and prepare candidate and measure research alongside recent Ballotpedia reporting.

### Civics classroom comparison

Use a state capitol's address to compare current representatives with candidates on a dated ballot. Explain district geography, statewide contests, and the measures students encounter.

### Municipal civic information kiosk

Build a civic reference centered on a public facility's address, showing districts, serving officials, a selected election ballot, and links to recent election reporting.

### Local ballot measure explainer

Identify proposals on a location's dated ballot, connect each to its district, and explain the measure using its details and relevant Ballotpedia News coverage.

## Overview

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

## Ballotpedia sample ballot in other agents

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

## More VS Code guides

- [Ballotpedia political districts](https://spiral.ai/integrations/vscode/ballotpedia-political-districts)
- [Ballotpedia statewide races](https://spiral.ai/integrations/vscode/ballotpedia-statewide-races)
- [Ballotpedia election news](https://spiral.ai/integrations/vscode/ballotpedia-election-news)
- [Better Business Bureau Complaints](https://spiral.ai/integrations/vscode/better-business-bureau-complaints)
- [Ballotpedia current representatives](https://spiral.ai/integrations/vscode/ballotpedia-current-representatives)
- [Better Business Bureau Profile](https://spiral.ai/integrations/vscode/better-business-bureau-profile)

## Questions about Ballotpedia sample ballot in VS Code

**Can VS Code use Ballotpedia sample ballot?**

Yes. Add Spiral to VS Code as an MCP server, and VS Code can find and run Ballotpedia sample ballot like any built-in tool.

**How much does Ballotpedia sample ballot cost in VS Code?**

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

**Do I need an Alexandria account to use Ballotpedia sample ballot in VS Code?**

No. Spiral runs Ballotpedia sample ballot on its own Alexandria account. You sign in to Spiral once and never paste a key.

**How long does it take to set up Ballotpedia sample ballot in VS Code?**

About two minutes: add the hosted server, then sign in.

**Does VS Code wait while Ballotpedia sample ballot runs?**

Ballotpedia sample ballot runs in the background. VS Code starts the run, checks on it and gives you the json when it's ready.

**Does Ballotpedia cover every local election?**

Local coverage is not universal. Ballotpedia identifies the top 100 cities by population as a core coverage area and expands coverage beyond those cities.

**How soon do official candidate lists appear?**

For federal and statewide races, Ballotpedia says it updates candidate lists within a week after a state publishes its official list. That timing starts at publication, which can occur after the filing deadline.

**Why can election districts differ from current representation?**

Ballotpedia tracks boundary effective dates around office terms, including swearing-in dates. It documents a 2022 California example where a special election and a regular election on the same day used different congressional boundaries.

**Can a race be absent from Ballotpedia's election data?**

Yes. The geographic election documentation explicitly says that races with no official candidates are omitted, so an absent race does not establish that the office has no election.

**Can Ballotpedia data appear in a public application?**

Its data terms allow use in internal or external products with precautions against third-party bulk downloads. They do not grant permission to redistribute the full datasets.

