OpenBB-finance/OpenBB · error · OpenBBError

No data returned for the given query parameters.

Error message

No data returned for the given query parameters.

What it means

Error "No data returned for the given query parameters." thrown in OpenBB-finance/OpenBB.

Source

Thrown at openbb_platform/providers/imf/openbb_imf/models/consumer_price_index.py:525

        query: ImfConsumerPriceIndexQueryParams,
        data: dict,
        **kwargs: Any,
    ) -> AnnotatedResult[list[ImfConsumerPriceIndexData]]:
        """Transform data and validate the model."""
        row_data = data.get("data", [])
        result: list[ImfConsumerPriceIndexData] = []
        metadata: dict = data.get("metadata", {})
        dataset_info: dict = metadata.pop("dataset", {})
        table_info: dict = (
            metadata.pop("IMF_STA_CPI_CPI", {})
            or metadata.pop("IMF_STA_CPI_HICP", {})
            or {}
        )
        dataset_info["index_type"] = table_info.get("indicator", "")
        dataset_info["index_description"] = table_info.get("description", "")

        if not row_data:
            raise OpenBBError("No data returned for the given query parameters.")

        for item in row_data:
            # Filter by date range here because IMF API date filtering can be inconsistent
            item_date = item.get("TIME_PERIOD", None)
            if (
                query.start_date
                and item_date
                and item_date < query.start_date.strftime("%Y-%m-%d")
            ):
                continue
            if (
                query.end_date
                and item_date
                and item_date > query.end_date.strftime("%Y-%m-%d")
            ):
                continue

            # Get translated labels (these are now human-readable)

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Adjust the query parameters: widen the date range or change country/expenditure.
  2. Verify the combination of country and expenditure has published CPI data.
  3. Retry later in case of IMF API issues.

When it happens

Trigger: Thrown at openbb_platform/providers/imf/openbb_imf/models/consumer_price_index.py:525 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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