eMK*_*MKa 11 php instagram instagram-api
是否有可能在Instagram中获得其他页面关注者数量?我只能得到我的个人资料关注者数量,但我也希望得到其他关注者?(例如在php中)
有任何想法吗?
rNi*_*Nix 35
是的,有可能?__a=1
返回json的查询.
$otherPage = 'nasa';
$response = file_get_contents("https://www.instagram.com/$otherPage/?__a=1");
if ($response !== false) {
$data = json_decode($response, true);
if ($data !== null) {
$follows = $data['graphql']['user']['edge_follow']['count'];
$followedBy = $data['graphql']['user']['edge_followed_by']['count'];
echo $follows . ' and ' . $followedBy;
}
}
Run Code Online (Sandbox Code Playgroud)
小智 25
跳过篮球以获得批准用于快速检查关注者计数的应用程序似乎过多,所以我在Instagram的网络搜索上查看网络请求,并看到在搜索框中输入会触发对此URL的请求:
https://www.instagram.com/web/search/topsearch/?query={searchquery}
Run Code Online (Sandbox Code Playgroud)
这将返回一个JSON提要,其中包含一组用户信息,包括follower_count的值.如果您已登录,则会根据您的帐户的相关性对结果进行加权,但您无需进行身份验证,甚至无需登录即可获得结果:
{
"has_more": false,
"status": "ok",
"hashtags": [],
"users": [
{
"position": 0,
"user": {
"username": "thenativepaul",
"has_anonymous_profile_picture": false,
"byline": "457 followers",
"mutual_followers_count": 0.0,
"profile_pic_url": "https://scontent-lhr3-1.cdninstagram.com/t51.2885-19/11373838_482400848607323_1803683048_a.jpg",
"full_name": "Paul Almeida-Seele",
"follower_count": 457,
"pk": 21072296,
"is_verified": false,
"is_private": false
}
},
{
"position": 1,
"user": {
"username": "the_native_warrior",
"has_anonymous_profile_picture": false,
"byline": "251 followers",
"mutual_followers_count": 0.0,
"profile_pic_url": "https://scontent-lhr3-1.cdninstagram.com/t51.2885-19/s150x150/14473927_312669442422199_4605888521247391744_a.jpg",
"profile_pic_id": "1352745514521408299_1824600282",
"full_name": "Paul Carpenter",
"follower_count": 251,
"pk": 1824600282,
"is_verified": false,
"is_private": true
}
}
],
"places": [ ]
}
Run Code Online (Sandbox Code Playgroud)
您可以获取任何用户的关注者数量,但无法获取用户的关注者详细信息,您只能获取您的关注者列表。
这是获取任何用户的关注者数量的 API:
https://api.instagram.com/v1/users/{user-id}/?access_token=ACCESS-TOKEN
Run Code Online (Sandbox Code Playgroud)
https://www.instagram.com/developer/endpoints/users/#get_users
更新:我注意到这不起作用,我只是尝试了这个: https: //api.instagram.com/v1/users/self/?access_token =XXXXX 并得到了一些很好的信息... MQ
归档时间: |
|
查看次数: |
24877 次 |
最近记录: |