{"record":{"id":"2023abf69ffec81a","repo":"OpenBB-finance/OpenBB","slug":"invalid-value-item-for-field-provider","errorCode":null,"errorMessage":"Invalid value '{item}' for '{field}' (provider: '{provider}'). Must be one of: {choices}","messagePattern":"Invalid value '(.+?)' for '(.+?)' \\(provider: '(.+?)'\\)\\. Must be one of: (.+?)","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/core/openbb_core/app/static/utils/filters.py","lineNumber":66,"sourceCode":"                        check_single_item(\n                            new,\n                            f\"{field} -> multiple items not allowed for '{provider}'\",\n                        )\n\n                    choices = (\n                        provider_properties.get(\"choices\")\n                        if isinstance(provider_properties, dict)\n                        else None\n                    )\n                    if choices:\n                        items = (\n                            [s.strip() for s in new.split(\",\")]\n                            if isinstance(new, str) and \",\" in new\n                            else [new]\n                        )\n                        for item in items:\n                            if item not in choices:\n                                raise OpenBBError(\n                                    f\"Invalid value '{item}' for '{field}'\"\n                                    f\" (provider: '{provider}').\"\n                                    f\" Must be one of: {choices}\"\n                                )\n\n                    kwargs[p][field] = new\n                    break\n    else:\n        provider = kwargs.get(\"provider_choices\", {}).get(\"provider\")\n        for param_category in (\"standard_params\", \"extra_params\"):\n            if param_category in kwargs:\n                for field, value in kwargs[param_category].items():\n                    if isinstance(value, list):\n                        kwargs[param_category][field] = \",\".join(map(str, value))\n                    check_single_item(\n                        kwargs[param_category][field],\n                        f\"{field} -> multiple items not allowed for '{provider}'\",\n                    )","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/core/openbb_core/app/static/utils/filters.py#L48-L84","documentation":"OpenBBError raised by the extra-params filter (openbb_core/app/static/utils/filters.py) when a provider-specific parameter value is not in the provider's declared 'choices' list for that field. The filter splits comma-separated strings into items and validates each against provider_properties['choices'] before forwarding kwargs to the provider.","triggerScenarios":"Passing a provider-specific argument with an invalid enum value, e.g. obb.equity.fundamental.income(symbol='AAPL', provider='fmp', period='yearly') where the provider only accepts choices like ('annual','quarter'); comma-lists where any single item is not in choices also fail.","commonSituations":"Using another provider's vocabulary for a shared concept (yearly vs annual vs FY); guessing parameter values instead of checking the command signature; provider package update that renamed allowed choices; copy-pasting example code written for a different provider.","solutions":["Use one of the values listed in the error's 'Must be one of: (...)' message","Inspect allowed choices before calling: obb.coverage.command.get('...') or the command's /schema endpoint / help signature","Update the provider package if docs say new choices were added (pip install -U openbb-fmp)"],"exampleFix":"# before\nres = obb.equity.fundamental.income('AAPL', provider='fmp', period='yearly')\n\n# after\nres = obb.equity.fundamental.income('AAPL', provider='fmp', period='annual')","handlingStrategy":"validation","validationCode":"from openbb import obb\n\ndef get_choices(command_path: str, param: str) -> tuple | None:\n    # obb.coverance/command schema exposes provider parameter details\n    cmd = obb.coverage\n    return None  # inspect /schema endpoint or command docstring for choices","typeGuard":"def valid_choice(value: str, choices: tuple) -> bool:\n    return value in choices","tryCatchPattern":"from openbb_core.app.model.abstract.error import OpenBBError\n\ntry:\n    res = obb.equity.fundamental.income('AAPL', provider='fmp', period=p)\nexcept OpenBBError as e:\n    if 'Must be one of' in str(e):\n        p = 'annual'  # fallback to a known-valid choice\n        res = obb.equity.fundamental.income('AAPL', provider='fmp', period=p)\n    else:\n        raise","preventionTips":["Read the command's parameter schema (docs or /schema endpoint) for allowed choices","Never reuse one provider's enum vocabulary with another provider","Centralize provider-specific defaults in config instead of scattering literals"],"tags":["openbb","validation","params","provider-choices"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}