Follower List
Back

From WeChat Official Account Admin Platform
Jump to: navigation, search

This API enables official accounts to obtain the follower list that comprises several OpenIDs, which are unique encrypted WeChat IDs for each user of an official account. Each user has separate OpenIDs that correspond to different official accounts. Developers can load up to 10,000 OpenIDs by calling this API once. This API can be called multiple times.

Request Description

HTTP request method: GET (Use Https protocol)
https://api.wechat.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID
Parameter Required Description
access_token Yes The certificate for the calling API
next_openid Yes The first OpenID to be loaded. Load from the first follower if it is empty

Return Description

An example of a successful JSON response is as follows:

{"total":2,"count":2,"data":{"openid":["","OPENID1","OPENID2"]},"next_openid":"NEXT_OPENID"}
Parameter Description
total The total number of the followers
count The quantity of loaded OpenIDs (maximum 10,000)
data OpenID list
next_openid The last OpenID loaded

An example of an unsuccessful JSON response (caused by invalid AppID) is as follows:

{"errcode":40013,"errmsg":"invalid appid"}

Note: More than 10,000 followers

When there are more than 10,000 followers, you can load the whole follower list through multiple callings by setting the next_openid parameter. To do so, you can set it to the value of the parameter returned after the last call. An example is given below:

Official account A has 23,000 followers. The request URLs for loading all the followers can therefore be as follows:
https://api.wechat.com/cgi-bin/user/get?access_token=ACCESS_TOKEN 
Return result:
{
  "total":23000,
  "count":10000,
  "data":{"
     openid":[
        "OPENID1",
        "OPENID2",
        ...,
        "OPENID10000"
     ]
   },
   "next_openid":"NEXT_OPENID1"
}
https://api.wechat.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID1
Return result:
{
   "total":23000,
   "count":10000,
   "data":{
     "openid":[
       "OPENID10001",
       "OPENID10002",
       ...,
       "OPENID20000"
     ]
   },
   "next_openid":"NEXT_OPENID2"
}
https://api.wechat.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID2
Return result (The next_openid is empty when the whole list is returned):
{
   "total":23000,
   "count":3000,
   "data":{"
       "openid":[
         "OPENID20001",
         "OPENID20002",
         ...,
         "OPENID23000"
       ]
   },
   "next_openid":" "
}
Developer Guide
Custom-defined Menu
WeChat JS-SDK