Replacing the Sunset Google Civic API with 33,791 Offline Census ZCTAs (and a CC0 USCIS Dataset)
While building CivicsTutor, a free multilingual study app for the U.S. naturalization test, I ran into two practical data problems that took longer to clean up than expected.
First, USCIS introduced the 2025 civics test (128 questions) for Form N-400 filings on or after October 20, 2025, while earlier filers still take the 2008 100-question version. Official study lists come as PDFs, and I could not find a clean, schema-validated JSON or CSV release of the 128-question bank on GitHub.
Second, one of the required interview questions is "Name your U.S. Representative." Google shut down the Civic Information API Representatives endpoint, so looking up a representative by 5-digit ZIP code offline meant going straight to U.S. Census Bureau relationship files.
Cleaning GIS slivers out of 33,791 U.S. ZIP codes
The Census Bureau's 2020 ZCTA5-to-119th-Congress relationship table covers 33,791 five-digit ZIP Code Tabulation Areas across 435 House seats and 6 delegates.
If you keep every row where a ZCTA polygon touches a congressional district boundary, thousands of normal residential ZIP codes show up as split districts because of tiny GIS overlap slivers (well under 1% of land area).
Here is the cleanup I ended up using:
- Compute each district's share of the ZCTA land area (
AREALAND_PART / AREALAND_ZCTA5_20). - Drop overlaps below 1% (while always keeping the largest overlap if every slice is small).
- Sort remaining districts from largest land share to smallest.
After filtering slivers, the 33,791 ZCTAs split cleanly into 28,670 single-district ZIPs and 5,121 real split-district ZIPs (like 90012 in Los Angeles or 10003 in New York). For split ZIPs, the app lists every matching representative and links directly to House.gov for street-address confirmation.
Open-sourcing the full dataset (CC0-1.0)
I packaged all six datasets into a standalone repo with zero runtime dependencies:
GitHub (CC0-1.0 data / MIT scripts): ByKite/uscis-civics-test-dataset
It includes:
- The 2025 USCIS civics bank (128 questions, Form M-1778) and the 2008 bank (100 questions), with 65/20 starred flags and dynamic-office tags.
- Current federal, state, D.C., territory, Senate, and 119th Congress rosters, plus upcoming office transition dates (Dec 7, 2026 AK/HI governors and Jan 3, 2027 120th Congress).
- All 33,791 ZCTA5-to-district mappings in JSON and RFC 4180 CSV.
- The official USCIS reading (64 words) and writing (75 words) vocabularies, 50 original practice sentences checked word-for-word against those lists, and 40 N-400 legal terms.
- JSON Schema Draft 2020-12 files, Frictionless
datapackage.json,SHA256SUMS.txt, zero-dependency Node/Python lookup examples, and a weekly GitHub Action to flag officeholder changes.
All 43,591 validation checks run in GitHub Actions on every push.
Live tools built on top of it
If you want to test the lookup or study tools directly (free and ad-free in 17 languages):
- ZIP Representative Lookup: civicstutor.com/en/who-is-my-representative
- Current Officials Table: civicstutor.com/en/current-us-officials-answers
- 2025 / 2008 Practice Test: civicstutor.com/en/citizenship-practice-test
- Machine-readable reference: civicstutor.com/llms.txt and /llms-full.txt
Independent study project, not affiliated with USCIS or DHS. Applicants should always double-check current officeholders on uscis.gov/citizenship/testupdates before their interview.
Feel free to reuse the CC0 JSON/CSV files in your own civic-tech or study tools, and open an issue if you catch an edge-case ZIP.