PHP使用Instagram API错误HTTP请求失败! HTTP / 1.1 403禁止

时间:2018-05-16 12:37:25

标签: php json instagram instagram-api

我正在使用这样的网址: https://www.instagram.com/graphql/query/?query_hash=42323d64886122307be10013ad2dcc44&variables=%7B%22id%22:%22555329715%22,%22first%22:12,%22after%22:%22AQDea0aZ27W349lmEWRcuh9xz7sO2Elo-_RDymqEMzT85he8dFwkrV4lbKlii9z7AkWPEbLx_txFKKbHeuotw9c4fY40B-Mm-lF7sfWtq8PUfQ%22%7D

此网址也是浏览器,但代码如下:

        $insta_id = $ret->users[0]->user->pk;
    $link1 = "https://www.instagram.com/graphql/query/?query_hash=42323d64886122307be10013ad2dcc44&variables=%7B%22id%22:%22".$insta_id."%22,%22first%22:12,%22after%22:%22AQDea0aZ27W349lmEWRcuh9xz7sO2Elo-_RDymqEMzT85he8dFwkrV4lbKlii9z7AkWPEbLx_txFKKbHeuotw9c4fY40B-Mm-lF7sfWtq8PUfQ%22%7D";
    $response1 = file_get_contents($link1);

在调用我的函数之前我得到的是:

Message: file_get_contents(https://www.instagram.com/graphql/query/?query_hash=42323d64886122307be10013ad2dcc44&variables=%7B%22id%22:%22492948834%22,%22first%22:12,%22after%22:%22AQDea0aZ27W349lmEWRcuh9xz7sO2Elo-_RDymqEMzT85he8dFwkrV4lbKlii9z7AkWPEbLx_txFKKbHeuotw9c4fY40B-Mm-lF7sfWtq8PUfQ%22%7D): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden

任何想法如何解决这个问题?非常感谢

0 个答案:

没有答案