# Query API Call Quota

Debugging Tools

Interface should be called on the server side, not in the front end (Weixin Mini Program, web pages, APP, etc.) directly called, specific reference interface call guide

Interface name: getApiQuota

This interface is used to query Official Account / Service Account / Weixin Mini Program/ MiniGame / Weixin Store / Delivery Assistant / Weixin Channels Assistant / Alliance Shipping Agency / Mobile App / Website App / Weixin Mini Program / Weixin Mini Program Wait for the daily calls of the interface, the number of calls, and the frequency limit.

# 1. How to call

# HTTPS calls

POST https://api.weixin.qq.com/cgi-bin/openapi/quota/get?access_token=ACCESS_TOKEN

# Cloud Calls

  • This interface does not support cloud calls

# Third party invocation

  • This interface supports Third Party Platform calling itself using component_access_token , and also supports calling on behalf of merchants.

  • Once the service provider has any set of permissions authorized, it can call on behalf of the merchant by using authorizer_access_token , which can be viewed in the third-party call documentation.

# 2. Request parameters

# Query parametersQuery String parameters

Parameter NametypeRequired to fill inIntroductions
access_tokenstringyesInterface invocation credentials, using access_token , component_access_token

# Request BodyRequest Payload

Parameter NametypeRequired to fill inIntroductions
cgi_pathstringyesThe request address of the api, such as "/ cgi-bin / message / custom / send";Don't prefix "https://api.weixin.qq.com" and don't leave out "/," otherwise you will get 76003 error.

# 3. Return Parameters

# Response Payload

Parameter NametypeIntroductions
errcodenumberReturn code
errmsgstringError message
quotaobjectQuota Details
rate_limitobjectGeneral call frequency limit
component_rate_limitobjectRecall frequency limits

# Res.quotaObject Payload

Quota Details

Parameter NametypeIntroductions
daily_limitnumberNumber of times that account can call the interface that day
usednumberNumber of times that day had been called
remainnumberNumber of calls remaining that day

# Res.rate_limitObject Payload

General call frequency limit

Parameter NametypeIntroductions
call_countnumberNumber of calls that can be invoked in a cycle, in units
refresh_secondnumberUpdate cycle, in seconds

# Res.component_rate_limitObject Payload

Recall frequency limits

Parameter NametypeIntroductions
call_countnumberNumber of calls that can be invoked in a cycle, in units
refresh_secondnumberUpdate cycle, in seconds

# 4. Note

  1. If the API of the query belongs to Official Account, the access_token of the Official Account message template shall be used;If the API of the query belongs to the Weixin Mini Program interface, the access_token](https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/access-token/auth.getAccessToken.html) of the [Mini Program is required;If the query interface belongs to the interface of Third Party Platform, use third party platform component_access_token ;And so on.

  2. If the query interface belongs to the Third Party Platform interface but is used for Official Account / Weixin Mini Program,A third party platform authorizer_access_token

  3. If it is a third-party service provider Official Account / Service Account / Weixin Mini Program / Weixin Store / Delivery Assistant / Weixin Channels AssistantQuery interface, you need to use authorizer_access_token

Each interface has a limit on the number of calls, so the developer is asked to call the interface reasonably.

4, "/ xxx / sns / xxx" this kind of interface does not support the use of the interface, there will be 76022 error.

5, if the interface document has a separate explaination of the interface of the special quota number and logic, then the explaination of each interface interface document shall prevail.

# 5. Code examples

Example Requests

{
  "cgi_path": "/wxa/gettemplatedraftlist"
}

Return an example

{
  "errcode": 0,
  "errmsg": "ok",
  "quota": {
    "daily_limit": 0,
    "used": 0,
    "remain": 0
  }
}

# 6. Error code

The following is a list of error codes for this interface, other error codes can refer to General error codes

Error codeError DescriptionSolutions
0okok
76021cgi_path not found, please checkCgi_path is filled in incorrectly
76022could not use this cgi_path,no permissionThe token used by the current calling interface does not match the account owned by the api.

# 7. Scope of application

How this interface can be invoked under different account types:
Weixin Mini Program Official Account Service Account MiniGame Weixin Store Alliance Shipping Agency Delivery Assistant Third Party Platform Mobile App Website App Weixin Channels Assistant Multi-platform App