OpenBB-finance/OpenBB · warning · EmptyDataError

No data was returned for the given query.

Error message

No data was returned for the given query.

What it means

Raised as EmptyDataError by FMPDiscoveryFilings.transform_data when the multi-URL fetch (amake_requests over paginated URLs) produced an empty list. Since the date-range validator (error 404) already passed, this means FMP genuinely returned no filings for the requested window/form types.

Source

Thrown at openbb_platform/providers/fmp/openbb_fmp/models/discovery_filings.py:116

        # FMP only allows 1000 results per page
        pages = math.ceil(limit / 1000)

        urls = [
            f"{base_url}?{query_str}&page={page}&limit=1000&apikey={api_key}"
            for page in range(pages)
        ]

        data = await amake_requests(urls, **kwargs)

        return sorted(data, key=lambda x: x["acceptedDate"], reverse=True)

    @staticmethod
    def transform_data(
        query: FMPDiscoveryFilingsQueryParams, data: list[dict], **kwargs: Any
    ) -> list[FMPDiscoveryFilingsData]:
        """Return the transformed data."""
        if not data:
            raise EmptyDataError("No data was returned for the given query.")
        return [FMPDiscoveryFilingsData.model_validate(d) for d in data]

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Widen the start_date/end_date window (within the 90-day cap) to a period known to contain filings
  2. Verify the API key works by calling the FMP filing endpoint directly
  3. Catch EmptyDataError and return an empty list to the caller instead of failing the whole workflow

Example fix

# before
res = obb.equity.discovery_filings(provider='fmp', start_date='2024-12-25', end_date='2024-12-26')  # holiday, nothing filed

# after
res = obb.equity.discovery_filings(provider='fmp', start_date='2024-12-20', end_date='2024-12-31')
Defensive patterns

Strategy: try-catch

Validate before calling

from datetime import date, timedelta
# avoid windows that cannot contain filings
if (end_date - start_date).days < 1:
    raise ValueError('Window too narrow; widen it to at least a few trading days')

Type guard

null

Try / catch

from openbb_core.provider.utils.errors import EmptyDataError
try:
    res = obb.equity.discovery_filings(provider='fmp', start_date=s, end_date=e)
except EmptyDataError:
    res = []  # no filings in window is a normal outcome

Prevention

When it happens

Trigger: Calling discovery_filings with a date range that contains no matching filings (weekends/holidays, quiet periods), or when FMP returns an empty payload due to key/plan/upstream issues.

Common situations: Narrow date windows around market closures, filters (form type) that match nothing in the window, expired API key returning empty rather than an error, or upstream FMP data gaps.

Related errors


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