OpenBB-finance/OpenBB · error · OpenBBError

No data was in the response

Error message

No data was in the response

What it means

parse_context in openbb_econdb.utils.helpers post-processes responses from get_context (the multi-ticker series fetcher used by econdb macro endpoints). If response is None — meaning the underlying amake_requests produced nothing at all (all requests failed or were skipped) — it raises OpenBBError('No data was in the response'). This indicates the fetching layer, not the parsing of individual items.

Source

Thrown at openbb_platform/providers/econdb/openbb_econdb/utils/helpers.py:526

            cache=SQLiteBackend(cache_dir, expire_after=3600 * 24)
        ) as session:
            try:
                response = await amake_requests(urls, session=session)
            finally:
                await session.close()
    else:
        response = await amake_requests(urls)
    return response


def parse_context(  # pylint: disable=R0912, R0914, R0915
    response: list[dict], latest: bool = False, with_metadata: bool = False
) -> DataFrame | tuple[DataFrame, dict]:
    """Parse the output from `get_context()`, and optionally return the metadata."""
    metadata = {}
    results = DataFrame()
    if response is None:
        raise OpenBBError("No data was in the response")
    if not isinstance(response, list):
        raise OpenBBError("Expecting a list of dictionaries and received a dictionary.")
    for item in response:
        symbol = item.get("id", "")
        _symbol = symbol.split("~")[0].replace("19", "")
        temp_unit = ""
        temp_meta = item.get("td", {})
        temp_data = item.get("dataarray", [])
        temp_transform = symbol.split("~")[1] if "~" in symbol else ""
        temp_country = item.get("geography", {}).get("name", "")
        temp_country = temp_country.replace(" (19 countries)", "")
        # We need the metadata to process the results.
        if temp_meta:
            temp_unit = temp_meta.get("units", "")
            temp_scale = temp_meta.get("scale", "")
            if temp_transform:
                if temp_transform in ["TOYA", "TPOP", "TPGP"]:
                    temp_unit = "Percent"

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Verify each ticker individually against EconDB's series search (https://www.econdb.com/api/series/?ticker=...).
  2. Re-run with use_cache=False to rule out a poisoned cache entry.
  3. Supply your own econdb_api_key if the temp-token path is failing.
  4. Retry later if all tickers previously worked — a sudden None response points to upstream unavailability.
Defensive patterns

Strategy: try-catch

Validate before calling

from openbb_econdb.utils.helpers import get_indicator_countries  # sanity only; None-response means fetch-layer failure

Type guard

def is_series_list(response) -> bool:
    """Guard: get_context must yield a list of per-ticker dicts."""
    return isinstance(response, list) and all(isinstance(i, dict) for i in response)

Try / catch

from openbb_core.app.model.obbject import OpenBBError
try:
    df = parse_context(await get_context(symbols))
except OpenBBError as e:
    if 'No data was in the response' in str(e):
        logger.warning('econdb fetch produced nothing - check tickers/token/network')
    raise

Prevention

When it happens

Trigger: Calling an econdb endpoint that funnels through get_context/parse_context (e.g. economy.econdb-style series queries) with tickers the API does not recognize, an invalid/expired token, or network failures, so the aggregated response is None instead of a list of series objects.

Common situations: Misspelled ticker symbols; symbol format ignoring the required '~transform' or country suffix; temp token invalidated mid-session; upstream outage.

Related errors


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