* I missed some sheet_name ones :) * Move quote to main menu and combine yahoo finance commands * Update stocks for quote * First update to move yfinance away from main functionality * Small updates * Update tests to reflect changes * Fix some little things * Update docs a little too * Remove the Due Diligence menu * Update tests for new change * Update fa and stocks with new text and move some stuff around * Bye bye dd * Pls work * work.. * work.. * work.. * Work..| * Add tests back in * Remove tests * Fix fix fix * Remove tests to fix conflicts * Improve the `stocks/search` command (#4084) * Improve search command * Make it more intuitive * Fix tests * Update the docs * Ok done * Ok done 2 * Ok done 3 * Git update tests that failed * Update commands with --sheet-name that didn't work (#4088) * Update commands with --sheet-name that didn't work * Fix test * oops * Adds auto completion to `news` (#4089) * Fix plot look when using eval and add query to choices (#3881) * convert index to datetime and update choices * uncomment economy integration test * fix treasury concat bug * fix datasets concat on duplciates * Lock ruff version so that new lints dont break our CI (#3905) * Lock ruff version so that new lints dont break our CI * Bumped pre-commit ruff version * returning always a dataframe * Revert "returning always a dataframe" This reverts commitd5dbf3132f. * quick fix to auto complete args --------- Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> * Hotfix/Windows-CLI (#4087) * init * Update windows10_build.yml * Update windows10_build.yml * Update windows10_build.yml * Update windows10_build.yml * Update windows10_build.yml * Update windows10_build.yml * oops --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Adds end date to `forex/load` (#4077) * Fix plot look when using eval and add query to choices (#3881) * convert index to datetime and update choices * uncomment economy integration test * fix treasury concat bug * fix datasets concat on duplciates * Lock ruff version so that new lints dont break our CI (#3905) * Lock ruff version so that new lints dont break our CI * Bumped pre-commit ruff version * returning always a dataframe * Revert "returning always a dataframe" This reverts commitd5dbf3132f. * adding end date to the forex load * added some tests * added example * always show msg * rewriting test * updating tests * updating tests * Redo load tests --------- Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> * Update tests to reflect changes * work.. * Remove tests * Fix fix fix * Remove tests * Update the whole test folder * Small updates * Revert change * Update eodhd to reflect it requires a paid plan and update tests * Fix all the tests * Update tests * Update integration tests * Removing tests so no whining happens * ADD ALL THE TESTS * Fix linting * gitignore. thanks jer * Add back dd and redirect to fa * Update to just display a message * Update OpenBB SDK commands * Fixing issues with exporting * Fix ruff messing up * Fix tests * Fix the tests by disabling isort to run on tests folder --------- Co-authored-by: Jeroen Bouma <jeroenbouma@Jeroens-MacBook-Pro.local> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Co-authored-by: teh_coderer <me@tehcoderer.com>
31 KiB
Vendored
title, sidebar_position, description, keywords
| title | sidebar_position | description | keywords | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Set API Keys | 1 | With the OpenBB SDK you can define your, often free, API key from various platforms like Alpha Vantage, FRED, IEX, Twitter, DeGiro, Binance and Coinglass. An API key is a set of random characters provided to you by a third party vendor that allows you to access data via their API endpoints. API keys can be managed directly from the SDK environment. |
|
Accessing API Keys
With the OpenBB SDK you can define your, often free, API key from various platforms like Alpha Vantage, FRED, IEX, Twitter, DeGiro, Binance and Coinglass. An API key is a set of random characters provided to you by a third party vendor that allows you to access data via their API endpoints. API keys can be managed directly from the SDK environment. If there is already a Terminal installation configured with API keys, they will be recognized by the SDK. Find the complete list of options below:
Summary of API Key Providers
Their status can be verified with the line of code below.
from openbb_terminal.sdk import openbb
openbb.keys.mykeys(show = True)
Removing show = True from the syntax will hide the values for the keys, as shown in the table below.
| API | Key |
|---|---|
| BINANCE_KEY | ******* |
| BINANCE_SECRET | ******* |
| BITQUERY_KEY | ******* |
| CMC_KEY | ******* |
Individual keys are entered like this example:
obb.keys.fred(
key = 'replace_me',
persist = True,
)
The required fields for each source will vary, print the docstring for each to know the required inputs.
help(openbb.keys.reddit)
Help on Operation in module openbb_terminal.core.library.operation:
<openbb_terminal.core.library.operation.Operation object>
Set Reddit key
Parameters
----------
client_id: str
Client ID
client_secret: str
Client secret
password: str
User assword
username: str
User username
useragent: str
User useragent
persist: bool
If False, api key change will be contained to where it was changed. For example, Jupyter notebook.
If True, api key change will be global, i.e. it will affect terminal environment variables.
By default, False.
show_output: bool
Display status string or not. By default, False.
Returns
-------
str
Status of key set
In cases where API credentials must be passed to another process, use the following import statement:
from openbb_terminal import config_terminal as cfg
Values can then be passed to a request URL as a variable, f"{cfg.API_KEY_QUANDL}"
The code block below will authorize Quandl to request data from Nasdaq Data Link. The series in the example is for the historical price of gold.
import quandl
from openbb_terminal import config_terminal as cfg
gold = quandl.get("LBMA/GOLD", collapse="monthly", transform="", index_col=0, order="desc", parse_dates=True, authtoken=f"{cfg.API_KEY_QUANDL}")
| Date | USD (AM) | USD (PM) | GBP (AM) | GBP (PM) | EURO (AM) | EURO (PM) |
|---|---|---|---|---|---|---|
| 2022-11-30 00:00:00 | 1757.35 | 1768.9 | 1491.46 | 1506.57 | 1704.98 | 1714.06 |
| 2022-10-31 00:00:00 | 1638.85 | 1639 | 1419.74 | 1425.27 | 1649.5 | 1656.87 |
| 2022-09-30 00:00:00 | 1672.75 | 1671.75 | 1495.94 | 1502.4 | 1703.7 | 1710.53 |
| 2022-08-31 00:00:00 | 1712.4 | 1715.9 | 1472.15 | 1478.08 | 1713.6 | 1715.21 |
| 2022-07-31 00:00:00 | 1758.9 | 1753.4 | 1447.4 | 1451.64 | 1724.07 | 1725.7 |
To make a backup file containing all stored keys, use the code block below.
df_keys = openbb.keys.mykeys(show = True)
df_keys.to_csv('backup.csv')
How to obtain the API Key from each source
This section covers all API keys listed above and include detailed instructions how to obtain each API key. By clicking on each name, the section will expand and instructions are provided.
AlphaVantage
Go to https://www.alphavantage.co/support/#api-key. You will be greeted with the following screen:
Once you enter the type of investor you are, the organization you work at and your email address pressing "GET FREE API KEY" gets you the key that you can submit into the OpenBB SDK with openbb.keys.av
Binance
Go to https://www.binance.com/en/support/faq/how-to-create-api-360002502072. You will be greeted with the following screen:These instructions should provide clear guidance how to set up an API Key. Enter this API key into the OpenBB SDK by typing openbb.keys.binance.
Bitquery
Go to https://bitquery.io/. You will be greeted with the following screen:
Click "Try GraphQL API". This opens the following screen:
After creating an account and verifying your email address, you will be able to access your API Key by clicking "Api Key". Enter this API key into the OpenBB SDK by typing openbb.keys.bitquery.
CoinMarketCap
Go to https://coinmarketcap.com/api. You will be greeted with the following screen:
From here, click "Get Your Free API Key Now". This opens up the following screen:
Once you have created an account, you will be able to find your API key in the following screen. Enter this API key into the OpenBB SDK by typing openbb.keys.cmc
CoinBase
Go to https://help.coinbase.com/en/exchange/managing-my-account/how-to-create-an-api-key. You will be greeted with the following screen:
By following these instructions you should be able to set-up an API Key. Enter this API key into the OpenBB SDK by typing openbb.keys.coinbase.
Coinglass
Go to https://www.coinglass.com/. You will be greeted with the following screen:
Click "Log in" and sign up for an account. This opens up the following screen:
Once you created your account, you will be able to find the API Key on your profile. Enter this API key into the OpenBB SDK by typing openbb.keys.coinglass.
Crypto Panic
Go to https://cryptopanic.com/developers/api/. You will be greeted with the following screen:
Click "Sign up" under "Your free API auth token". This opens up the following screen:
Once you have created your account, your API Key will be displayed under "Your free API auth token". Enter this API key into the OpenBB SDK by typing openbb.keys.cpanic.
DeGiro
Go to https://www.degiro.com/. You will be greeted with the following screen:
Click "Sign up" and go to the registrations process. After setting up your account you will be able to use this broker by entering your username and password in the OpenBB SDK as follows openbb.keys.degiro. We also support 2FA, you can find more information about that here.
EODHD
Go to https://eodhistoricaldata.com/r/?ref=869U7F4J. You will be greeted with the following screen:
Click "Registration". This opens up the following screen:
Once you have registered, you can find the API Key next to "API TOKEN". Enter this API key into the OpenBB SDK by typing openbb.keys.cpanic.
Finnhub
Go to https://finnhub.io/. You will be greeted with the following screen:
Press "Get free api key". This opens up the following screen:
Once you have created an account, you will be able to find your API key in the following screen. Enter this API key into the OpenBB SDK by typing openbb.keys.finnhub
Financial Modelling Prep
Go to https://site.financialmodelingprep.com/developer/docs/. You will be greeted with the following screen:
From here, press "Get my API KEY here". This opens up the following screen:
If you already have an account, you can sign-in directly and obtain the API key, otherwise click "Sign Up". Once you have created an account you can access your API Key by pressing the "Dashboard" button which will show the API key. Enter this API key into the OpenBB SDK by typing openbb.keys.fmp
FRED
Go to https://fred.stlouisfed.org. You will be greeted with the following screen:
Click on "My Account". This opens up the following screen:
Once you have signed up, go to "My Account" and select "API Keys". This will get you to the following screen:
Click on "Request API Key" and fill in information about why you wish to use FRED. Then, by pressing "Request API key" you will be able to obtain the API key. Enter this API key into the OpenBB SDK by typing openbb.keys.fred
GitHub
Go to https://github.com/. You will be greeted with the following screen:
Click "Sign up" and create an account with GitHub. Once you have done so go to as depicted below: https://github.com/settings/apps
Press "New GitHub App". This opens up the following screen:
Once the app is created you are able to obtain the API Key. Enter this API key into the OpenBB SDK by typing openbb.keys.github.
Glassnode
Go to https://studio.glassnode.com/. You will be greeted with the following screen:
Click on "Sign up". This opens up the following screen:
After you have created your account, go to https://studio.glassnode.com/settings/api where you can create your API Key. Enter this API key into the OpenBB SDK by typing openbb.keys.glassnode.
IEX Cloud
Go to https://iexcloud.io/. You will be greeted with the following screen:
Press "Sign in". This opens up the following screen:
Once you have signed up you are asked what kind of plan you would like. You have the option to start a free plan at the bottom.
Once you have confirmed you email address, you can find your API Key under "Access & Security". Enter this API key into the OpenBB SDK by typing openbb.keys.iex
Messari
Go to https://messari.io/. You will be greeted with the following screen:
Press "Sign up". This opens up the following screen:
Once you have signed up, go to https://messari.io/account/api where you will be able to find your API Key. Enter this API key into the OpenBB SDK by typing openbb.keys.messari.
News API
Go to https://newsapi.org/. You will be greeted with the following screen:
Press "Get API Key". This opens up the following screen:
Register for an account. The next screen will provide you with the API Key. Enter this API key into the OpenBB SDK by typing openbb.keys.news
Oanda
Go to https://developer.oanda.com. You will be greeted with the following screen:
After you have created an account with Oanda, you will be able to find the API key by following the steps below. After setting up your account you will be able to use this broker by entering your username and password in the OpenBB SDK as follows openbb.keys.oanda.
Polygon
Go to https://polygon.io. You will be greeted with the following screen:
Press the button "Get your Free API Key". This opens up the following screen:
Once signed up you will find the API Key at the bottom. Enter this API key into the OpenBB SDK by typing openbb.keys.polygon
Quandl
Go to https://www.quandl.com. You will be greeted with the following screen:
From here, click "Sign Up" at the top. This opens up the following screen:
Follow the sign-up instructions and once you have signed up you will be able to retrieve your API key. Enter this API key into the OpenBB SDK by typing openbb.keys.quandl
Go to https://www.reddit.com/wiki/api. You will be greeted with the following screen:
Press "Read the full API terms and sign up for usage" and start the sign-up process. This opens up the following screen:
Once you have filled out everything, you will receive an email when your application is approved. Once this is approved you will receive the necessary information that needs to be entered in the OpenBB SDK. Enter these into the OpenBB SDK by typing openbb.keys.reddit.
Robinhood
Go to https://robinhood.com/us/en/. You will be greeted with the following screen:
Click "Sign up" and go to the registrations process. After setting up your account you will be able to use this broker by entering your username and password in the OpenBB SDK as follows openbb.keys.rh.
Santiment
Go to https://app.santiment.net/. You will be greeted with the following screen:
Click "Sign up". This opens up the following screen:
After creating an account go to https://app.santiment.net/account#api-keys and generate a key. Enter this API key into the OpenBB SDK by typing openbb.keys.santiment.
ShroomDK
Go to https://app.santiment.net/. You will be greeted with the following screen:
Click "Mint Your ShroomDK API Key" and sign up for an account. This opens up the following screen:
Once you have your account created, connect a wallet and access the API Key. Enter this API key into the OpenBB SDK by typing openbb.keys.shroom.
Stocksera
Go to https://stocksera.pythonanywhere.com/. You will be greeted with the following screen:
Click "Log in" and create an account. This opens up the following screen:
Once you have created an account, go to "Developers" to access your API Key. Enter this API key into the OpenBB SDK by typing /openbb.keys.stocksera.
Token Terminal
Go to https://tokenterminal.com/. You will be greeted with the following screen:
Click "Log in" and sign up for an account. This opens up the following screen:
Once you have created an account, go to "API" to access your API Key. Enter this API key into the OpenBB SDK by typing openbb.keys.tokenterminal.
Tradier
Go to https://documentation.tradier.com/. You will be greeted with the following screen:
Click the button "Open Account" and start the sign-up process. Once you have gone through the whole process you will be able to find your API key within your account. Enter this API key into the OpenBB SDK by typing openbb.keys.tradier
Go to https://developer.twitter.com. You will be greeted with the following screen:
Click "Sign Up". Note that you are required to have a Twitter account and that you have verified your phone number. This opens up the following screen:
Create an account and verify your email. Then, you will be able to create an app to obtain your API Key.
This will give you the following keys. Enter these into the OpenBB SDK by typing openbb.keys.twitter.
Whale Alert
Go to https://docs.whale-alert.io/. You will be greeted with the following screen:
Click "sign up here". This opens up the following screen:
Once you have created your account, click "Create" to create your own API Key. Enter this API key into the OpenBB SDK by typing openbb.keys.walert.










































































