Quotes on paper account, something changed? 403

I get a 403 : requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://data.alpaca.markets/v1/last_quote/stocks/AAPL

Using alpaca_trade_api 0.51 . I could swear this was working last week. I get the 403 using paper APCA_API_{KEY_ID, SECRET_KEY}, works with live credentials.

import alpaca_trade_api as tradeapi
api = tradeapi.REST(os.environ[‘APCA_API_KEY_ID’], os.environ[‘APCA_API_SECRET_KEY’],
print(api.get_account()) # works
print(api.get_last_quote(‘AAPL’)) # raises exception

Have I missed something?


Any update here? I’m having the same issue.

Sure, I dont know too much about the Python API But I am 90% sure the issue is the way you are making the api request, I would look how other have done it in the past and try too copy them. Here is some example code given by alpaca. https://alpaca.markets/docs/api-documentation/how-to/account/