1 minute historical data python doesnt work

Hello all,

I downloaded the 1 minute historical data in the past using python, but recently it doesn’t work anymore. I’m using the free API key, is this a problem of the free key or in general? It worked till around end of February or beginning of March. Her is my python code:

    # Initialize the client
    client = StockHistoricalDataClient(api_key, secret_key)

         
    # Define the request parameters
    request_params = StockBarsRequest(
        symbol_or_symbols=symbol,
        timeframe=TimeFrame.Minute,
        start=datetime.datetime.strptime(start_date, '%Y-%m-%d'),
        end=datetime.datetime.strptime(end_date, '%Y-%m-%d'),
        adjustment='raw',
    )

@Mo_He The code you provided should work. Ensure you are using the latest version of the python SDK. That may be the issue.

@Dan_Whitnable_Alpaca Thanks for the fast reply.
I update the SDK but the problem remains the same. Also for each other time interval, starting with 2 minutes it works. Is it because of the free key?

Update: So I just updated “alpaca-trade-api” and forgot about “alpaca-py”. Now it works
Cheers

@Mo_He Good to hear!