Get user list
Get the user list
##The public account can be obtained through this interface The account's follower list. The follower list consists of a string of OpenIDs (encrypted WeChat IDs, each user's OpenID is unique to each official account). A single pull call can pull up to 10,000 OpenIDs of followers, and you can pull multiple times to meet your needs. Interface call request description
http request method: GET (please use https protocol)https://api.weixin.qq.com/cgi- bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID
Parameter | Is it required | Description |
access_token | Yes | Call interface credentials |
next_openid | is the | first OPENID pulled. If not filled in, it will be pulled from the beginning by default |
Return instructions
Return JSON data packet when correct:
{"total":2,"count":2,"data":{"openid":["", "OPENID1","OPENID2"]},"next_openid":"NEXT_OPENID"}
Parameters | Description |
total | Total number of users following this public account |
count | The number of OPENIDs pulled, the maximum value is 10000 |
data | List data, OPENID The list |
next_openid | Pull the OPENID of the last user in the list |
Return JSON data packet in case of error (example is invalid AppID error):
{"errcode":40013,"errmsg":"invalid appid"}
Attachment: When the number of followers exceeds 10,000
When the number of followers of the public account exceeds 10,000, you can fill in the value of next_openid and pull the list multiple times to meet the needs.
Specifically, when calling the interface, the next_openid value returned from the previous call is used as the next_openid value in the next call.
Examples are as follows:
Public account A has 23,000 followers. If you want to get all the followers through the pull attention interface, then request the URL as follows: https://api.weixin.qq.com/cgi-bin/user/get ?access_token=ACCESS_TOKEN Return result:
{
"total":23000,
"count":10000,
"data":{"
openid":[
"OPENID1 ",
"OPENID2",
...,
"OPENID10000"
]
},
"next_openid":"OPENID10000"
}https://api .weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID1Return result:
{
"total":23000,
"count":10000,
"data ":{
"openid":[
"OPENID10001",
"OPENID10002",
...,
"OPENID20000"
]
},
"next_openid":"OPENID20000"
}https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID2 returns the result (when the follower list has been returned, the next_openid returned is Empty):
{
"total":23000,
"count":3000,
"data":{"
"openid":[
"OPENID20001",
"OPENID20002",
"OPENID20002",
"OPENID23000"
"OPENID23000"
{
"total":23000,
"count":10000,
"data":{"
openid":[
"OPENID1 ",
"OPENID2",
...,
"OPENID10000"
]
},
"next_openid":"OPENID10000"
}https://api .weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID1Return result:
{
"total":23000,
"count":10000,
"data ":{
"openid":[
"OPENID10001",
"OPENID10002",
...,
"OPENID20000"
]
},
"next_openid":"OPENID20000"
}https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID2 returns the result (when the follower list has been returned, the next_openid returned is Empty):
{
"total":23000,
"count":3000,
"data":{"
"openid":[
"OPENID20001",
"OPENID20002",
"OPENID20002",
"OPENID23000"
"OPENID23000"