Calling API for crypto datas

When I try to receive the data from BTC/USD, I receive the following error

{“message”:“Invalid location: CryptoFeed.US”}
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://data.alpaca.markets/v1beta3/crypto/CryptoFeed.US/bars?start=2023-04-15T00%3A00%3A00Z&end=2023-04-17T00%3A00%3A00Z&timeframe=1Hour&symbols=BTC%2FUSD

During handling of the above exception, another exception occurred:
alpaca.common.exceptions.APIError: {“message”:“Invalid location: CryptoFeed.US”}

I got the same error…

I believe it is a bug from Alpaca system on the crypto’s? As last week I was getting another error again on the crypto’s on “get_all_assets” (for stock this was working), and I had to upgrade the module to version 0.8.2 to see it fixed. So I suspect something wrong on the crypto’s app has yet to be fixed…
I also tried to replicate their basic procedure for crypto request (Getting Started | Alpaca Docs), to see if I was doing anything wrong, but I can see the same error again…

Even I got the same error…was anyone able to get it working ?

Having the same problem here.

I found the issue. In the requests URL it seems the parameter for the feed is “CryptoFeed.US” where in the API docs it is just ‘us’. To fix this in the python SDK I set the feed parameter to ‘feed = “us”’ which fixed the request and validated it. In the URL above you just need to change the ‘CryptoFeed.US’ part to ‘us’. Let me know if it works for you!

3 Likes

Thank you for recommending the changes…it worked for me.

1 Like

This issue is tracked here.

Fixed it by using python 3.8