{"record":{"id":"31a8d06f013f733d","repo":"OpenBB-finance/OpenBB","slug":"exchange-v-name-v-mic-is-not-supported-by","errorCode":null,"errorMessage":"Exchange '{v.name}' ({v.mic}) is not supported by FMP. Valid options: {', '.join(sorted(valid_exchanges)[:20])}...","messagePattern":"Exchange '(.+?)' \\((.+?)\\) is not supported by FMP\\. Valid options: (.+?)\\.\\.\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/fmp/openbb_fmp/models/equity_screener.py","lineNumber":191,"sourceCode":"        valid_countries = list(Countries.__args__)\n        if country_code not in valid_countries:\n            raise ValueError(\n                f\"Country '{v.name}' ({v.alpha_2}) is not supported by FMP. \"\n                f\"Valid options: {', '.join(sorted(valid_countries)[:20])}...\"\n            )\n        return v\n\n    @field_validator(\"exchange\", mode=\"after\")\n    @classmethod\n    def _validate_exchange(cls, v):\n        \"\"\"Validate exchange is supported by FMP.\"\"\"\n        if v is None:\n            return v\n        # Exchange stores MIC, FMP expects lowercase acronym\n        exchange_code = v.acronym.lower()\n        valid_exchanges = list(Exchanges.__args__)\n        if exchange_code not in valid_exchanges:\n            raise ValueError(\n                f\"Exchange '{v.name}' ({v.mic}) is not supported by FMP. \"\n                f\"Valid options: {', '.join(sorted(valid_exchanges)[:20])}...\"\n            )\n        return v\n\n\nclass FMPEquityScreenerData(EquityScreenerData):\n    \"\"\"FMP Equity Screener Data.\"\"\"\n\n    __alias_dict__ = {\n        \"name\": \"companyName\",\n        \"market_cap\": \"marketCap\",\n        \"last_annual_dividend\": \"lastAnnualDividend\",\n        \"exchange\": \"exchangeShortName\",\n        \"exchange_name\": \"exchange\",\n        \"is_etf\": \"isEtf\",\n        \"actively_trading\": \"isActivelyTrading\",\n    }","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/fmp/openbb_fmp/models/equity_screener.py#L173-L209","documentation":"A Pydantic field_validator ValueError on FMPEquityScreenerQueryParams.exchange: the Exchange object's lowercase acronym is checked against the FMP-supported exchange set (Exchanges Literal). Passing an exchange FMP does not serve (by MIC) is rejected client-side with the first 20 valid acronyms in the message.","triggerScenarios":"Calling obb.equity.screener(provider='fmp', exchange=...) with a valid MIC that has no FMP acronym mapping - obscure regional bourses, dark pools/MTFs (e.g. CHIX as an MTF code), or OTC venues.","commonSituations":"Porting screeners written against another data source with broader exchange coverage, MIC/acronym confusion (passing the MIC string where an Exchange is constructed, or vice versa), provider version changes to the Exchanges literal.","solutions":["Choose a supported exchange from the error message or from the Exchanges Literal in openbb_fmp.utils.references","Omit exchange and filter returned rows by their exchange field client-side","Catch the ValidationError and show the allowed exchange list in your UI/log"],"exampleFix":"# before\nres = obb.screener.equity(provider='fmp', exchange='CHIX')  # MTF not supported by FMP\n\n# after\nres = obb.screener.equity(provider='fmp', exchange='NASDAQ')\n# or post-filter\nall_res = obb.screener.equity(provider='fmp')\nchix_rows = [r for r in all_res.results if r.exchange and 'CHIX' in r.exchange]","handlingStrategy":"validation","validationCode":"from openbb_fmp.utils.references import Exchanges\nVALID_EXCHANGES = set(Exchanges.__args__)\nexch_acronym = 'NASDAQ'  # derived from the Exchange object's acronym.lower()\nif exch_acronym.lower() not in VALID_EXCHANGES:\n    exchange = None","typeGuard":"def is_supported_fmp_exchange(acronym: str) -> bool:\n    from openbb_fmp.utils.references import Exchanges\n    return acronym.lower() in Exchanges.__args__","tryCatchPattern":"from pydantic import ValidationError\ntry:\n    res = obb.screener.equity(provider='fmp', exchange=ex)\nexcept ValidationError:\n    res = obb.screener.equity(provider='fmp')  # filter returned rows by exchange client-side","preventionTips":["Source exchange options from the Exchanges literal, not a generic MIC list","Remember the validator matches on lowercase acronym, not the MIC","Post-filter by the exchange field when the target venue is unsupported"],"tags":["fmp","validation","screener","exchange","coverage"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}