Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use advanced interface to develop the function of getting follower list on Wechat public platform

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly shows you "how to use the advanced interface to develop the function of getting the follower list on the Wechat public platform". The content is easy to understand and clear, and I hope it can help you solve your doubts. Now let the editor lead you to study and learn the article "how to use the advanced interface to develop the function of obtaining the follower list on the Wechat public platform".

I. introduction of the interface

The official account can obtain the follower list of the account through this API. The follower list consists of a string of OpenID (encrypted WeChat account, each user's OpenID is unique to each official account). An OpenID that pulls up to 10000 followers at a time can be pulled multiple times to meet the demand.

API call request description

Http request method: GET (please use https protocol) whether the https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID parameter must indicate that access_token is the calling API credential next_openid is the first OPENID to be pulled. If left empty, pull from scratch by default.

Return description

Return JSON packet when correct:

{"total": 2, "count": 2, "data": {"openid": ["," OPENID1 "," OPENID2 "]}," next_openid ":" NEXT_OPENID "} parameters indicate the total number of users followed by total and the number of OPENID pulled by count. The maximum value is 10000data list data, and the list next_openid of OPENID pulls the OPENID of the latter user of the list.

Return JSON packet when error occurs (invalid AppID error for example):

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

Attachment: when the number of followers exceeds 10000

When the number of followers of the official account exceeds 10,000, you can fill in the value of next_openid and pull the list many times to meet the demand.

Specifically, when the interface is called, the next_ OpenID value returned from the previous call is taken as the next_ OpenID value in the next call.

Examples are as follows:

Public account A has 23000 followers who want to get all the followers by pulling the follower interface. Then request url as follows: https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN returns the result: {"total": 23000, "count": 10000, "data": {"openid": ["OPENID1", "OPENID2",..., "OPENID10000"]} "next_openid": "NEXT_OPENID1"} https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID1 returns the result: {"total": 23000, "count": 10000, "data": {"openid": ["OPENID10001", "OPENID10002",..., "OPENID20000"]} "next_openid": "NEXT_OPENID2"} https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID1 returns the result (when the follower list has been returned Return next_openid is empty): $access_token = "" $url = "https://api.weixin.qq.com/cgi-bin/user/get?access_token=$access_token";$result = https_request ($url); $jsoninfo = json_decode ($result, true); var_dump ($result); II. Program implementation ="=" https://api.weixin.qq.com/cgi-bin/user/get?access_token=" = https_request (= json_decode (, ()

After China Merchants Bank, the return is similar to:

{"total": 23000, "count": 10000, "data": {"openid": ["OPENID10001", "OPENID10002",..., "OPENID20000"]}, "next_openid": "NEXT_OPENID2"}

For more than 10, 000 numbers, you can cycle through the above program, store these openid in the database, and get a list of followers.

The main function of this interface is to obtain the basic information of users and the user grouping interface to obtain the basic information and grouping of all followers.

The above is all the contents of the article "how to use the advanced interface to develop the function to get the follower list on the Wechat public platform". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report