OpenBB-finance/OpenBB · error · OpenBBError

FMP Error Message -> Status code: {response.status} -> {erro

Error message

FMP Error Message -> Status code: {response.status} -> {error_message}

What it means

Raised in FMP's response_callback when the body contains an 'Error Message'/'error' field that does NOT match any of the authorization keywords checked above it - i.e. FMP returned 200 with a genuine error payload that is not plan-related. The generic OpenBBError preserves the status code and the server's error text.

Source

Thrown at openbb_platform/providers/fmp/openbb_fmp/utils/helpers.py:38

    if isinstance(data, dict):
        error_message = data.get("Error Message", data.get("error"))

        if error_message is not None:
            conditions = (
                "upgrade" in error_message.lower()
                or "exclusive endpoint" in error_message.lower()
                or "special endpoint" in error_message.lower()
                or "premium query parameter" in error_message.lower()
                or "subscription" in error_message.lower()
                or "unauthorized" in error_message.lower()
                or "premium" in error_message.lower()
            )

            if conditions:
                raise UnauthorizedError(f"Unauthorized FMP request -> {error_message}")

            raise OpenBBError(
                f"FMP Error Message -> Status code: {response.status} -> {error_message}"
            )

    return data


async def get_data(url: str, **kwargs: Any) -> list | dict:
    """Get data from FMP endpoint."""
    # pylint: disable=import-outside-toplevel
    from openbb_core.provider.utils.helpers import amake_request

    return await amake_request(url, response_callback=response_callback, **kwargs)


async def get_data_urls(urls: list[str], **kwargs: Any) -> list | dict:
    """Get data from FMP for several urls."""
    # pylint: disable=import-outside-toplevel
    from openbb_core.provider.utils.helpers import amake_requests

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Read the embedded error_message verbatim - it comes straight from FMP and names the real problem
  2. Validate the symbol exists via FMP's symbol search before querying data endpoints
  3. Normalize date formats to YYYY-MM-DD as FMP expects
  4. Retry after a short delay if the message suggests a transient data issue
Defensive patterns

Strategy: try-catch

Validate before calling

import requests
r = requests.get(f"https://financialmodelingprep.com/stable/search-ticker?query={symbol}&apikey={key}")
assert r.status_code == 200 and r.json(), f'{symbol} not found on FMP'

Try / catch

from openbb_core.app.model.abstract.error import OpenBBError
try:
    data = await fetcher.fetch_data(query, credentials)
except OpenBBError as e:
    if 'FMP Error Message' in str(e):
        log.warning('FMP rejected query %s: %s', query, e)
    raise

Prevention

When it happens

Trigger: FMP-side errors such as 'Invalid symbol', malformed query values the API rejects post-200, or dataset-specific failures (e.g. 'No data available for this time range') delivered as a 200 JSON error dict.

Common situations: Passing an unknown/delisted ticker or a symbol suffix FMP does not recognize; malformed dates; transient FMP data-pipeline errors that arrive as error JSON rather than status codes.

Related errors


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