OpenBB-finance/OpenBB · error · EmptyDataError

No data was returned from the FMP endpoint.

Error message

No data was returned from the FMP endpoint.

What it means

Raised as EmptyDataError by FMPCurrencySnapshots.transform_data when the list handed over from a_url is empty, i.e. FMP's currency-snapshot endpoint returned no records at all. It fires before any base-currency filtering, so it means the upstream response itself was empty, not that your filters removed everything.

Source

Thrown at openbb_platform/providers/fmp/openbb_fmp/models/currency_snapshots.py:105

        url = f"https://financialmodelingprep.com/stable/batch-forex-quotes?short=false&apikey={api_key}"

        return await get_data_many(url, **kwargs)

    @staticmethod
    def transform_data(
        query: FMPCurrencySnapshotsQueryParams,
        data: list[dict],
        **kwargs: Any,
    ) -> list[FMPCurrencySnapshotsData]:
        """Filter by the query parameters and validate the model."""
        # pylint: disable=import-outside-toplevel
        from datetime import timezone  # noqa
        from numpy import nan
        from pandas import DataFrame, concat
        from openbb_core.provider.utils.helpers import safe_fromtimestamp

        if not data:
            raise EmptyDataError("No data was returned from the FMP endpoint.")

        # Drop all the zombie columns FMP returns.
        df = DataFrame(data).dropna(how="all", axis=1).drop(columns=["exchange"])

        new_df = DataFrame()

        # Filter for the base currencies requested and the quote_type.
        for symbol in query.base.split(","):
            temp = (
                df.query("`symbol`.str.startswith(@symbol)")
                if query.quote_type == "indirect"
                else df.query("`symbol`.str.endswith(@symbol)")
            ).rename(columns={"symbol": "base_currency", "name": "counter_currency"})
            temp["base_currency"] = symbol
            temp["counter_currency"] = (
                [d.split("/")[1] for d in temp["counter_currency"]]
                if query.quote_type == "indirect"
                else [d.split("/")[0] for d in temp["counter_currency"]]

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Verify credentials and hit the FMP snapshot URL directly with the same apikey to inspect the raw payload
  2. Confirm the FMP plan supports currency snapshots
  3. Retry once after a short delay in case of a transient empty feed
  4. Catch EmptyDataError and fall back to another provider or cached data

Example fix

// n/a - runtime data condition, no code change fixes it; guard instead
null
Defensive patterns

Strategy: try-catch

Validate before calling

creds = obb.user.credentials.get('fmp_api_key')
assert creds, 'Missing FMP API key'

Type guard

def has_snapshot_rows(r) -> bool:
    return bool(getattr(r, 'results', None))

Try / catch

from openbb_core.provider.utils.errors import EmptyDataError
try:
    snap = await obb.currency.snapshots.async_(provider='fmp', base='USD')
except EmptyDataError:
    snap = await obb.currency.snapshots.async_(provider='yfinance')

Prevention

When it happens

Trigger: Calling obb.currency.snapshots() (provider=fmp) when FMP returns zero rows for the snapshot feed - invalid/expired API key, plan without snapshot access, or a transient upstream gap.

Common situations: Bad or missing FMP_API_KEY, free-tier key against a paid endpoint, FMP endpoint renamed/emptied after a provider version bump, temporary market-data outage.

Related errors


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