You have to provide the secret id/key in HTTP request headers. Read more information here. This info is placed into the Trading API section of the new documentation but the authentication process is the same for all REST APIs provided by Alpaca.
Hi Oleg, isn’t that what im doing? the key.txt file contains json with my key and ID which are assigned to the headers variable. If this is incorrect, can you show me in code how to fix this issue? I am new to alpacas api.
I’m not a Python developer. Your code looks fine but I’m not sure how headers passed into the requests.get function. Why not just check how it works with the official Python SDK?