OpenBB-finance/OpenBB · error · ValueError

Report ID {report_id} not found. Use list_reports() to see a

Error message

Report ID {report_id} not found. Use list_reports() to see available reports.

What it means

Plain ValueError raised at the bottom of get_report_url(report_id, ...) in psd_data_downloader when the given report_id does not match any report in the static PSD_REPORTS_METADATA mapping. The function iterates all groups/templates looking for the id to build a REPORT_HANDLER_URL; falling through means the id is unknown to this library version.

Source

Thrown at openbb_platform/providers/government_us/openbb_government_us/utils/psd_data_downloader.py:66

            template_id = report["templateId"]

            # Create a clean filename from the title
            filename = (
                title.replace(" ", "_")
                .replace(":", "")
                .replace(",", "")
                .replace("/", "_")
            )

            return (
                f"{REPORT_HANDLER_URL}?"
                f"reportId={report_id}&"
                f"templateId={template_id}&"
                f"format={file_format}&"
                f"fileName={filename}"
            )

    raise ValueError(
        f"Report ID {report_id} not found. Use list_reports() to see available reports."
    )


async def get_psd_report_data(report_id: int) -> dict:
    """
    Download and parse a PSD report into structured data ready for pandas DataFrame.

    Parameters
    ----------
    report_id : int
        The report ID from list_reports()

    Returns
    -------
    dict
        Parsed report with flat structure for DataFrame compatibility:
        {

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Call list_reports() first and use an id it returns.
  2. Update openbb-platform so PSD_REPORTS_METADATA matches the current USDA catalog.
  3. If the report should exist, open an issue so the metadata mapping gets updated.

Example fix

# before
get_report_url(999999, "csv")

# after
from openbb_government_us.utils.psd_data_downloader import list_reports
reports = list_reports()  # pick a valid id
get_report_url(valid_id, "csv")
Defensive patterns

Strategy: validation

Validate before calling

from openbb_government_us.utils.psd_data_downloader import PSD_REPORTS_METADATA

def valid_report_id(report_id: int) -> bool:
    return any(report_id in g["reports"] for g in PSD_REPORTS_METADATA.values())

Prevention

When it happens

Trigger: Passing a report id that is not in PSD_REPORTS_METADATA: typos, ids from a newer/older USDA FAS PSD Online release, or ids invented from the website UI.

Common situations: Library metadata out of sync with the live PSD Online site after USDA adds/removes reports; users copying numeric ids from the web UI without confirming via list_reports().

Related errors


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