Skip to content

feat: add civic data sources for local elections#85

Open
ThatXliner wants to merge 9 commits into
mainfrom
feat/civic-data-sources
Open

feat: add civic data sources for local elections#85
ThatXliner wants to merge 9 commits into
mainfrom
feat/civic-data-sources

Conversation

@ThatXliner
Copy link
Copy Markdown
Collaborator

@ThatXliner ThatXliner commented May 27, 2026

Summary

  • Google Civic Information API — elections, polling locations, representatives
  • CA Secretary of State API — election results, contests, county breakdowns
  • Open States API — California state bills, legislators, votes
  • Legistar API — San Jose, Santa Clara County, Sunnyvale local legislation
  • VOTE411 scraper — nonpartisan voter guides (Cheerio + Playwright)
  • Santa Clara County ROV scraper — ballots, polling, candidates

⚠️ New Environment Variables Required

Add these to your deployment environment (Vercel, etc.):

Variable Required How to get
GOOGLE_CIVIC_API_KEY Yes Google Cloud Console — free, 25k/day
OPEN_STATES_API_KEY Yes Open States — free
CA_SOS_API_KEY No CA SOS portal (API not publicly available yet)

See docs/CIVIC_DATA_SOURCES.md for detailed setup instructions.

Test plan

  • Verify tRPC routes compile
  • Test Google Civic API with real address
  • Test Legistar API (no key needed)
  • Run VOTE411 scraper

🤖 Generated with Claude Code

ThatXliner and others added 8 commits May 26, 2026 22:25
Elections, polling locations, representatives, voter info by address.
Includes tRPC router with enriched representative data.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
All 58 CA counties, contests, results, county breakdowns.
Gracefully returns null/[] when CA_SOS_API_KEY not configured.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Bills, legislators, votes, sessions for California legislature.
Requires OPEN_STATES_API_KEY env var.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
San Jose, Santa Clara County, Sunnyvale support.
Meetings, bills, votes, agendas — no API key needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Cheerio scraper for static voter guides and forums.
Playwright scraper for address-based ballot lookup.
Includes caching and rate limiting.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Polling locations, sample ballots, election calendar, candidates.
Uses Google Civic API (county site has Cloudflare protection).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
API key instructions for Google Civic, Open States, CA SOS.
Documents all scrapers and their data coverage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Register new routers in root.ts, export types from index.
Add env vars to .env.example and turbo.json.
Register scrapers in main.ts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
billion-nextjs Ready Ready Preview, Comment May 27, 2026 5:30am

Fix prettier formatting, change Array<T> to T[] syntax.
Add OPEN_STATES_API_KEY to turbo.json globalEnv.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant