def get_futures_account_info():
# Endpoint for futures account info
endpoint = '/fapi/v2/account'
url = BASE_URL + endpoint
# Get current timestamp
timestamp = int(time.time() * 1000)
# Prepare query parameters
params = {
'timestamp': timestamp
}
# Create query string
query_string = urllib.parse.urlencode(params)
# Generate signature
signature = hmac.new(
SECRET_KEY.encode('utf-8'),
query_string.encode('utf-8'),
hashlib.sha256
).hexdigest()
# Add signature to params
params['signature'] = signature
# Headers
headers = {
'X-MBX-APIKEY': API_KEY
}
# Make the request
response = requests.get(url, headers=headers, params=params,proxies=proxies)
# Return the response
return response.json()
{'code': -2015, 'msg': 'Invalid API-key, IP, or permissions for action'}
I m using sub ac but I can trade perp in my sub ac. I tried to use proxy / vpn but still not working. The keys and secret must be correct!