OpenBB-finance/OpenBB · warning · HTTPException

No text available for this bill currently.

Error message

No text available for this bill currently.

What it means

get_bill_text fetches the textVersions array for a bill URL; when the response has none and the caller is not the Workspace (is_workspace=False), it raises HTTPException(404). Many bills — brand-new introductions, or bills whose text has not been published by GPO — legitimately have zero text versions, so this is a 'not yet available' signal rather than a broken URL.

Source

Thrown at openbb_platform/providers/congress_gov/openbb_congress_gov/utils/helpers.py:438

    Returns
    -------
    list[dict]
        List of dictionaries with the results.
    """
    # pylint: disable=import-outside-toplevel
    from openbb_core.provider.utils.helpers import amake_request

    api_key = check_api_key()
    results: list = []
    url = bill_url.replace("?", "/text?") + f"&api_key={api_key}"
    response = await amake_request(url)
    bill_text = response.get("textVersions", [])  # type: ignore

    # Return the results for non-Workspace queries
    if is_workspace is False:
        if not bill_text:
            raise HTTPException(
                status_code=404,
                detail="No text available for this bill currently.",
            )

        text_output: list = []
        seen_urls: set = set()

        for version in bill_text:
            bill_version: dict = {}
            formats = version.get("formats", [])
            bill_type = version.get("type", "")
            version_date = version.get("date", "")

            if not formats or not version_date:
                continue

            pdf_url = next(
                (f.get("url") for f in formats if f.get("type") == "PDF"), None

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Treat 404 as expected: catch it and show 'text not yet published' rather than an error
  2. Only surface text links for bills whose API entry already indicates text availability
  3. Retry later if the bill was just introduced — text usually appears within days

Example fix

# before
from fastapi import HTTPException
text = await get_bill_text(bill_url=url, is_workspace=False)

# after
try:
    text = await get_bill_text(bill_url=url, is_workspace=False)
except HTTPException as e:
    if e.status_code == 404:
        text = []  # text not yet published
    else:
        raise
Defensive patterns

Strategy: try-catch

Try / catch

from fastapi import HTTPException

async def safe_bill_text(bill_url: str) -> list:
    try:
        return await get_bill_text(bill_url=bill_url, is_workspace=False)
    except HTTPException as e:
        if e.status_code == 404:
            return []  # text not published yet — normal state
        raise

Prevention

When it happens

Trigger: Requesting text for a bill introduced minutes/hours ago; a bill URL copied before text publication; private laws or obscure measures GPO never published. Workspace callers get an empty list instead of the exception.

Common situations: Dashboards linking straight from a bills list to text without handling the not-yet-published case; racing Congress.gov publication latency (often hours to days after introduction).

Related errors


AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14). Data as JSON: /api/errors/0055c01fef16799f. Report an issue: GitHub.