Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Json Instagram粉丝数_Json_Instagram - Fatal编程技术网

Json Instagram粉丝数

Json Instagram粉丝数,json,instagram,Json,Instagram,几天前的页面https://www.instagram.com//?__a=1返回403错误。有没有其他简单的方法来获取帐户关注者?这是一个未记录的端点,它必须在某个点停止,因为它不应该被公众访问。建议不要在应用程序中使用这些未记录的端点,而是使用Instagram API 但是,您可以使用此php解决方案获得edge_,我还没有对其进行测试,但您可以尝试:- $name = "{username}"; $ch = curl_init(); curl_setopt($ch, CURLOPT_UR

几天前的页面<代码>https://www.instagram.com//?__a=1返回403错误。有没有其他简单的方法来获取帐户关注者?

这是一个未记录的端点,它必须在某个点停止,因为它不应该被公众访问。建议不要在应用程序中使用这些未记录的端点,而是使用Instagram API

但是,您可以使用此php解决方案获得edge_,我还没有对其进行测试,但您可以尝试:-

$name = "{username}";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.instagram.com/$name/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if($http=="200") {
  $doc = new DOMDocument();
  $doc->loadHTML($result);
  $xpath = new DOMXPath($doc);
  $js = $xpath->query('//body/script[@type="text/javascript"]')->item(0)->nodeValue;
  $start = strpos($js, '{');
  $end = strrpos($js, ';');
  $json = substr($js, $start, $end - $start);
  $data = json_decode($json, true);
  $user_id = $data["entry_data"]["ProfilePage"][0]["graphql"]["user"]["edge_followed_by"]["count"];
}  

很好,谢谢。只需要在数组的末尾添加['count']。@Duna很高兴它能起作用。感谢您告知最后一个对象。我已经更新了我的问题。好吧,这仍然是一种没有文件记录的获取信息的方式。如果他们更改了标记怎么办?