{"record":{"id":"057f2ff21b5e8884","repo":"OpenBB-finance/OpenBB","slug":"the-request-was-returned-empty-057f2f","errorCode":null,"errorMessage":"The request was returned empty.","messagePattern":"The request was returned empty\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/fmp/openbb_fmp/models/equity_screener.py","lineNumber":329,"sourceCode":"            query_dict[\"country\"] = country\n\n        query_str = (\n            get_querystring(query_dict, exclude=[\"query\"])\n            .replace(\"True\", \"true\")\n            .replace(\"False\", \"false\")\n        )\n        base_url = \"https://financialmodelingprep.com/stable/company-screener\"\n        url = f\"{base_url}?{query_str}&apikey={api_key}\"\n\n        return await get_data(url, **kwargs)  # type: ignore\n\n    @staticmethod\n    def transform_data(\n        query: FMPEquityScreenerQueryParams, data: list[dict], **kwargs: Any\n    ) -> list[FMPEquityScreenerData]:\n        \"\"\"Return the transformed data.\"\"\"\n        if not data:\n            raise EmptyDataError(\"The request was returned empty.\")\n        return [\n            FMPEquityScreenerData.model_validate(d)\n            for d in sorted(data, key=lambda x: x[\"marketCap\"], reverse=True)\n        ]\n","sourceCodeStart":311,"sourceCodeEnd":334,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/fmp/openbb_fmp/models/equity_screener.py#L311-L334","documentation":"Raised as EmptyDataError by FMPEquityScreener.transform_data when FMP's company-screener endpoint returned zero rows for the assembled query string. All parameter validation (industry/country/exchange, error 414-416) has already passed; this is FMP itself reporting no matches.","triggerScenarios":"Calling obb.equity.screener(provider=fmp, ...) with a filter combination that matches no companies - e.g. country='US' + industry='Banking' + marketCap below any listed bank, or mutually exclusive filters (mktcap min > max, country+exchange that never co-occur).","commonSituations":"Over-constrained screener filters, filter values valid but with empty intersection on FMP's dataset, API key/plan returning an empty payload for the screener endpoint, or FMP data gaps for small markets.","solutions":["Relax filters one at a time (drop country, then exchange, then industry) until rows return, then re-tighten","Sanity-check numeric filters: mktcap/price min/max must not be inverted or absurd","Verify the key/plan by running the same screener URL directly against FMP","Catch EmptyDataError and show 'no companies matched the criteria' instead of a stack trace"],"exampleFix":"# before\nres = obb.screener.equity(provider='fmp', country='US', industry='Banking', mktcap_min=10_000_000_000, mktcap_max=1_000)  # inverted -> empty\n\n# after\nres = obb.screener.equity(provider='fmp', country='US', industry='Banking', mktcap_min=1_000, mktcap_max=10_000_000_000)","handlingStrategy":"try-catch","validationCode":"# sanity-check numeric filters before the call\nif mktcap_min is not None and mktcap_max is not None and mktcap_min > mktcap_max:\n    raise ValueError('mktcap_min must be <= mktcap_max')","typeGuard":"null","tryCatchPattern":"from openbb_core.provider.utils.errors import EmptyDataError\ntry:\n    res = obb.screener.equity(provider='fmp', **filters)\nexcept EmptyDataError:\n    filters.pop('exchange', None)  # progressively relax\n    res = obb.screener.equity(provider='fmp', **filters)","preventionTips":["Validate min<=max on every numeric filter pair","Relax filters progressively instead of shooting one narrow combination","Treat EmptyDataError as 'no matches', distinct from auth/validation errors"],"tags":["fmp","empty-data","screener","filters"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}