Spiral gives your agent every tool with one account. Browse the tools →

opencode · Maps & Reviews

How to Use Ballotpedia statewide races in opencode

Returns statewide race and candidate information, including party and incumbency. Use it to research a governor or U.S. Senate contest without assembling a location's full ballot.

Prompts to try with Ballotpedia statewide races in opencode

Copy an example into opencode, or ask in your own words.

Use Ballotpedia statewide races for Wisconsin on November 5, 2024, and add a comparison table of the U.S. Senate candidates, parties, and incumbency to our election page.

Ballotpedia statewide racesopencode
Try asking
  • Use Ballotpedia statewide races to look this up and give me the result as a table. Save the result in ./assets.

  • Pull the latest numbers from Ballotpedia statewide races and tell me what changed since last week.

  • Check Ballotpedia statewide races and summarize what you find in three bullet points.

  • Pull the newest data from Ballotpedia statewide races and give me the result as a table.

How to set up Ballotpedia statewide races in opencode

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

Use Spiral's MCP server

  1. Add the server

    Leave out --global to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

    opencode mcp add spiral --global --url https://api.spiral.ai/mcp
  2. Sign in

    Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, /mcps starts the same sign-in.

    opencode mcp auth spiral
  3. Check it

    Spiral shows as connected.

    opencode mcp list

Use the Spiral skill

  1. Send opencode 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.

    npx -y spiral-cli@latest init

Call the Spiral API

  1. Create an API key

    In the console, under API keys.

  2. Run Ballotpedia statewide races

    One request; the result comes back by polling or a webhook.

    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/statewide_races",
        "input": {
          "state": "<state>"
        }
      }'

Then paste one of the prompts above: opencode finds Ballotpedia statewide races on Spiral, shows the price and runs it.

Ballotpedia statewide races providers and prices

Spiral runs Ballotpedia statewide races through Alexandria. Open a card for today's price, with every fee included.

AlexandriaMaps & Reviews
Ballotpedia · Statewide races
ballotpedia-org/districts/statewide_races

What can you do with Ballotpedia statewide races in opencode?

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.

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.

State election briefing

Prepare a briefing on statewide contests with candidate background, explanations of relevant ballot measures, and links to Ballotpedia's published analysis.

Government transition watch

Compare statewide election candidates with officials currently serving a fixed public location. Use candidate background and recent reporting to explain changes during the transition.

Questions about Ballotpedia statewide races in opencode

Can opencode use Ballotpedia statewide races?

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Ballotpedia statewide races like any built-in tool.

How much does Ballotpedia statewide races cost in opencode?

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

Do I need an Alexandria account to use Ballotpedia statewide races in opencode?

No. Spiral runs Ballotpedia statewide races 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 statewide races in opencode?

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

Does opencode wait while Ballotpedia statewide races runs?

Ballotpedia statewide races runs in the background. opencode 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.

Get started

Start using Ballotpedia statewide races in opencode

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into opencode:

Set up opencode

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options