mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 13:01:38 +00:00
* This change creates a PR * start moving stuff around * data_models/_category_.json * reference/_category_.json * moving some stuff around * Introduction * Documentation updates * few broken links, clean up sidebar titles for how-to * codespell * quickstart - new provider extension * add a comment * map provider interface * quickstart for new router extension * [Docs] diataxis refactor refactor (#6425) * Start refactor * Edits * [DOCS] Reorganize and edit. Fix sidebar navigation (#6445) * Reorganize and edit. Fix sidebar navigation * Fix broken linkages * Edit --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * Fix links --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Fix broken links * Reword CLA part in the Licensing FAQ * change titles and order suggestion - cc @IgorWounds @piiq --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: hjoaquim <henriquecjoaquim@gmail.com>
67 lines
1.8 KiB
Plaintext
Vendored
67 lines
1.8 KiB
Plaintext
Vendored
---
|
|
title: Basic Response
|
|
sidebar_position: 2
|
|
description: This page details the basic response and output that can be expected to be received from the the OpenBB Platform.
|
|
keywords:
|
|
- tutorial
|
|
- standardized output
|
|
- OBBject
|
|
- basic response
|
|
- provider
|
|
- results
|
|
- warnings
|
|
- chart
|
|
- extra
|
|
- command coverage
|
|
---
|
|
|
|
import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
|
|
|
|
<HeadTitle title="Basic Response - Usage | OpenBB Platform Docs" />
|
|
|
|
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:
|
|
|
|
```console
|
|
id: ... # UUID Tag
|
|
results: ... # Serializable results.
|
|
provider: ... # Provider name.
|
|
warnings: ... # List of warnings.
|
|
chart: ... # Chart object.
|
|
extra: ... # Extra info.
|
|
```
|
|
|
|
```python
|
|
from openbb import obb
|
|
|
|
data = obb.equity.price.historical("SPY", provider="polygon")
|
|
|
|
data
|
|
```
|
|
|
|
```console
|
|
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.
|
|
|
|
```python
|
|
obb.user.preferences.output_type="dataframe"
|
|
```
|
|
|
|
:::
|