alpacahq / Alpaca-API

The Alpaca API is a developer interface for trading operations and market data reception through the Alpaca platform.
https://alpaca.markets/
143 stars 13 forks source link

Alpaca data API on v1 but python client already updated to v2 #124

Closed deuce14 closed 4 years ago

deuce14 commented 4 years ago

Hey team,

Just wanted to point out that I know the data API (https://data.alpaca.markets) is still on v1 and hasn't been transitioned over to v2 like live and paper trading, however I installed the alpaca_trade_api for Python and when I place a GET request to a URL, I get a 404 returned because the api_version tag has already been forced to v2 in common.py (looks like to me). Would be really helpful if we could either (1) pass in the api version ourselves, or (2) if it did a quick URL validation and applied v2 only to the trading APIs.

Here's the (post-authentication) call: trade_api.get(path='/last/stocks/AAPL')

Here's the error: requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://data.alpaca.markets/v2/last/stocks/AAPL

If I manually curl for v1, I'll get a "access key verification failed" error, but not a 404 Not Found.

deuce14 commented 4 years ago

Disregard - didn't see that you had included a separate "data_get()" function in the api. My mistake!