openbb_platform/providers/congress_gov/README.md
This provider integrates with the Congress.gov API to provide access to U.S. legislative data and text.
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.
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
To use the Congress Bills and Bill Summaries endpoints, you need a Congress.gov API key:
The API key is free and provides access to all Congress.gov data.
Add the credential into OpenBB Platform from any of:
user_settings.json{
"credentials" : {
"congress_gov_api_key": "YOUR KEY"
}
}
CONGRESS_GOV_API_KEY = "YOUR KEY"
from openbb import obb
obb.user.credentials.congress_gov_api_key = "YOUR KEY"
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
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"]
}
from openbb import obb
# Get the 10 most recently updated bills
bills = obb.uscongress.bills(limit=10)
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.