[CIV.IQ]
CIV.IQ
Civic intelligence from government sources, organized for public use.
civdotiq.org •
API Reference •
Contribute •
License
[CI status]
[License: Apache-2.0]
[@civiq/sdk on npm]
[A CIV.IQ representative profile on civdotiq.org: Senator Gary C. Peters of Michigan, with party, current term, next election, contact details, and counts of roll-call votes, sponsored bills, money raised and committees.]
What this is
A civic intelligence platform. Enter an address to find your federal and state representatives, with voting records, federal campaign finance, committee assignments, legislative activity, and machine-learning-powered analysis of money-in-politics patterns. Local (city/county) government: not covered. Local records lack a shared standard or central source; CIV.IQ intends to add them only once a verified public source exists.
Data comes from official government records. Most are read straight from the agency's API or bulk files; some are read through named open datasets, such as OpenStates for state legislatures and the Congress Trading Monitor for parsed STOCK Act filings. All analysis is statistical, with confidence scores and methodology disclosed. If data is unavailable, the interface and the response payload say so explicitly. Nothing is fabricated.
Honest coverage matrix: docs/COVERAGE.md. It is the canonical answer to "what does CIV.IQ actually cover?" — every other claim in this README defers to that page.
What it does
Representatives: Federal and state legislators with photos, contact info, committee assignments, and voting records.
Campaign Finance: Federal only — FEC contributions, PAC spending, expenditure tracking, and donor sector analysis. State campaign finance is not currently available (FollowTheMoney.org is in maintenance mode during the OpenSecrets merger).
Intelligence Layer: Statistical analyzers that cross-reference voting records with campaign finance, lobbying filings, stock trades, and committee jurisdictions to surface patterns of potential influence. Every insight carries a confidence score, methodology note, and correlation-not-causation disclaimer.
Money Report: Address-based lookup that traces the path from campaign contributions through committee assignments to legislative outcomes for your specific representatives.
Regulations & Comment Periods: Federal Register integration for proposed rules, final rules, executive orders, and open public comment periods.
State Legislatures: All 50 states via OpenStates — legislators, bills, committees, and calendars. Per-legislator vote history is in progress. Interactive district boundary maps for all 7,383 state legislative districts. State-level campaign finance, lobbying, and stock-trade data are not part of state coverage.
Local Government: Not covered (city/county). Local records lack a shared standard or central source; CIV.IQ intends to add them only once a verified public source exists.
District Intelligence: Demographics, economic indicators (BLS employment data), federal spending (USASpending), infrastructure metrics, and bills ranked by relevance to each congressional district.
Nostr Publishing: Civic events (new bills, votes, hearings) are signed and published to the Nostr network for decentralized, verifiable distribution.
Developer integrations
Data sources
The table lists the primary sources. Other federal agency datasets (CDC PLACES, CMS, FEMA, FBI, FDIC, VA, Treasury, CFPB, NHTSA, EPA, College Scorecard, and more) power district and intelligence features. In total CIV.IQ reads 40 data sources: 29 government and 11 open datasets. The full list and the counting rule are in docs/COVERAGE.md.
No data is fabricated or generated. When a source is unavailable, the response says so.
Setup
Add API keys to .env.local. All are free:
See .env.example for the full list, including Nostr publishing and ActivityPub federation.
Verify at localhost:3000/api/health.
Structure
Stack
Next.js 16, React 18, TypeScript (strict), Tailwind CSS, SWR, Zustand, MapLibre GL, D3.js, Recharts, Redis (Upstash + ioredis), Zod, simple-statistics, HuggingFace Transformers (small models), Google Gemini AI, nostr-tools.
Intelligence layer
17 statistical analyzers cross-reference the federal data domains:
One more analyzer, the regulation analyzer, is in the code but not listed because nothing calls it.
Every insight carries: confidence score (0–1), data-as-of timestamp, methodology description, and a disclaimer that correlation does not imply causation.
ML pipeline
All models are small and run server-side through HuggingFace Transformers. Setting CIVIQ_ML_PIPELINES=off disables them.
- Text similarity: all-MiniLM-L6-v2 embeddings for bill-to-lobbying matching and bill sector classification
- Classification: nli-deberta-v3-xsmall for zero-shot bill sector classification
- Named entity recognition: distilbert-NER (ONNX) for extracting entities from Federal Register preambles
- Influence clusters: Offline Python computation (
scripts/compute-influence-clusters.py) served as JSON
Open-source packages
Three packages are extracted as standalone npm workspace packages:
- @civiq/sdk — TypeScript API client with 33 typed methods across 9 resources, error hierarchy, custom fetch injection
- @civiq/civic-statistics — Confidence scoring, peer comparison, correlation (Spearman/Pearson), anomaly detection, sample size enforcement
- @civiq/entity-resolution — Committee alias resolution, ticker-to-industry mapping, FEC recipient deduplication
Commands
Additional scripts for performance benchmarking, data/ML processing, and security scanning are defined in package.json.
Contributing
See CONTRIBUTING.md.
License
Apache License 2.0. Copyright 2019-2026 Mark Sandford.
Use it, modify it, distribute it. Include the copyright, license, and NOTICE file per Apache 2.0 Section 4. Credit is appreciated but not required: "Powered by CIV.IQ." The government data the API serves is in the public domain. The @civiq/* npm packages are MIT. The CIV.IQ name and logo are trademarks and require written permission to use. See LICENSE and NOTICE.
Mark Sandford - [email protected]