Here is what the terminal tells me with every failed connection (i’ve tried Kraken Futures, Phemex Testnet, Coinbase Demo account):
(cryptobot) PS C:UsersjcaziOneDriveDesktopAlgotrading> & C:/Users/jcazi/Anaconda3/envs/cryptobot/python.exe c:/Users/jcazi/OneDrive/Desktop/Algotrading/algo_orders.py Traceback (most recent call last): File "C:UsersjcaziAnaconda3envscryptobotlibsite-packagesccxtbaseexchange.py", line 645, in fetch response.raise_for_status() File "C:UsersjcaziAnaconda3envscryptobotlibsite-packagesrequestsmodels.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.phemex.com/spot/wallets
Here is my code I am running (I double checked api key and secret are correct/are strings and they are imported from another doc in the same folder):
import ccxt
from keyfile import key
from keyfile import secret
phemex = ccxt.phemex ({
'enableRateLimit': True,
'apiKey': key,
'secret': secret
})
phemex.fetch_balance()
I tried multiple exchanges, generating multiple new multiple api keys, updating ccxt, entering the key/secret manually in the code as strings without import, consulting chatgpt, and more. been bugging me out for 2 days now.
James Cody Cazin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.