I must be making very simple mistake which I haven't been able to figure out for hours. I am referencing Alpaca API Doc and trying to follow. The code is shown below trying to get the 5 min historical bar on the TSLA as the test purposes which I failed. See below code.
import config, requests, json
# QUOTE_URL = 'https://data.alpaca.markets/v2/stocks/TSLA/quotes'
# LATESTBAR_URL = 'https://data.alpaca.markets/v2/stocks/tsla/bars/latest'
BARS_URL = 'https://data.alpaca.markets/v2/stocks/tsla/bars'
timeframe = '?timeframe=5Min'
BARS_URL = BARS_URL+timeframe
# r = requests.get(QUOTE_URL, headers=config.HEADERS)
# r2 = requests.get(LATESTBAR_URL, headers=config.HEADERS)
r3 = requests.get(BARS_URL, headers=config.HEADERS)
print(json.dumps(r3.json(), indent=4))
The result I get is shown below:
{
"bars": null,
"symbol": "TSLA",
"next_page_token": null
}