Below is my code, I request the orders through the Phython API which does NOT work, and then through the REST API which DOES work. The Python API stopped working yesterday some time…
Any help would be greatly appreciated.
Bill
alpaca = tradeapi.REST(ALPACA_API_KEY, ALPACA_API_SECRET, ALPACA_URL, ‘v2’)
config = alpaca.get_account_configurations()
print (config) # this works fine
orders = alpaca.list_orders(status=‘closed’, symbols=‘AMD’, limit=10, after=‘2024-03-19T15:50:00Z’, direction=‘desc’)
print(orders) # returns an empty list
url = "https://paper-api.alpaca.markets/v2/orders? status=closed&limit=10&after=2024-03-21T15%3A50%3A00Z&direction=desc&symbols=AMD"
headers = {
"accept": "application/json",
"APCA-API-KEY-ID": "my_key",
"APCA-API-SECRET-KEY": "my_secret"
}
response = requests.get(url, headers=headers)
print(response.text) # THIS WORKS FINE AND SHOWS THE ORDER