node-binance-api icon indicating copy to clipboard operation
node-binance-api copied to clipboard

Is it possible to get current weight without making additional request to /api/v3/exchangeInfo?

Open ProgrammingLife opened this issue 4 years ago • 7 comments

I mean getting the weight from any of requests making with node-binance-api.

ProgrammingLife avatar Jun 01 '20 04:06 ProgrammingLife

You're allowed 1200 weight per minute, but I don't see any easy way of automatically handling this

jaggedsoft avatar Jun 01 '20 05:06 jaggedsoft

@jaggedsoft maybe to return the weight header as an object from any methods when the request has done?

ProgrammingLife avatar Jun 01 '20 20:06 ProgrammingLife

Not a bad idea. I guess you could keep track of weight in a global variable as well. We'd just have to build out a map of which endpoints use how much weight. The hard part would be things that have dynamic weights like klines or depth endpoints using different weights depending on the limit you set.

jaggedsoft avatar Jun 01 '20 21:06 jaggedsoft

How much weight is the getting user balance? I mean this request : https://github.com/jaggedsoft/node-binance-api#getting-list-of-current-balances Do i get banned when i use this every minute?

Yur13L avatar Apr 14 '21 18:04 Yur13L

How much weight is the getting user balance? I mean this request : https://github.com/jaggedsoft/node-binance-api#getting-list-of-current-balances Do i get banned when i use this every minute?

Sorry, Just found out the weight is 5 per request : https://binance-docs.github.io/apidocs/spot/en/#account-information-user_data

Don't mind me

Yur13L avatar Apr 14 '21 18:04 Yur13L

Hello :). I was looking for the same thing and couldnt find any help here so I took a look into the code. You can get the weight with binance.usedWeight(). It gets updated after each request made to Binance API through the information sent back in the headers.

Snuuson avatar Apr 27 '21 20:04 Snuuson

Hello :). I was looking for the same thing and couldnt find any help here so I took a look into the code. You can get the weight with binance.usedWeight(). It gets updated after each request made to Binance API through the information sent back in the headers.

Hi Snuuson,

Thank you for your response. I found out about the binance.usedWeight after exploring more on their examples. https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#show-weight-used-from-last-request

There seems to be also very informative other samples as well like the filtering thing. Like the lot size filter thing. Just wanted to say it out for other noobs out there like me.

Yur13L avatar Apr 27 '21 21:04 Yur13L