Python-binance: Accessing X-MBX-USED-WEIGHT header

Created on 6 Jun 2019  路  2Comments  路  Source: sammchardy/python-binance

According to the binance docs [1] every rest api request contains a X-MBX-USED-WEIGHT header which has the current used weight for the IP for the current minute. How do we access the header(s) via python-binance?

[1] https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#LIMITS

Most helpful comment

Hi @ep7aePei if you install v0.7.4 you now have access to the requests response object after a request.

Simple example

client = Client()
client.get_exchange_info()
print(client.response.headers)

All 2 comments

class MyClient(Client):

def _handle_response(self,response):
    self.last_weight = response.headers.get('X-MBX-USED-WEIGHT',self.last_weight)
    return super()._handle_response(response)

Hi @ep7aePei if you install v0.7.4 you now have access to the requests response object after a request.

Simple example

client = Client()
client.get_exchange_info()
print(client.response.headers)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

echel0n picture echel0n  路  4Comments

terenceljz picture terenceljz  路  3Comments

rightx2 picture rightx2  路  4Comments

delware1 picture delware1  路  4Comments

Hujjat picture Hujjat  路  3Comments