OpenBB-finance/OpenBB · warning · OpenBBError

No data found in the response. URL: {url}

Error message

No data found in the response. URL: {url}

What it means

fetch_data located the XML root but no DataSet element under any of the known SDMX 3.0 namespaces (message:, ss:, or unprefixed). This usually means the response is an SDMX error or structure-only message rather than a data message, so the library raises an EmptyDataError-wrapped OpenBBError.

Source

Thrown at openbb_platform/providers/imf/openbb_imf/utils/query_builder.py:392

            raise OpenBBError(f"Failed to parse XML response: {url} -> {e}") from e

        # Define namespaces used in IMF SDMX responses
        namespaces = {
            "message": "http://www.sdmx.org/resources/sdmxml/schemas/v3_0/message",
            "ss": "http://www.sdmx.org/resources/sdmxml/schemas/v3_0/data/structurespecific",
            "common": "http://www.sdmx.org/resources/sdmxml/schemas/v3_0/common",
        }

        # Find all Series elements
        dataset = root.find(".//message:DataSet", namespaces)
        if dataset is None:
            # Try without namespace prefix
            dataset = root.find(".//DataSet")
        if dataset is None:
            # Try with ss namespace
            dataset = root.find(".//ss:DataSet", namespaces)
        if dataset is None:
            raise OpenBBError(
                EmptyDataError(f"No data found in the response. URL: {url}")
            )

        # Parse Group elements to extract group-level attributes (UNIT, ACCOUNTING_ENTRY, etc.)
        # Group structure: <Group INDICATOR="..." ns1:type="GROUP_INDICATOR">
        #                    <Comp id="UNIT"><Value>USD</Value></Comp>
        #                    <Comp id="ACCOUNTING_ENTRY"><Value>NETLA</Value></Comp>
        #                  </Group>
        group_attributes: dict[str, dict[str, str]] = {}

        # Find all Group elements - they can have namespace prefix
        for group in dataset.findall("Group") + dataset.findall("ss:Group", namespaces):
            # The group key is typically the INDICATOR code or similar dimension
            group_key = None
            for attr_name, attr_value in group.attrib.items():
                # Skip namespace type attributes like ns1:type
                if "type" in attr_name.lower() and "group" in attr_value.lower():
                    continue

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Open the URL in a browser and read the message: SDMX <Error> elements state the reason (e.g. no results for key).
  2. Relax the query: drop a dimension filter or use the wildcard '*' so more series match.
  3. Verify each dimension value against the dataflow's codelists (see error 629 workflow).
  4. Treat as empty data, not a hard failure, if your pipeline tolerates gaps.

Example fix

# before
url = qb.build_url('DF', REF_AREA='USA', INDICATOR='VERY_SPECIFIC')  # empty DataSet

# after
url = qb.build_url('DF', REF_AREA='USA', INDICATOR='*')  # widen, then filter client-side
Defensive patterns

Strategy: fallback

Try / catch

try:
    df = qb.fetch_data(url)
except OpenBBError as e:
    if 'No data found in the response' in str(e):
        wider = widen_url_key(url)  # replace a dimension segment with '*'
        df = qb.fetch_data(wider)
    else:
        raise

Prevention

When it happens

Trigger: Querying a valid-but-empty series combination (server returns an empty or error DataMessage), or requesting metadata the API answers with a generic structure payload.

Common situations: Dimension combinations the constraints API tolerates but that carry no observations, retired series within live dataflows, or 200-OK responses containing an SDMX Error message.

Related errors


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