Hi, i’m using the python script to fetch the deposit and withdrawal history but getting 403 error , I’m using the sample python code from Endpoint security type | Binance Open Platform , which is worked perfectly fine for order placement but for fetching deposit or withdrawals getting this 403 error , here’s the code ,Am I missing any thing?```# Load the private key.
In this example the key is expected to be stored without encryption,
but we recommend using a strong password for improved security.
with open(PRIVATE_KEY_PATH, ‘rb’) as f:
private_key = load_pem_private_key(data=f.read(),
password=None)
Set up the request parameters
params = {
# “symbol”: “DOTUSDT”,
# “side”: “BUY”,
# “type”: “LIMIT”,
# “timeInForce”: “GTC”,
# “quantity”: 6,
# “price”: 3.567
}
Timestamp the request
timestamp = int(time.time() * 1000) # UNIX timestamp in milliseconds
params[‘timestamp’] = timestamp
Sign the request
payload = ‘&’.join([f’{param}={value}’ for param, value in params.items()])
signature = base64.b64encode(private_key.sign(payload.encode(‘ASCII’)))
params[‘signature’] = signature
print("params: ", params)
Send the request
headers = {
‘X-MBX-APIKEY’: API_KEY
}
base_url = ‘https://api.binance.com’
end_point = ‘/sapi/v1/capital/deposit/hisrec’
end_point = “/api/v3/order”
response = requests.get(
base_url + end_point,
headers=headers,
data=params,
)
print(response.status_code)
print(response.text)```