您的client_id可能处于沙盒模式 . 您无法从白名单以外的帐户获取信息 . 如果您向应用程序发送评论,则可以退出沙盒模式 .

但是有一个更简单的解决方案 . 您只需拨打一个电话即可从网络版(无需API)获取公开信息:

$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['user']['follows']['count'];

$followedBy = $data['user']['followed_by']['count'];

echo $follows . ' and ' . $followedBy;

}

}

Update. 对不起,我误解了你的问题 . 可以在没有API的情况下获取列表 . 您需要cookie中的csrf令牌和用户ID,然后调用查询:

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://www.instagram.com/query/");

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

//You need the csrftoken, ds_user_id

curl_setopt($ch, CURLOPT_HTTPHEADER, array("Cookie: ..."));

curl_setopt($ch, CURLOPT_POST, 1);

$userId = 528817151;

curl_setopt($ch, CURLOPT_POSTFIELDS,

"q=ig_user($userId) {

followed_by.first(10) {

count,

page_info {

end_cursor,

has_next_page

},

nodes {

id,

is_verified,

followed_by_viewer,

requested_by_viewer,

full_name,

profile_pic_url,

username

}

}

}");

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$server_output = curl_exec ($ch);

curl_close ($ch);

var_dump($server_output);

您可以在Instagram网站上获取正确的cookie进行登录操作 .

java关注列表_如何从一个Instagram帐户中获取关注者列表?相关推荐

  1. instagram akp_如何从您的Instagram帐户中删除帖子

    instagram akp There are many reasons you may want to remove a post from your Instagram account. Mayb ...

  2. instagram分享_存档instagram帐户正在教被忘记的历史

    instagram分享 Until recently, Instagram was not known for its political potential. The app was widely ...

  3. 谷歌账户无法添加_如何将另一个Google帐户添加到您的Android设备

    谷歌账户无法添加 In order to set up an Android device, you have to sign in with a Google account. But you ca ...

  4. JAVA定义一个银行帐户类BankAccount实现银行帐户的概念

    定义一个银行帐户类BankAccount实现银行帐户的概念,在BankAccount类中定义两个变量:"帐号" (account_number) 和"存款余额" ...

  5. icloud账户如何注销_如何从您的iCloud帐户中删除设备

    icloud账户如何注销 If you use iCloud to sync your Apple devices, you might accumulate a lot of approved de ...

  6. 设计一个银行帐户类,成员变量包括账号、储户姓名、开户时间、身份证号码、存款余额等帐户信息,成员方法包括存款、取款操作

    设计一个银行帐户类,成员变量包括账号.储户姓名.开户时间.身份证号码.存款余额等帐户信息,成员方法包括存款.取款操作 思路:首先创建一个BankAccount类用于存放用户信息,在创建一个BCOpti ...

  7. Oracle EBS PAC定期成本分配处理程序请求报错:30011一个无效帐户与正在处理的物料关联

    Oracle EBS版本: RDBMS : 12.1.0.2.0 Oracle Applications : 12.2.6 前提条件:       1.启用"MRP:调试模型" 配 ...

  8. spotify怎么设置头像_如何设置Spotify儿童帐户

    spotify怎么设置头像 Spotify Kids is a standalone listening app built with the unique needs of young ones i ...

  9. python 谷歌登录_使用Python登录Google帐户进入网站

    我正在做一个网站,使图表的人数,在小组(从www.codecamy.com). 在 为了达到这个目的,我有一个计划.在 我将有一个服务器,它将每30秒轮询CodeCademy groups页(http ...

最新文章

  1. js跳转页面时添加header_鸿蒙应用开发踩坑记之路由跳转
  2. /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15 not found
  3. 面试系统设计_系统设计面试问题–您应该知道的概念
  4. 科目三大路考8个驾驶技巧
  5. (写给应届生)学松下幸之助找工作
  6. android蓝牙串口arduino源码,android – Arduino:使用串口和软件串口与蓝牙模块
  7. gnuplot画图命令_Gnuplot科学绘图(二十六)——image 绘图
  8. MFC初步教程(三):菜单
  9. 能“社交”的机器人助理问世 可“察言观色”
  10. redis数据类型之String入门
  11. 基于 MVP + Glide + Retrofit + RxJava2.0 + butterknife 的C9MJ TV App
  12. 深入了解字符集和编码
  13. 【Deep learning】NLP
  14. LinkedIn登录界面模糊效果
  15. 高保密单位数据安全怎么办?用这款知识管理系统
  16. 常用的7个计算机网络命令
  17. 拒绝访问病毒解决方法
  18. 项目管理心得:一个项目经理的个人体会、经验总结
  19. 回忆旧时读叶芝的WHEN YOU ARE OLD
  20. rabbitMq系列2:AMPQ协议与RabbitMQ执行过程

热门文章

  1. 数据仓库、数据湖、数据集市、和数据中台的故事
  2. 陕西的饮食历史和特点
  3. 管道与命名管道(FIFO)
  4. iphonex计算机隐藏功能,iPhoneX如何隐藏小白条 iPhoneX隐藏小白条方法【步骤介绍】...
  5. 小程序uni-app生成条形码
  6. ruby 中的sort 和 sort_by
  7. PI Planning
  8. Pόlya定理详解及例题
  9. Redis之EXPIRE
  10. 74hc164驱动数码管c语言程序,74hc164应用电路图_74hc164驱动源程序