OpenBB-finance/OpenBB · error · OpenBBError

multiple items not allowed

Error message

multiple items not allowed

What it means

OpenBBError from check_single_item, a parameter sanitizer used by commands that accept exactly one symbol/item (in contrast to batch endpoints). It rejects any string containing a comma or semicolon - the delimiters OpenBB uses for multi-item lists - so 'AAPL,MSFT' cannot silently pass where one item is required.

Source

Thrown at openbb_platform/core/openbb_core/app/utils.py:192

    with open(file) as settings_file:
        contents = settings_file.read()

    try:
        settings = json.loads(contents)["preferences"]
    except KeyError:
        settings = None
    cache_dir = (
        settings["cache_directory"]
        if settings and "cache_directory" in settings
        else Preferences().cache_directory
    )
    return cache_dir


def check_single_item(value: str | None, message: str | None = None) -> str | None:
    """Check that string contains a single item."""
    if value and isinstance(value, str) and ("," in value or ";" in value):
        raise OpenBBError(message if message else "multiple items not allowed")
    return value

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Pass a single item with no delimiters: symbol='AAPL'
  2. If batch is supported, use a real list: symbol=['AAPL','MSFT'] - check the command signature
  3. Loop over your tickers and call the single-symbol endpoint per ticker

Example fix

# before
res = obb.equity.profile(symbol='AAPL,MSFT')

# after
res = [obb.equity.profile(symbol=t) for t in ('AAPL', 'MSFT')]
Defensive patterns

Strategy: validation

Validate before calling

def is_single_item(value: str) -> bool:
    return isinstance(value, str) and ',' not in value and ';' not in value

Type guard

def is_single_symbol(s) -> bool:
    return isinstance(s, str) and ',' not in s and ';' not in s and len(s) > 0

Try / catch

from openbb_core.app.model.abstract.error import OpenBBError

symbols = ['AAPL', 'MSFT']
results = []
for s in symbols:
    try:
        results.append(obb.equity.profile(symbol=s))
    except OpenBBError as e:
        if 'multiple items' in str(e):
            results.extend(obb.equity.profile(symbol=x) for x in s.split(','))
        else:
            raise

Prevention

When it happens

Trigger: Calling single-symbol endpoints with a list-style string, e.g. obb.equity.profile(symbol='AAPL,MSFT') or obb.fixedincome.rate.snapshot(symbol=';'.join(tickers)); some router commands apply this check via their params model to enforce one-at-a-time semantics.

Common situations: Copy-pasting a watchlist into a single-symbol field; assuming all endpoints are batch-capable like equity.price.historical(symbol=['AAPL','MSFT']); semicolon-separated CSV input from spreadsheets.

Related errors


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