OpenBB-finance/OpenBB · warning · EmptyDataError

No data found for the given symbols.

Error message

No data found for the given symbols.

What it means

Raised as EmptyDataError by FMPEtfCountries.a_url: country-exposure data is fetched per ETF symbol; symbols whose response has no rows are skipped silently (only processed rows are appended). If, after gathering all symbols, 'results' is still empty, this error is raised - i.e. no requested ETF returned any country-weight rows.

Source

Thrown at openbb_platform/providers/fmp/openbb_fmp/models/etf_countries.py:83

                for row in result:
                    row_weight = row.get("weightPercentage", "0%").replace("%", "")
                    if not row_weight or row_weight == "0":
                        continue
                    new_row = {
                        "symbol": symbol,
                        "country": row["country"],
                        "weight": float(row_weight) * 0.01,
                    }
                    new_data.append(new_row)

                if new_data:
                    results.extend(new_data)
            return

        await asyncio.gather(*[get_one(symbol) for symbol in symbols])

        if not results:
            raise EmptyDataError("No data found for the given symbols.")

        return results

    @staticmethod
    def transform_data(
        query: FMPEtfCountriesQueryParams, data: list, **kwargs: Any
    ) -> list[FMPEtfCountriesData]:
        """Return the transformed data."""
        symbols = query.symbol.split(",")

        return [
            FMPEtfCountriesData.model_validate(d)
            for d in sorted(
                data,
                key=lambda x: (
                    symbols.index(x.get("symbol", len(symbols))),
                    -(x.get("weightPercentage", 0) or 0),
                ),

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Verify each symbol is actually an ETF (check via obb.etf.profile) before calling
  2. Test a major ETF like SPY or VOO alone to distinguish coverage gaps from key/plan issues
  3. Remove failing symbols (those contributing no rows) and retry the remainder
  4. Catch EmptyDataError and report 'no country exposure data available for these symbols'

Example fix

# before
res = obb.etf.countries(symbol='AAPL,MSFT', provider='fmp')  # stocks, not ETFs -> EmptyDataError

# after
res = obb.etf.countries(symbol='SPY,VOO', provider='fmp')
Defensive patterns

Strategy: validation

Validate before calling

# confirm symbols are ETFs before requesting country exposure
profile = obb.etf.profile(symbol=sym, provider='fmp').results
if not profile:
    raise ValueError(f'{sym} is not a known ETF on FMP')

Type guard

def looks_like_etf_symbol_list(symbols: list[str], etf_universe: set[str]) -> bool:
    return all(s in etf_universe for s in symbols)

Try / catch

from openbb_core.provider.utils.errors import EmptyDataError
try:
    res = await obb.etf.countries.async_(symbol=','.join(symbols), provider='fmp')
except EmptyDataError:
    res = []  # no country-exposure data for any requested ETF

Prevention

When it happens

Trigger: Calling obb.etf.countries(symbol=..., provider='fmp') where every symbol fails - non-ETF symbols (stocks), ETFs FMP has no country breakdown for, or an API key without access to the country-exposure endpoint.

Common situations: Passing equity tickers where ETFs are expected, thinly-covered or new ETFs lacking exposure data on FMP, key/plan restrictions returning empty payloads, or delisted ETFs.

Related errors


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