从 Instagram 获取用户个人资料图片

时间:2021-04-07 04:58:09

标签: php instagram instagram-api

我正在从 Instagram 获取用户个人资料图片,关注 this link。在提供 Instagram 应用程序 ID、密钥和重定向 URI 后,我获得了授权代码,然后根据授权代码我获得了访问令牌。基于访问令牌获得 Instagram 用户 ID 和用户名。

这是代码

$insta_username = $insta_response['username'];
$jsonData = json_decode(file_get_contents('https://www.instagram.com/'.$insta_username.'/?__a=1'));

此后,我收到此错误

消息:file_get_contents(https://www.instagram.com/fakenamesofficial/?__a=1):无法打开流:HTTP 请求失败! HTTP/1.1 429 -

1 个答案:

答案 0 :(得分:0)

试试 $jsonData = file_get_contents('https://www.instagram.com/'.$insta_username.'/?__a=1');