Skip to main content

Congress.gov Provider Extension for the OpenBB Platform

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openbb_congress_gov-1.1.1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openbb_congress_gov-1.1.1-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file openbb_congress_gov-1.1.1.tar.gz.

File metadata

  • Download URL: openbb_congress_gov-1.1.1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.11 Darwin/25.2.0

File hashes

Hashes for openbb_congress_gov-1.1.1.tar.gz
Algorithm Hash digest
SHA256 d0565ed61adec0bd7f88ad70c9d3b295b1464e10e9ae1fceec5c164fa6fe12bf
MD5 93fcee1a42b802362f2fe20f607f2df1
BLAKE2b-256 c240beb53872f819cc0e4750a70c864e0b1229d3742c5b6d7672d10cea6a3cc4

See more details on using hashes here.

File details

Details for the file openbb_congress_gov-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openbb_congress_gov-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ad2b3f0fafc8a6f2a052a6613ce4f34363acaf88fc123c2e5862badb806eeea
MD5 52e75fefe254ba9b9c2f6cc75492f57f
BLAKE2b-256 93262cb706a7c57dd38955379b11627c8234d9d197331b2fb9c204b18d2a284c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page