Code":40110000" access key verification failed

Environment

Python 3

I am using PyCharm IDE to interact with my alpaca account. I am also using a MacBook.

Here is the error I am receiving:

“/Users/raphaelriordan/PycharmProjects/alpaca/venv/bin/python /Users/raphaelriordan/PycharmProjects/alpaca/trade.py
b’{“code”:40110000,“message”:“access key verification failed : access key not found (Code = 40110000)”}’”

This is my paper trading account.

Here is the code I am using. I have got my keys listed in a different folder.

import requests
from config import *
BASE_URL = “https://paper-api.alpaca.markets
ACCOUNT_URL = “{}/v2/account”.format(BASE_URL)

r = requests.get(ACCOUNT_URL, headers={“APCA_API_KEY_ID”: API_KEY, ‘APCA_API_SECRET_KEY’: SECRET_KEY})
print(r.content)

same issue. I hope Alpaca will come to the rescue

Same issue. @Ray_Riordan @Jeddie_Eddie Any luck with this error?

change

r = requests.get(ACCOUNT_URL, headers={“APCA_API_KEY_ID”: API_KEY, ‘APCA_API_SECRET_KEY’: SECRET_KEY})

to

r=requests.get(ACCOUNT_URL, headers={‘APCA-API-KEY-ID’: API_KEY, ‘APCA-API-SECRET-KEY’: API_SECRET})

This solution did not work for me. What else should I try?

1 Like