API token function

Hello, Im in Section 5 Unit 7, how can I go about having NOT to add my IEXfinance API token to every call?



Is there a function that I can define for the API call? Im pretty sure it wasnt covered in the previous sections of the Python course…



Tnx

If you have the latest version of iexfinance then you need to have an API key. You can get an API key by login here. After logging in you can find API Tokens on the left side. After getting the API key, use this code.



data = get_historical_data('stock_ticker', output_format='pandas', token='Your API key') 



If you don't want to use the API key then you have to downgrade the iexfinance version to 0.3.5. This can be done using this code:



!pip install iexfinance==0.3.5



After downgrading your version you can import data from iexfinance without an API key.







 

Great…Thank you