Hey there, I haven’t been able to use my api token correctly for accessing S&P data from tiingo.com.
Here is my code. `
import requests
import pandas as pd
import pandas_datareader.data as web
import pandas_datareader.wb as wb
from fin_data_config import tiingo_token
import numpy as np
from datetime import datetime
import os
headers = {
'Content-Type': 'application/json',
'Authorization' : 'token {}'.format(tiingo_token)
}
requestResponse = requests.get("https://api.tiingo.com/api/test/",
headers=headers)
start = datetime(1999, 1, 1)
end = datetime(2019, 1, 1)
gold_data = pd.read_csv('/Users/trevorhegarty/my_code/finance/fin_capstone/gold_prices.csv')
google_data = pd.read_csv('/Users/trevorhegarty/my_code/finance/fin_capstone/google_stock.csv')
bit_data = pd.read_csv('/Users/trevorhegarty/my_code/finance/fin_capstone/bit_data.csv')
standars_poor_data = web.DataReader('S$P', 'tiingo', start, end)
`
Here is the response
" ValueError: The tiingo API key must be provided either through the api_key variable or through the environmental variable TIINGO_API_KEY."
Many thanks