当前位置: 首页 > 工具软件 > Python OpenID > 使用案例 >

python 批量获取公众号关注用户的openid

饶元章
2023-12-01
import requests,json
access_token='' 
next_openid='' #第一个拉取的OPENID,不填默认从头开始拉取 ,一次只能获取10000条
url='https://api.weixin.qq.com/cgi-bin/user/get?access_token=%s&next_openid'%(access_token,next_openid)
ans=requests.get(url)
a= json.loads(ans.content)['data']['openid'] 
print a,len(a)

 

 类似资料: