npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@civiq/sdk

v0.1.0

Published

TypeScript client for the CIV.IQ civic data API — representatives, bills, votes, committees, intelligence analysis

Readme

@civiq/sdk

TypeScript client for the CIV.IQ civic data API.

What you can build with this

CIV.IQ resolves and cross-references 23 government data sources. This SDK gives you programmatic access to the results:

  • Find representatives by address — geocode a street address to congressional district and return federal and state legislators
  • Trace campaign finance — see who funds a legislator, broken down by industry sector
  • Read voting records — every roll-call vote in the 119th Congress, by member
  • Follow legislation — bill status, sponsors, cosponsors, committee assignments
  • See intelligence analysis — vote prediction, influence chains, sector leaderboards, all with confidence scores and methodology disclosure
  • Explore the civic graph — navigate connections between representatives, bills, committees, districts, and organizations

All data comes from real government APIs. No mock data. When a source is unavailable, the response says so.

Install

npm install @civiq/sdk

Quick start

import { CivIQ } from '@civiq/sdk';

const civiq = new CivIQ();

// Who represents this address?
const reps = await civiq.districts.geocode({
  mode: 'address',
  address: '1600 Pennsylvania Ave NW, Washington DC 20500',
});

// What's their voting record?
const detail = await civiq.representatives.get('P000197');

// How independent are they from donor interests?
const prediction = await civiq.intelligence.votePrediction('P000197');

// What industries fund legislators on this committee?
const leaderboard = await civiq.intelligence.sectorLeaderboard('Energy', {
  chamber: 'senate',
});

Resources

representatives

civiq.representatives.list({ chamber, state, party });
civiq.representatives.get(bioguideId);
civiq.representatives.profile(bioguideId);
civiq.representatives.compare(['A000001', 'B000002']);
civiq.representatives.all({ chamber, state });

bills

civiq.bills.list({ query, congress, chamber, status });
civiq.bills.get(billId);
civiq.bills.summary(billId);

votes

civiq.votes.get(voteId);

districts

civiq.districts.get(districtId);
civiq.districts.geocode({ mode, address });

committees

civiq.committees.list();
civiq.committees.get(committeeId);

intelligence

civiq.intelligence.votePrediction(bioguideId)
civiq.intelligence.influenceChain(bioguideId)
civiq.intelligence.sectorLeaderboard(sector, { chamber })
civiq.intelligence.moneyReportByAddress({ street, city, state })
civiq.intelligence.influenceClusters(bioguideId?)

search

civiq.search.unified({ q, limit });
civiq.search.policyArea({ policyArea });

states

civiq.states.legislature(state);
civiq.states.bills(state, { query });
civiq.states.legislatorsByAddress({ street, city, state });

graph

civiq.graph.neighbors(nodeId, { limit });
civiq.graph.entity(nodeId);

Configuration

// Custom base URL (local development or self-hosted)
const civiq = new CivIQ({ baseUrl: 'http://localhost:3000/api' });

Error handling

import { CivIQ, NotFoundError, RateLimitError, BadRequestError, UpstreamError } from '@civiq/sdk';

try {
  await civiq.representatives.get(bioguideId);
} catch (err) {
  if (err instanceof NotFoundError) {
    // No representative with that ID
  } else if (err instanceof RateLimitError) {
    // 60 requests/minute limit hit. err.retryAfter has seconds to wait.
  } else if (err instanceof UpstreamError) {
    // Government API is down
  }
}

Types

All response types are exported for TypeScript consumers:

import type {
  RepresentativeDetail,
  BillSummary,
  VoteDetail,
  DistrictDetail,
  IntelligenceInsight,
} from '@civiq/sdk';

Data sources

Congress.gov, FEC, Census Bureau, USASpending.gov, Federal Register, Senate LDA, SEC EDGAR, OpenStates, and more. Full list at civdotiq.org/data-sources.

License

MIT