# CIV.IQ — Full API Documentation for LLMs > Civic intelligence platform providing normalized U.S. government data through open REST APIs. > No API key required. Real government data only — never mock or fabricated. > Fills the vacuum left by ProPublica Congress API, Google Civic Info API, and OpenSecrets API shutdowns. ## Base URLs - Base URL: `https://civdotiq.org/api` - Versioned: `https://civdotiq.org/api/v1` - OpenAPI 3.0 spec: `https://civdotiq.org/openapi.json` ### Stable API vs internal routes - `/api/v1/` is the stable, versioned API. It is the only `/api/` path robots.txt allows. - Every other `/api/` path documented below is an internal route behind the site's own pages. These routes are unversioned and can change without notice. robots.txt disallows them, so agents that respect robots.txt (for example Claude-User or Perplexity-User) can't fetch them. - For anything `/api/v1` doesn't cover, use the MCP server (`https://civdotiq.org/api/mcp`, see "MCP Server" below): - Address lookup: `lookup_representatives` - Voting records: `get_voting_history` - Campaign finance: `get_campaign_finance` - Lobbying: `search_lobbying` - Bill search: `search_legislation` - The web pages listed under "Web Pages" are server-rendered. A plain fetch returns the full content. ## Rate Limiting - 60 requests/minute per IP address on `/api/v1/` - Responses carry the IETF standard headers: `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` (delta seconds), and `RateLimit-Policy` (e.g. `60;w=60`) - Legacy `X-RateLimit-Limit` / `X-RateLimit-Remaining` / `X-RateLimit-Reset` (Unix ms) are also sent for older consumers - 429 responses include `Retry-After` (seconds) ## Versioning & Deprecation Policy - The API is versioned in the URL path (`/api/v1`); every response carries `X-API-Version` - Additive changes ship within v1 and are recorded at `GET /api/v1/changelog` - Breaking changes only ship as a new URL version; a retiring version will send `Deprecation` and `Sunset` headers (RFC 8594) plus `Link rel="successor-version"` at least 6 months before shutdown - No version is currently deprecated; no sunset is scheduled for v1 ## Data Freshness - Representatives: cached 24 hours, sourced from congress-legislators YAML - Votes: cached 1 hour (House via Congress.gov API, Senate via XML feeds) - Campaign finance: cached 24 hours, sourced from FEC.gov API - Bills: cached 6 hours, sourced from Congress.gov API v3 - Lobbying: cached 24 hours, sourced from Senate LDA API - Intelligence insights: cached 7 days, recomputed on demand - State legislators: Open States people data, mirrored into the repo and refreshed weekly --- ## Web Pages Server-rendered HTML, listed in `https://civdotiq.org/sitemap.xml` and `https://civdotiq.org/sitemap-state-legislators.xml`. State codes in page paths are lowercase. Congressional district IDs are uppercase. | Page | What it shows | Example | |------|---------------|---------| | `/your-reps` | Address lookup: members of Congress and state legislators for a street address | `/your-reps` | | `/representative/{bioguideId}` | Member of Congress: phone, DC office, contact form or website, votes, bills, campaign finance | `/representative/T000481` | | `/state-legislature/{state}` | "Who is my state representative in [State]?": every state legislator by chamber, with district, party and phone | `/state-legislature/mi` | | `/state-legislature/{state}/legislator/{name}-{id}` | State legislator: phone, email, capitol office, district | `/state-legislature/mi/legislator/winnie-brinks-de38477b` | | `/states/{state}` | State overview: governor, congressional delegation, legislature party split, Census demographics | `/states/mi` | | `/districts/{ST-NN}` | Congressional district: member, demographics, economy. At-large seats use `AL` | `/districts/MI-12`, `/districts/AK-AL` | | `/state-districts/{state}/{upper\|lower}/{district}` | State legislative district: members and population | `/state-districts/mi/upper/8` | | `/bill/{congress}-{type}-{number}` | Bill status, sponsors, actions, summary | `/bill/119-hr-1` | | `/vote/{chamber}-{congress}-{session}-{rollNumber}` | Roll-call vote | `/vote/senate-119-2-1` | | `/ask/{question}/{entityId}` | Question pages. Members (`{bioguideId}`): `voting-record`, `bills-sponsored`, `campaign-contributions`, `donor-voting-alignment`, `contact-info`, `stock-trades`. Committees (`{committeeId}`): `committee-members`, `committee-activity`, `committee-lobbying`. Policy areas (`{topic}`): `topic-bills` | `/ask/voting-record/T000481`, `/ask/committee-members/HSAG`, `/ask/topic-bills/health` | Unknown member, legislator, state, district and bill IDs return HTTP 404. --- ## Representatives ### GET /api/v1/representatives List all current members of Congress with optional filtering. **Parameters:** - `chamber` (string, optional): "house" or "senate" - `state` (string, optional): two-letter state code, e.g. "MI" - `party` (string, optional): "D", "R", or "I" - `limit` (integer, optional): results per page, default 100, max 600 (every current member fits in one request) - `offset` (integer, optional): pagination offset, default 0 **Example:** `GET /api/v1/representatives?state=CA&chamber=house&limit=10` **Response shape:** ```json { "data": [ { "bioguideId": "P000197", "name": "Nancy Pelosi", "party": "Democrat", "state": "CA", "district": "11", "chamber": "house", "imageUrl": "string", "phone": "string", "website": "string" } ], "pagination": { "total": 435, "limit": 10, "offset": 0, "hasMore": true } } ``` ### GET /api/v1/representatives/{bioguideId} Get detailed info for a specific member of Congress. **Path parameter:** `bioguideId` — Congress bioguide identifier (e.g., "P000197") **Response shape:** ```json { "data": { "bioguideId": "string", "name": "string", "party": "string", "state": "string", "district": "string", "chamber": "house|senate", "imageUrl": "string", "office": "string", "phone": "string", "website": "string", "socialMedia": { "twitter": "string", "facebook": "string" }, "committees": [{ "name": "string", "role": "string" }], "termStart": "string", "termEnd": "string", "nextElection": "string" } } ``` ### GET /api/representative/{bioguideId}/votes Voting record for a specific legislator. **Parameters:** - `bioguideId` (path): Congress bioguide identifier - `limit` (query, optional): number of records, default 20, max 50 **Data sources:** House via Congress.gov API, Senate via official XML feeds. **Response shape:** ```json { "votes": [ { "voteId": "string", "bill": { "number": "string", "title": "string", "congress": "string", "type": "string" }, "question": "string", "result": "string", "date": "string", "position": "Yea|Nay|Present|Not Voting", "chamber": "House|Senate", "category": "Budget|Healthcare|Defense|Judiciary|Foreign Affairs|Other", "isKeyVote": true } ], "totalResults": 150 } ``` ### GET /api/representative/{bioguideId}/finance FEC campaign finance data for a legislator. **Parameters:** - `bioguideId` (path): Congress bioguide identifier - `cycle` (query, optional): election cycle year, default current **Data source:** FEC.gov API via bioguide-to-FEC ID mapping. **Response shape:** ```json { "totalRaised": 5000000, "totalSpent": 4200000, "cashOnHand": 800000, "individualContributions": 3500000, "pacContributions": 1200000, "industryBreakdown": [ { "industry": "Finance/Insurance/Real Estate", "amount": 500000, "percentage": 10 } ], "geographicBreakdown": [ { "state": "CA", "amount": 2000000, "percentage": 40 } ] } ``` ### POST /api/intelligence/address/representatives Find representatives by full street address (resolves exact congressional district via Census Geocoder). **Request body (JSON):** ```json { "street": "123 Main St", "city": "Detroit", "state": "MI", "zip": "48201" } ``` **Response shape:** ```json { "district": "MI-13", "representatives": [{ "bioguideId": "string", "name": "string", "party": "string", "district": "string" }], "senators": [{ "bioguideId": "string", "name": "string", "party": "string" }] } ``` --- ## Bills & Legislation ### GET /api/v1/bills List recent bills in the current Congress. **Parameters:** - `sort` (string, optional): `updateDate+desc` (default), `updateDate+asc`, `number+desc`, `number+asc` - `limit` (integer, optional): default 50, max 250 - `offset` (integer, optional): pagination offset **Example:** `GET /api/v1/bills?sort=updateDate+desc&limit=5` For keyword search across bills (and representatives, committees), use `GET /api/search/unified?q=healthcare` instead. **Response shape:** ```json { "data": [ { "billId": "hr1-119", "number": "H.R.1", "title": "string", "sponsor": { "bioguideId": "string", "name": "string", "party": "string" }, "introducedDate": "2025-01-15", "status": "string", "policyArea": "string", "cosponsorsCount": 42 } ], "pagination": { "total": 100, "limit": 5, "offset": 0 } } ``` ### GET /api/bill/{billId} Detailed information about a specific bill. **Path parameter:** `billId` — e.g., "hr1-119" for H.R.1 in 119th Congress **Response shape:** ```json { "billId": "string", "number": "string", "title": "string", "summary": "string", "sponsor": { "bioguideId": "string", "name": "string", "party": "string", "state": "string" }, "cosponsors": [{ "bioguideId": "string", "name": "string" }], "introducedDate": "string", "committees": [{ "name": "string", "referralDate": "string" }], "actions": [{ "date": "string", "text": "string", "type": "string" }], "policyArea": "string", "subjects": ["string"] } ``` --- ## Committees ### GET /api/v1/committees List all congressional committees. **Parameters:** - `chamber` (string, optional): "house", "senate", or "joint" **Response shape:** ```json { "data": [ { "committeeId": "HSIF", "name": "Energy and Commerce Committee", "chamber": "house", "chair": { "bioguideId": "string", "name": "string" }, "memberCount": 55 } ] } ``` ### GET /api/committee/{committeeId} Detailed committee information. **Path parameter:** `committeeId` — e.g., "HSIF" **Response shape:** ```json { "committeeId": "string", "name": "string", "chamber": "house|senate|joint", "jurisdiction": "string", "chair": { "bioguideId": "string", "name": "string", "party": "string" }, "rankingMember": { "bioguideId": "string", "name": "string" }, "members": [{ "bioguideId": "string", "name": "string", "role": "string" }], "subcommittees": [{ "id": "string", "name": "string" }] } ``` --- ## Campaign Finance (FEC) ### GET /api/fec/contributions-by-employer?candidateId={candidateId} Itemized individual contributions to a candidate, grouped by contributor employer. **Parameters:** - `candidateId` (string, required): FEC candidate ID (e.g. `H8CA05035`) - `cycle` (integer, optional): two-year election cycle; defaults to the current cycle - `limit` (integer, optional): 1-100, default 25 ### GET /api/fec/contributions-by-size?candidateId={candidateId} Individual contributions to a candidate, bucketed by contribution size. **Parameters:** - `candidateId` (string, required): FEC candidate ID - `cycle` (integer, optional): two-year election cycle; defaults to the current cycle --- ## Lobbying (Senate LDA) ### GET /api/representative/{bioguideId}/lobbying Lobbying filings related to a legislator's committees. **Response shape:** ```json { "filings": [ { "filingId": "string", "registrant": "string", "client": "string", "amount": 500000, "issues": ["Healthcare", "Budget"], "period": "2025-Q1" } ] } ``` --- ## Federal Spending (USASpending) ### GET /api/spending/district/{districtId} Federal contracts and grants with a place of performance in a congressional district, current fiscal year. **Parameters:** - `districtId` (path): state and district, e.g. `MI-12` --- ## Federal Register ### GET /api/federal-register Search Federal Register documents. **Parameters:** - `query` (string, optional): search term - `type` (string, optional): "rule", "proposed_rule", "notice", "presidential_document" - `agency` (string, optional): agency name - `limit` (integer, optional): default 20 **Response shape:** ```json { "results": [ { "documentNumber": "string", "title": "string", "type": "Rule", "agency": "string", "publicationDate": "2025-03-01", "abstractText": "string", "htmlUrl": "string" } ] } ``` --- ## Districts ### GET /api/districts/{districtId} Comprehensive district information. **Path parameter:** `districtId` — e.g., "CA-12", "MI-07" **Response shape:** ```json { "districtId": "CA-12", "state": "California", "number": "12", "representative": { "bioguideId": "string", "name": "string", "party": "string" }, "demographics": { "population": 760000, "medianAge": 38.5, "medianIncome": 85000, "raceEthnicity": { "white": 45, "black": 12, "hispanic": 25, "asian": 15 }, "education": { "bachelors": 35, "graduate": 18 } }, "geography": { "counties": ["string"], "majorCities": ["string"], "centroid": [37.7749, -122.4194] } } ``` ### GET /api/districts/{districtId}/economic-profile Economic and infrastructure data. **Data sources:** BLS (employment), FCC (broadband), Census (demographics). ### GET /api/districts/{districtId}/services-health Education, healthcare, and public health data. --- ## Intelligence & Analysis Statistical analysis endpoints. All insights carry: confidence (0-1), dataAsOf, methodology, disclaimer. ### GET /api/intelligence/representative/{bioguideId}/influence-chain Association chains for one legislator: an organization lobbied the member's committees, people who list that organization as their employer gave to the member's campaign (FEC itemized contributions aggregated by employer), and the member voted on bills in the sectors the organization lobbied on. Patterns, not causation. Returns 404 when no chain reaches 0.5 confidence, for example a member with no committee seats. **Response shape:** ```json { "bioguideId": "C001035", "chains": [ { "organization": "GENERAL DYNAMICS", "registrantId": "string (optional)", "lobbyingSpending": 500000, "contributionAmount": 26287, "billId": "HR7008-119", "billTitle": "string", "vote": "yea | nay | not_voting", "textSimilarity": null, "links": [{ "type": "lobbying | contribution | committee | bill_match | vote", "label": "string", "confidence": 0.9, "data": {} }], "chainConfidence": 0.7, "hasContributionEvidence": true } ], "totalChainsDetected": 276, "chainsDropped": 266, "peerComparison": null, "peerComparisonUnavailableReason": "string (when peerComparison is null)", "narrative": "string", "confidence": 0.6, "dataAsOf": "ISO date", "methodology": "string", "disclaimer": "string", "sources": [{ "name": "string", "coverage": "string", "recordCount": 200 }], "errors": [], "status": "complete | partial" } ``` ### GET /api/intelligence/representative/{bioguideId}/finance-jurisdiction Overlap between campaign donors' industry sectors and committee jurisdictions. ### GET /api/intelligence/representative/{bioguideId}/vote-finance Correlation between campaign donors (by sector) and voting record. ### GET /api/intelligence/representative/{bioguideId}/temporal Party-line voting alignment per calendar quarter of the current Congress, computed from every roll call in the chamber. Flags quarters more than 10 percentage points from the trailing 4-quarter average and compares overall alignment with other members of the same party in the chamber. Needs at least 4 quarters of votes; returns 404 for independents or when the roll-call corpus is incomplete, 503 if the analysis times out. **Response shape:** ```json { "bioguideId": "P000197", "quarters": [ { "quarter": "2025-Q1", "alignmentScore": 1, "voteCount": 51, "rollingAverage": null } ], "shifts": [], "overallTrend": "stable", "peerComparison": { "value": 0.992, "peerAverage": 0.964, "peerCount": 222, "peerGroupLabel": "other House Democrats", "percentileRank": 99 }, "narrative": "string", "confidence": 1, "dataAsOf": "2026-09-16T19:05:00-04:00", "methodology": "string", "disclaimer": "string" } ``` ### GET /api/intelligence/committee/{committeeId} Lobbying pipeline for a committee: lobbying expenditures to committee activity to legislative output. `committeeId` is the committee code, e.g. `HSAG`. ### GET /api/intelligence/representative/{bioguideId}/stock-trades Stock trades in sectors regulated by the legislator's committees. House members only; returns 404 when a member has too few trades or committee seats to analyze. ### GET /api/intelligence/bill/{billId} Sponsor/cosponsor funding analysis and related lobbying for a bill. ### GET /api/intelligence/sector/{sector}/leaderboard House members' yes-vote rates on bills classified to an industry sector: yea votes / (yea + nay votes) on recent House roll calls, as a 0-1 fraction. Every included member is returned, ordered by state then name; there is no rank and no dollar figure. `stats.mean` is the House average to compare against. Members with fewer than 10 such votes are excluded. House only: senators are not covered. Rates describe voting patterns, not support for or opposition to the industry. **Parameters:** - `sector` (path): industry sector slug, e.g. `defense`, `health`, `finance-insurance-real-estate` - `party` (query, optional): "D", "R", or "I" - `limit` (query, optional): cap on entries; omit for all ### POST /api/intelligence/address/money-report Money-in-politics report card for representatives at a given address. **Body:** `{ "address": "123 Main St, Detroit, MI 48201" }` ### GET /api/intelligence/address/money-report?zip={zip} Money-in-politics report card by ZIP code. --- ## Party Alignment ### GET /api/representative/{bioguideId}/party-alignment How often a legislator votes with their party. **Response shape:** ```json { "alignment": { "withParty": 145, "againstParty": 12, "percentage": 92.4 }, "comparison": { "partyAverage": 89.1, "chamberAverage": 85.3 }, "notableVotes": [{ "billNumber": "string", "title": "string", "memberVote": "Nay", "partyMajority": "Yea" }] } ``` --- ## State Government ### GET /api/state-legislature/{state} State legislators from the Open States people data, mirrored into the repo and refreshed weekly (no live upstream call). ### GET /api/state-bills/{state} State legislation search. ### GET /api/state-executives/{state} Governor and state executives via Wikidata SPARQL. ### GET /api/state-judiciary/{state} State supreme court justices. --- ## Search ### GET /api/search?q={query} Unified search across representatives, bills, committees, and districts. --- ## Comparison ### GET /api/compare?bioguideId={bioguideId} One side of a side-by-side comparison: roll-call totals and party alignment from chamber baselines, plus current-Congress and career sponsored/enacted/cosponsored counts from the record-card rollup. Call once per official. Sections that cannot be computed are null, never zero. Campaign finance lives at /api/representative/{bioguideId}/finance. --- ## Graph Network ### GET /api/graph/neighbors/{nodeId} Civic knowledge graph — find related entities (legislators, bills, committees, organizations). --- ## MCP Server (Model Context Protocol) CIV.IQ provides a Model Context Protocol server for AI assistant integration. **Endpoint:** `https://civdotiq.org/api/mcp` (`https://civdotiq.org/mcp` accepts the same protocol traffic) **Transport:** Streamable HTTP (POST for messages) **Manifest:** `https://civdotiq.org/.well-known/mcp.json` (MCP registry server.json format) ### Tools (46, all read-only) By domain: - **Representatives:** `lookup_representatives` (full street address — not ZIP; returns US Senators, House member and every state legislator), `list_state_delegation`, `get_representative_profile`, `compare_legislators` - **Legislation:** `search_legislation`, `get_bill_details`, `get_voting_history`, `get_vote_record` - **Finance:** `get_campaign_finance`, `search_lobbying`, `get_federal_spending` - **Intelligence:** `get_influence_chain`, `analyze_district_comprehensive`, `analyze_industry_regulatory_landscape`, `analyze_policy_area_ecosystem` - **Civic:** `get_committee_info`, `get_federal_register`, `get_district_info` - **Environment:** `search_epa_facilities`, `get_district_environmental_profile`, `analyze_environmental_influence`, `get_climate_data`, `get_state_climate_profile` - **Safety:** `search_fema_disasters`, `get_district_disaster_history`, `search_crime_statistics`, `get_state_public_safety_profile`, `search_consumer_complaints`, `get_district_consumer_complaints`, `analyze_consumer_protection_influence`, `get_housing_affordability`, `get_district_housing_profile`, `search_vehicle_recalls`, `search_vehicle_complaints` - **Health:** `search_healthcare_providers`, `get_district_healthcare_profile` - **Economy:** `get_state_energy_profile`, `analyze_energy_policy_influence`, `search_colleges`, `get_district_education_profile`, `search_nih_grants`, `get_district_research_profile`, `search_fdic_institutions`, `get_district_banking_profile`, `get_federal_fiscal_data`, `get_federal_debt_context` ### Resources Static doc resources (returned by `resources/list`): | URI | Description | |-----|-------------| | `civiq://docs/when-to-use` | When an agent should (and should not) use CIV.IQ | | `civiq://docs/api-quickstart` | REST quick start: base URL, rate limits, error shape | | `civiq://docs/versioning-policy` | Versioning, deprecation, and sunset policy | Resource templates (returned by `resources/templates/list`): | URI Pattern | Description | |-------------|-------------| | `civiq://legislators/{bioguideId}` | Representative profile JSON | | `civiq://bills/{congress}/{type}/{number}` | Bill detail JSON | | `civiq://districts/{stateCode}/{districtNumber}` | District info JSON | | `civiq://districts/{stateCode}/{districtNumber}/environment` | District environment profile | | `civiq://districts/{stateCode}/{districtNumber}/health` | District health profile | | `civiq://districts/{stateCode}/{districtNumber}/safety` | District safety profile | | `civiq://districts/{stateCode}/{districtNumber}/economy` | District economy profile | ### Prompts (6) | Prompt | Description | |--------|-------------| | `legislator_accountability` | Finance + voting + committee data combined | | `bill_impact_analysis` | Bill details + sponsor funding + lobbying | | `policy_comparison` | Cross-legislator position comparison | | `district_deep_dive` | Full district profile across all data domains | | `environmental_justice` | Environment + demographics + policy influence | | `industry_investigation` | Industry lobbying + finance + regulatory landscape | --- ## Common Response Patterns ### Error responses `/api/v1/` endpoints return errors in the v1 envelope (also documented as the `V1Error` schema in the OpenAPI spec): ```json { "error": { "code": 404, "message": "Human-readable error message", "details": "Optional technical detail and where to look next" }, "meta": { "apiVersion": "v1", "timestamp": "2026-08-21T00:00:00Z", "source": "error", "license": "Public Domain", "documentation": "https://civdotiq.org/docs/api" } } ``` Non-v1 `/api/` endpoints use a string error code: ```json { "success": false, "error": { "code": "NOT_FOUND", "message": "Human-readable error message", "details": "Optional technical detail" }, "metadata": { "timestamp": "2026-08-21T00:00:00Z" } } ``` Unknown API paths return one of these JSON shapes with status 404 — never an HTML page. ### Data provenance Intelligence endpoints include provenance metadata: ```json { "confidence": 0.82, "dataAsOf": "2025-03-15T00:00:00Z", "methodology": "Description of computation method", "disclaimer": "Correlation != causation disclaimer", "source": "ai-generated|statistical-fallback" } ``` ### Pagination List endpoints use offset-based pagination: ```json { "pagination": { "total": 435, "limit": 20, "offset": 0, "hasMore": true } } ``` --- ## Data Sources & Provenance | Domain | Source | Update Frequency | |--------|--------|-----------------| | Members of Congress | congress-legislators (GitHub YAML) | Daily | | House votes | Congress.gov API v3 | Hourly | | Senate votes | Congressional Record (GovInfo), with Congress.gov for what each vote was on; senate.gov XML through Oct 22, 2026 | Daily (the morning after each vote day) | | Bills | Congress.gov API v3 | 6 hours | | Campaign finance | FEC.gov API | Daily | | Lobbying | Senate LDA API v1 | Daily | | Federal spending | USASpending.gov API v2 | Daily | | Federal Register | Federal Register API v1 | 6 hours | | Demographics | Census Bureau ACS 5-year | Annual | | Employment | Bureau of Labor Statistics | Monthly | | State government | OpenStates GraphQL | Daily | | State executives | Wikidata SPARQL | Weekly | | Hearing transcripts | GovInfo.gov API | Daily | --- ## Important Notes - All data is sourced from official U.S. government APIs - No data is fabricated — if a source is unavailable, the response returns empty arrays or null - Intelligence analysis never claims causation, only correlation and patterns - ML model accuracy is always disclosed alongside predictions - The platform is open source under the Apache-2.0 license; the government data it serves is public domain