{"record":{"id":"e171f88660eeba62","repo":"OpenBB-finance/OpenBB","slug":"no-data-was-returned-from-the-fmp-endpoint","errorCode":null,"errorMessage":"No data was returned from the FMP endpoint.","messagePattern":"No data was returned from the FMP endpoint\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/fmp/openbb_fmp/models/currency_snapshots.py","lineNumber":105,"sourceCode":"        url = f\"https://financialmodelingprep.com/stable/batch-forex-quotes?short=false&apikey={api_key}\"\n\n        return await get_data_many(url, **kwargs)\n\n    @staticmethod\n    def transform_data(\n        query: FMPCurrencySnapshotsQueryParams,\n        data: list[dict],\n        **kwargs: Any,\n    ) -> list[FMPCurrencySnapshotsData]:\n        \"\"\"Filter by the query parameters and validate the model.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from datetime import timezone  # noqa\n        from numpy import nan\n        from pandas import DataFrame, concat\n        from openbb_core.provider.utils.helpers import safe_fromtimestamp\n\n        if not data:\n            raise EmptyDataError(\"No data was returned from the FMP endpoint.\")\n\n        # Drop all the zombie columns FMP returns.\n        df = DataFrame(data).dropna(how=\"all\", axis=1).drop(columns=[\"exchange\"])\n\n        new_df = DataFrame()\n\n        # Filter for the base currencies requested and the quote_type.\n        for symbol in query.base.split(\",\"):\n            temp = (\n                df.query(\"`symbol`.str.startswith(@symbol)\")\n                if query.quote_type == \"indirect\"\n                else df.query(\"`symbol`.str.endswith(@symbol)\")\n            ).rename(columns={\"symbol\": \"base_currency\", \"name\": \"counter_currency\"})\n            temp[\"base_currency\"] = symbol\n            temp[\"counter_currency\"] = (\n                [d.split(\"/\")[1] for d in temp[\"counter_currency\"]]\n                if query.quote_type == \"indirect\"\n                else [d.split(\"/\")[0] for d in temp[\"counter_currency\"]]","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/fmp/openbb_fmp/models/currency_snapshots.py#L87-L123","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify credentials and hit the FMP snapshot URL directly with the same apikey to inspect the raw payload","Confirm the FMP plan supports currency snapshots","Retry once after a short delay in case of a transient empty feed","Catch EmptyDataError and fall back to another provider or cached data"],"exampleFix":"// n/a - runtime data condition, no code change fixes it; guard instead\nnull","handlingStrategy":"try-catch","validationCode":"creds = obb.user.credentials.get('fmp_api_key')\nassert creds, 'Missing FMP API key'","typeGuard":"def has_snapshot_rows(r) -> bool:\n    return bool(getattr(r, 'results', None))","tryCatchPattern":"from openbb_core.provider.utils.errors import EmptyDataError\ntry:\n    snap = await obb.currency.snapshots.async_(provider='fmp', base='USD')\nexcept EmptyDataError:\n    snap = await obb.currency.snapshots.async_(provider='yfinance')","preventionTips":["Validate FMP credentials at startup","Cache the last successful snapshot and reuse it on EmptyDataError for non-realtime use cases"],"tags":["fmp","empty-data","currency","api-key"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}