Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openbb

Package Overview
Dependencies
Maintainers
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openbb

Investment research for everyone, anywhere.

  • 4.3.5
  • PyPI
  • Socket score

Maintainers
4

OpenBB Platform

Downloads LatestRelease

OpenBB is committed to build the future of investment research by focusing on an open source infrastructure accessible to everyone, everywhere.
OpenBBLogo
Check our website at openbb.co

Overview

The OpenBB Platform provides a convenient way to access raw financial data from multiple data providers. The package comes with a ready to use REST API - this allows developers from any language to easily create applications on top of OpenBB Platform.

Please find the complete documentation at docs.openbb.co.

Installation

The command below provides access to the core functionalities behind the OpenBB Platform.

pip install openbb

This will install the following data providers:

These packages are what will be installed when pip install openbb is run

Extension NameDescriptionInstallation CommandMinimum Subscription Type Required
openbb-benzingaBenzinga data connectorpip install openbb-benzingaPaid
openbb-blsBureau of Labor Statistics data connectorpip install openbb-blsFree
openbb-cftcCommodity Futures Trading Commission data connectorpip install openbb-cftcFree
openbb-econdbEconDB data connectorpip install openbb-econdbNone
openbb-imfIMF data connectorpip install openbb-imfNone
openbb-fmpFMP data connectorpip install openbb-fmpFree
openbb-fredFRED data connectorpip install openbb-fredFree
openbb-intrinioIntrinio data connectorpip install openbb-intrinioPaid
openbb-oecdOECD data connectorpip install openbb-oecdFree
openbb-polygonPolygon data connectorpip install openbb-polygonFree
openbb-secSEC data connectorpip install openbb-secNone
openbb-tiingoTiingo data connectorpip install openbb-tiingoFree
openbb-tradingeconomicsTradingEconomics data connectorpip install openbb-tradingeconomicsPaid
openbb-yfinanceYahoo Finance data connectorpip install openbb-yfinanceNone

Community Providers

These packages are not installed when pip install openbb is run. They are available for installation separately or by running pip install openbb[all]

Extension NameDescriptionInstallation CommandMinimum Subscription Type Required
openbb-alpha-vantageAlpha Vantage data connectorpip install openbb-alpha-vantageFree
openbb-biztocBiztoc News data connectorpip install openbb-biztocFree
openbb-cboeCboe data connectorpip install openbb-cboeNone
openbb-ecbECB data connectorpip install openbb-ecbNone
openbb-federal-reserveFederal Reserve data connectorpip install openbb-federal-reserveNone
openbb-finraFINRA data connectorpip install openbb-finraNone / Free
openbb-finvizFinviz data connectorpip install openbb-finvizNone
openbb-government-usUS Government data connectorpip install openbb-us-governmentNone
openbb-nasdaqNasdaq Data Link connectorpip install openbb-nasdaqNone / Free
openbb-seeking-alphaSeeking Alpha data connectorpip install openbb-seeking-alphaNone
openbb-stockgridStockgrid data connectorpip install openbb-stockgridNone
openbb-tmxTMX data connectorpip install openbb-tmxNone
openbb-tradierTradier data connectorpip install openbb-tradierNone
openbb-wsjWall Street Journal data connectorpip install openbb-wsjNone
To install extensions that expand the core functionalities specify the extension name or use all to install all.
# Install a single extension, e.g. openbb-charting and yahoo finance
pip install openbb[charting]
pip install openbb-yfinance

Alternatively, you can install all extensions at once.

pip install openbb[all]

Note: These instruction are specific to v4. For installation instructions and documentation for v3 go to our website.

Python

>>> from openbb import obb
>>> output = obb.equity.price.historical("AAPL")
>>> df = output.to_dataframe()
>>> df.head()
              open    high     low  ...  change_percent             label  change_over_time
date                                ...
2022-09-19  149.31  154.56  149.10  ...         3.46000  September 19, 22          0.034600
2022-09-20  153.40  158.08  153.08  ...         2.28000  September 20, 22          0.022800
2022-09-21  157.34  158.74  153.60  ...        -2.30000  September 21, 22         -0.023000
2022-09-22  152.38  154.47  150.91  ...         0.23625  September 22, 22          0.002363
2022-09-23  151.19  151.47  148.56  ...        -0.50268  September 23, 22         -0.005027

[5 rows x 12 columns]

API keys

To fully leverage the OpenBB Platform you need to get some API keys to connect with data providers. Here are the 3 options on where to set them:

  1. OpenBB Hub
  2. Runtime
  3. Local file

1. OpenBB Hub

Set your keys at OpenBB Hub and get your personal access token from https://my.openbb.co/app/platform/pat to connect with your account.

>>> from openbb import obb
>>> openbb.account.login(pat="OPENBB_PAT")

>>> # Persist changes in OpenBB Hub
>>> obb.account.save()

2. Runtime

>>> from openbb import obb
>>> obb.user.credentials.fmp_api_key = "REPLACE_ME"
>>> obb.user.credentials.polygon_api_key = "REPLACE_ME"

>>> # Persist changes in ~/.openbb_platform/user_settings.json
>>> obb.account.save()

3. Local file

You can specify the keys directly in the ~/.openbb_platform/user_settings.json file.

Populate this file with the following template and replace the values with your keys:

{
  "credentials": {
    "fmp_api_key": "REPLACE_ME",
    "polygon_api_key": "REPLACE_ME",
    "benzinga_api_key": "REPLACE_ME",
    "fred_api_key": "REPLACE_ME"
  }
}

REST API

The OpenBB Platform comes with a ready to use REST API built with FastAPI. Start the application using this command:

uvicorn openbb_core.api.rest_api:app --host 0.0.0.0 --port 8000 --reload

API documentation is found under "/docs", from the root of the server address, and is viewable in any browser supporting HTTP over localhost, such as Chrome.

Check openbb-core README for additional info.

Install for development

To develop the OpenBB Platform you need to have the following:

  • Git
  • Python 3.9 or higher
  • Virtual Environment with poetry installed
    • To install these packages activate your virtual environment and run pip install poetry toml

How to install the platform in editable mode?

  1. Activate your virtual environment
  2. Navigate into the openbb_platform folder
  3. Run python dev_install.py to install the packages in editable mode

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc