Request limit on the API endpoints

It’s important to understand how the request limit works when integrating with Binance API. All of the details in the API document,

This topic will make a summary of them, hope it will be helpful for our users.

There are 4 API products:

  • https://api.binance.com/api/*
  • https://api.binance.com/sapi/*
  • https://fapi.binance.com/fapi/*
  • https://dapi.binance.com/dapi/*

( Note the base URL of each of them. )


General Details

  • They don’t share limits with each other. It means even if the client has reached the limit on endpoint /api/v3/time, it can still send request to /fapi/v1/time.

https://api.binance.com/api/*

  • Please refer to document: https://github.com/binance/binance-spot-api-docs
  • In the document, when an endpoint has a state like: Weight: 1, it means the IP weight.
  • The Order Rate Limit is only used for calculating how many orders are sent on these endpoints:
    • POST /api/v3/order ( counts as 1 order )
    • POST /api/v3/order/oco ( counts as 2 orders )
  • The IP and Order Rate limit can be found in the endpoint:https://api.binance.com/api/v3/exchangeInfo
  • X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter) from response header has the current used weight for the IP for all request rate limiters defined.
  • X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter) from response header has the current order count used for the account.

https://api.binance.com/sapi/*

  • Please refer to document: Binance API Documentation
  • Each endpoint is measured either in IP or UID limit. The weight and measurement type ( IP or UID) is stated in the document of each endpoint. e.g. Weight(IP): 10.
  • Each endpoint with IP limits has an independent weight of 12,000 per minute limit.
  • Each endpoint with UID limits has an independent weight of 180,000 per minute limit.
  • Responses from endpoints with IP limits contain the header X-SAPI-USED-IP-WEIGHT-1M, defining the weight used by the current IP.
  • Responses from endpoints with UID limits contain the header X-SAPI-USED-UID-WEIGHT-1M, defining the weight used by the current UID.

https://fapi.binance.com/fapi/*

  • Please refer to document: Binance API Documentation
  • In the document, when an endpoint has a state like: Weight: 1, it means the IP weight, except:
    • POST /fapi/v1/order is for order limit only, no IP weight.
    • POST /fapi/v1/batchOrders is for order limit, no IP weight.
  • The IP and Order Rate limit can be found in the endpoint: https://fapi.binance.com/fapi/v1/exchangeInfo
  • X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter) from response header has the current used weight for the IP for all request rate limiters defined.
  • X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter) from response header has the current order count used for the account.

https://dapi.binance.com/dapi/*

  • Please refer to document: Binance API Documentation
  • In the document, when an endpoint has a state like: Weight: 1, it means the IP weight, except:
    • POST /dapi/v1/order is for order limit only, no IP weight.
    • POST /dapi/v1/batchOrders is for order limit, no IP weight.
  • The IP and Order Rate limit can be found in the endpoint: https://dapi.binance.com/dapi/v1/exchangeInfo
  • X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter) from response header has the current used weight for the IP for all request rate limiters defined.
  • X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter) from response header has the current order count used for the account.

this api don’t include IP Limit Info , only Order Limit found

[{'rateLimitType': 'REQUEST_WEIGHT',
  'interval': 'MINUTE',
  'intervalNum': 1,
  'limit': 1200},
 {'rateLimitType': 'ORDERS',
  'interval': 'SECOND',
  'intervalNum': 10,
  'limit': 50},
 {'rateLimitType': 'ORDERS',
  'interval': 'DAY',
  'intervalNum': 1,
  'limit': 160000},
 {'rateLimitType': 'RAW_REQUESTS',
  'interval': 'MINUTE',
  'intervalNum': 5,
  'limit': 6100}]

ps. Any api can get IP limit info?

1 Like

This is the IP limit.

1 Like

Is the time window fixed or sliding? For example, if the time window is ten seconds, is it fixed from the 0th to the 10th second, the 10th to the 20th second of each minute, etc.? Or is it sliding instead?

{‘rateLimitType’: ‘RAW_REQUESTS’,
‘interval’: ‘MINUTE’,
‘intervalNum’: 5,
‘limit’: 6100}]

Is this limit redundant? what is the weight used for this limit in the response header?

thank you !