OpenBB-finance/OpenBB · error · OpenBBError
Error: No {target} field found.
Error message
Error: No {target} field found. What it means
Thrown by the options screening endpoint in openbb_derivatives when the `target` column (the metric to filter or rank strikes by, e.g. 'volume', 'open_interest', 'delta') is not present in the assembled options chains DataFrame. The router copies the provider data into a DataFrame and requires that the chosen target field exists as a column before it can query `\`{target}\` > 0`. It is wrapped in OpenBBError so it surfaces uniformly through the OBBject pipeline.
Source
Thrown at openbb_platform/extensions/derivatives/openbb_derivatives/options/options_router.py:173
elif isinstance(data, list):
if all(isinstance(d, dict) for d in data):
df = DataFrame(data)
elif all(isinstance(d, Data) for d in data):
df = DataFrame([d.model_dump(exclude_none=True, exclude_unset=True) for d in data]) # type: ignore
options = DataFrame(df.copy())
last_price = underlying_price or options.underlying_price.iloc[0] # type: ignore
if last_price is None:
raise OpenBBError(
ValueError(
"Last price must be provided for options filtering, and was not found in the data."
)
)
if target not in options.columns: # type: ignore
raise OpenBBError(f"Error: No {target} field found.")
if "dte" not in options.columns: # type: ignore
options.dte = (options.expiration - datetime.today().date()).days # type: ignore
calls = options.query(f"`option_type` == 'call' and `dte` >= 0 and `{target}` > 0") # type: ignore
puts = options.query(f"`option_type` == 'put' and `dte` >= 0 and `{target}` > 0") # type: ignore
if oi:
calls = calls[calls["open_interest"] > 0]
puts = puts[puts["open_interest"] > 0]
if volume:
calls = calls[calls["volume"] > 0]
puts = puts[puts["volume"] > 0]
if dte_min is not None:
calls = calls.query("dte >= @dte_min") # type: ignore
puts = puts.query("dte >= @dte_min") # type: ignore
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Inspect the available columns first: run res = obb.derivatives.options.chains(symbol, provider); print(res.to_df().columns) and pick a target from that list.
- Pass a target that is universally present, such as 'volume' or 'open_interest', or request a provider/quote that returns the greek you need.
- Correct typos in the target parameter (it is case-sensitive snake_case, e.g. 'open_interest' not 'OpenInterest').
- If using the Python function directly with a custom DataFrame, ensure the column exists before calling the router.
Example fix
# before
res = obb.derivatives.options.screen(symbol='AAPL', target='gamma', provider='cboe') # gamma not returned
# after
df = obb.derivatives.options.chains('AAPL', provider='cboe').to_df()
print(df.columns) # pick an existing column, e.g. 'delta'
res = obb.derivatives.options.screen(symbol='AAPL', target='delta', provider='cboe') Defensive patterns
Strategy: validation
Validate before calling
from openbb import obb
res = obb.derivatives.options.chains('AAPL', provider='cboe')
cols = set(res.to_df().columns)
target = 'delta'
assert target in cols, f'target {target!r} not in {sorted(cols)}' Type guard
def has_target_column(df, target: str) -> bool:
"""True if the chains DataFrame exposes the target metric column."""
return isinstance(df, object) and hasattr(df, 'columns') and target in df.columns Try / catch
from openbb_core.app.model.abstract.error import OpenBBError
try:
res = obb.derivatives.options.screen(symbol='AAPL', target=target)
except OpenBBError as e:
if 'No' in str(e) and 'field found' in str(e):
# pick a fallback target that exists in the data
... Prevention
- Always list res.to_df().columns before choosing the target parameter.
- Prefer universally available targets like 'volume' or 'open_interest'.
- Pin provider versions so returned field sets stay stable.
When it happens
Trigger: Calling obb.derivatives.options.screen() (or the underlying filter logic) with target='gamma' when the fetched chains only contain delta/iv/volume/open_interest; using a target field name that the selected provider does not return; passing a custom Data model whose fields lack the target name.
Common situations: Provider-specific field availability (e.g. intrinio vs cboe vs tradier expose different greeks), typos in the target parameter, using an expired field name after a schema refactor, or filtering on a computed column that was never added to the DataFrame.
Related errors
- Error: Moneyness must be expressed as a percentage between 0
- Error: option_type must be either 'call' or 'put'
- Error: No premium data found for the selected strikes. Call:
- Error: No premium data found for the selected strikes. Call:
- No data to process!
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/951455ab8e14b292.
Report an issue: GitHub.