Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Congress.gov Provider

This provider integrates with the Congress.gov API to provide access to U.S. legislative data and text.

Features

Congress Bills

  • Fetch lists of bills from the U.S. Congress.
  • Filter by congress session, bill type, date range.

Bill Summaries & Metadata

  • Get summaries of, and metadata for, a specific bill.
  • Lists all actions, sponsors, committees, related bills, and titles.
  • Returned as both a raw JSON object and formatted Markdown text.

Bill Text URLs and Downloads

  • Get URLs for different versions and file formats.
  • Download full bill text as a base64-encoded string.

OpenBB Workspace Application

With this extension installed, along with openbb-platform-api, an OpenBB Workspace App is added to your backend.

The application provides a PDF viewer, bill summaries and metadata as rendered Markdown, and a linked query tool for finding and reading legislation.

Installation

This provider is part of the OpenBB Platform. Install it using:

pip install openbb-congress-gov

The Workspace Application can be launched as a standalone, with only openbb-congress-gov and openbb-platform-api installed. Launch it from the terminal command line with:

openbb-api

Configuration

Congress.gov API Key

To use the Congress Bills and Bill Summaries endpoints, you need a Congress.gov API key:

  1. Go to https://api.congress.gov/sign-up/
  2. Fill out the registration form
  3. Agree to the terms of service
  4. You will receive an API key via email

The API key is free and provides access to all Congress.gov data.

Entering Credentials

Add the credential into OpenBB Platform from any of:

  • Entry in user_settings.json
{
    "credentials" : {
        "congress_gov_api_key": "YOUR KEY"
    }
}
  • Set environment variable
CONGRESS_GOV_API_KEY = "YOUR KEY"
  • Add to the current session only
from openbb import obb

obb.user.credentials.congress_gov_api_key = "YOUR KEY"

Coverage

All endpoints are under the obb.uscongress path:

In [1]: from openbb import obb
In [2]: obb.uscongress
Out[2]:
/uscongress
    bill_info
    bill_text
    bill_text_urls
    bills

Bill Text

The bill_text endpoint is a POST request from the API, and expects a dictionary in the body of the request.

{
    "urls": ["https://url-to-PDF-document"]
}

Usage Examples

Fetching Recent Bills

from openbb import obb

# Get the 10 most recently updated bills
bills = obb.uscongress.bills(limit=10)

Getting Bill Summaries

Reference individual bills by either their base URL (returned in the obb.uscongress.bills response), or by the concatenated bill number.

bill_info = obb.uscongress.bill_info(bill_url="119/hr/1")

See the function signatures and docstrings for parameters and detailed descriptions.

Release files for openbb-congress-gov 1.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openbb-congress-gov 1.2.3
File Size Uploaded
openbb_congress_gov-1.2.3.tar.gz 42.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openbb-congress-gov 1.2.3
File Interpreter ABI Platform
openbb_congress_gov-1.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 97.6 kB

Release files / openbb_congress_gov-1.2.3.tar.gz

Download URL openbb_congress_gov-1.2.3.tar.gz
Size 42.4 kB
Tags Source
SHA-256 checksum
How to use checksums
58918abb2f8662048339579e945fb35cfde46d25ae705d4c06c976469aff0c49
BLAKE2b-256 checksum
How to use checksums
9dc6a6a10a5ab74587f21e48c5f829398f6e7e7125097651cc147de2fa961402
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.13.11 Darwin/25.5.0

Release files / openbb_congress_gov-1.2.3-py3-none-any.whl

Download URL openbb_congress_gov-1.2.3-py3-none-any.whl
Size 55.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d32effe085e95daaf173e944ad5238a22f41e24b8c1348f2859b5a46017feb1b
BLAKE2b-256 checksum
How to use checksums
7a8e61cd35681fa0e7136783010652244b6ff422e6e9fa4c17d12d2a7e7fd4b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.13.11 Darwin/25.5.0
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page