0.1.7 • Published 6 months ago

congress-gov-sdk v0.1.7

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
6 months ago

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

0.1.7

6 months ago

0.1.6

7 months ago

0.1.5

7 months ago

0.1.4

7 months ago

0.1.3

8 months ago

0.1.2

8 months ago