403 Client Error: Forbidden for url

Hi there,

Got a 403 Client Error: Forbidden url with the below Python program:

import pandas as pd
import alpaca_trade_api as tradeapi
api = tradeapi.REST(api_version=‘v2’)
result = api.get_barset(‘AAPL’, ‘minute’, start = ‘2021-01-28’, end = ‘2021-01-28’).df

Response: requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://data.alpaca.markets/v1/bars/minute?symbols=AAPL&start=2021-01-28&end=2021-01-28

Any idea what is causing this?


1 Like

I intermittently get the same thing for the following url:

I’m also looking for ideas on what could be causing this type of error.


I also get the same error. get_bars or get_barset show the 403 error: “Forbidden for url: https://data.alpaca.markets
alpaca.get_bars("AAPL", TimeFrame.Day, "2021-08-01", "2021-08-30", limit=10, adjustment='raw')

Somehow all other requests are working: alpaca.list_positions() or alpaca.get_account()

Is it about free plan? Pls advise.

Sorry for bothering. I needed to generate new paper account key. Old probably was too old.