MCPcopy Index your code
hub / github.com/LibraryOfCongress/api.congress.gov

github.com/LibraryOfCongress/api.congress.gov @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
115 symbols 317 edges 14 files 99 documented · 86%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Overview

Introduction

The Congress.gov Application Programming Interface (API) provides a method for Congress and the public to view, retrieve, and re-use machine-readable data from collections available on Congress.gov. This repository contains information on accessing and using the Congress.gov API, as well as documentation on available endpoints.

Within the Congress.gov API, responses are returned in XML or JSON formats. An <api-root> element will be visible for responses returned in XML.

For every request, three elements are returned:

  • The Request element contains information about the API request itself. This includes the format and the <contentType>; this is essentially the information you might expect to see in a request header.
  • The Pagination element contains a count of how many total data items are contained within the response, a URL containing the next page of results; and, if the offset is greater than 1, a URL containing the previous page of results.
  • The Data element, the name of which changes depending on the endpoint utilized (i.e. <bills> for the bill endpoint, <amendments> for the amendment endpoint, etc.). This element contains a list of all data items returned by your API call.

Keys

An API key is required for access. Sign up for a key here.

Learn more on how you can use your API key to access the Congress.gov API on api.data.gov.

Versioning

The current version of the API is version 3 (v3). Prior versions were used by the Government Publishing Office (GPO) for its Bulk Data Repository, and other clients.

Rate Limit

The rate limit is set to 5,000 requests per hour.

Limit and Offset

By default, the API returns 20 results starting with the first record. The 20 results limit can be adjusted up to 250 results. If the limit is adjusted to be greater than 250 results, only 250 results will be returned. The offset, or the starting record, can also be adjusted to be greater than 0.

Coverage and Estimated Update Times for Congress.gov Collections

Coverage information for Congress.gov collections data in the API can be found at Coverage Dates for Congress.gov Collections on Congress.gov. This page also provides estimated update times for Congress.gov collections.

Support

Congress.gov staff will monitor and respond to any issues created in this repository, and will initiate actions, as necessary. Before creating an issue in the repository, please review existing issues and add a comment to any issues relevant to yours.

Change Management

Congress.gov staff will issue change management communication through the ChangeLog so that consumers are able to adjust accordingly. The ChangeLog will contain information on updates to the API, the impacted endpoints, and the expected production release date. Milestones are also used to tag issues with expected production release date information.

Relevant Privacy Policies

  1. API keys and user registration follow the data.gov privacy policy. Read more here.
  2. API content follows the Library of Congress privacy policy. Read more here.

Core symbols most depended-on inside this repo

outputMessage
called by 40
api_client/java/src/gov/loc/Utils.java
outputMessage
called by 40
java/src/gov/loc/Utils.java
makeRequestAndOutputResponse
called by 13
api_client/java/src/gov/loc/CDGClient.java
makeRequestAndOutputResponse
called by 13
java/src/gov/loc/CDGClient.java
getProperty
called by 9
api_client/java/src/gov/loc/Config.java
getProperty
called by 9
java/src/gov/loc/Config.java
outputMessageAndBail
called by 8
api_client/java/src/gov/loc/Utils.java
outputMessageAndBail
called by 8
java/src/gov/loc/Utils.java

Shape

Method 72
Function 29
Class 14

Languages

Java64%
Python36%

Modules by API surface

python/bill_example.py15 symbols
java/src/sample/Bill.java15 symbols
api_client/java/src/sample/Bill.java15 symbols
api_client/python/bill_example.py14 symbols
java/src/gov/loc/Config.java11 symbols
api_client/java/src/gov/loc/Config.java11 symbols
python/cdg_client.py6 symbols
api_client/python/cdg_client.py6 symbols
java/src/gov/loc/CDGClient.java5 symbols
api_client/java/src/gov/loc/CDGClient.java5 symbols
java/src/sample/Main.java3 symbols
java/src/gov/loc/Utils.java3 symbols

For agents

$ claude mcp add api.congress.gov \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact