congress-gov-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

Congress.gov SDK

Version badge Package size badge

Axios Typescript SDK for the api.congress.gov API.

Getting started

Install:

yarn add congress-gov-sdk
# or
npm i congress-gov-sdk

Obtain an API key: https://api.congress.gov/signup

Add the API key to your env: CONGRESS_GOV_API_KEY=your-api-key

Usage:

import { Configuration, CongressApi, CongressMemberOverview } from "congress-gov-sdk";

const congressApi = new CongressApi(new Configuration({
    apiKey: process.env.CONGRESS_GOV_API_KEY
}));

const response = await congressApi.getMembers({
    offset: 0,
    limit: 50,
    currentMember: true
});

if (response.status != 200) {
    throw new Error("Failed to fetch member list: " + response.statusText);
}
const members: CongressMemberOverview[] = response.data.members;

Features

Currently only supports 5 of the 100 available APIs

Bill API: 0/16

Amendments API: 0/8

Summaries API: 0/3

Congress API: 0/3

Member API: 5/8

Committee API: 0/10

Committee Report API: 0/5

Committee Print API: 0/5

Committee Meeting API: 0/4

Hearing API: 0/4

Congressional Record API: 0/1

Daily Congressional Record API: 0/4

Bound Congressional Record API: 0/4

House Communication API: 0/4

House Requirement API: 0/3

Senate Communication API: 0/4

Nomination API: 0/7

Treaty API: 0/7

Package Sidebar

Install

npm i congress-gov-sdk

Weekly Downloads

10

Version

0.1.7

License

Apache-2.0

Unpacked Size

357 kB

Total Files

57

Last publish

Collaborators

  • basonjar