Skip to main content

Basic Response

The output of every command is an object which contains the results of the request, along with additional information. It is a custom class, OBBject, and always returns with the fields listed below:

id: ...                 # UUID Tag
results: ... # Serializable results.
provider: ... # Provider name.
warnings: ... # List of warnings.
chart: ... # Chart object.
extra: ... # Extra info.
from openbb import obb

data = obb.equity.price.historical("SPY", provider="polygon")

data
OBBject

id: 06520558-d54a-7e53-8000-7aafc8a42694
results: [{'date': datetime.datetime(2022, 10, 5, 0, 0), 'open': 375.62, 'high': 37...
provider: polygon
warnings: None
chart: None
extra: {'metadata': {'arguments': {'provider_choices': {'provider': 'polygon'}, 'st...

Additional class methods are helpers for converting the results to a variety of formats.

  • to_dict(): converts to a dictionary, accepting all standard "orientation" parameters, i.e., "records"
  • to_df() / to_dataframe(): converts to a Pandas DataFrame.
  • to_numpy(): converts to a Numpy array.
  • to_polars(): converts to a Polars table.
info

The preferred output type can be set with a user preference.

obb.user.preferences.output_type="dataframe"