{"record":{"id":"c43e98cffeff2fba","repo":"OpenBB-finance/OpenBB","slug":"no-data-was-returned-for-the-given-query","errorCode":null,"errorMessage":"No data was returned for the given query.","messagePattern":"No data was returned for the given query\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/fmp/openbb_fmp/models/discovery_filings.py","lineNumber":116,"sourceCode":"        # FMP only allows 1000 results per page\n        pages = math.ceil(limit / 1000)\n\n        urls = [\n            f\"{base_url}?{query_str}&page={page}&limit=1000&apikey={api_key}\"\n            for page in range(pages)\n        ]\n\n        data = await amake_requests(urls, **kwargs)\n\n        return sorted(data, key=lambda x: x[\"acceptedDate\"], reverse=True)\n\n    @staticmethod\n    def transform_data(\n        query: FMPDiscoveryFilingsQueryParams, data: list[dict], **kwargs: Any\n    ) -> list[FMPDiscoveryFilingsData]:\n        \"\"\"Return the transformed data.\"\"\"\n        if not data:\n            raise EmptyDataError(\"No data was returned for the given query.\")\n        return [FMPDiscoveryFilingsData.model_validate(d) for d in data]\n","sourceCodeStart":98,"sourceCodeEnd":118,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/fmp/openbb_fmp/models/discovery_filings.py#L98-L118","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Widen the start_date/end_date window (within the 90-day cap) to a period known to contain filings","Verify the API key works by calling the FMP filing endpoint directly","Catch EmptyDataError and return an empty list to the caller instead of failing the whole workflow"],"exampleFix":"# before\nres = obb.equity.discovery_filings(provider='fmp', start_date='2024-12-25', end_date='2024-12-26')  # holiday, nothing filed\n\n# after\nres = obb.equity.discovery_filings(provider='fmp', start_date='2024-12-20', end_date='2024-12-31')","handlingStrategy":"try-catch","validationCode":"from datetime import date, timedelta\n# avoid windows that cannot contain filings\nif (end_date - start_date).days < 1:\n    raise ValueError('Window too narrow; widen it to at least a few trading days')","typeGuard":"null","tryCatchPattern":"from openbb_core.provider.utils.errors import EmptyDataError\ntry:\n    res = obb.equity.discovery_filings(provider='fmp', start_date=s, end_date=e)\nexcept EmptyDataError:\n    res = []  # no filings in window is a normal outcome","preventionTips":["Default to a recent multi-week window instead of a single day","Treat EmptyDataError as an empty list in ingestion pipelines"],"tags":["fmp","empty-data","filings","date-range"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}