早些时候我用过
https://www.instagram.com/graphql/query/?query_id=17888483320059182&variables=$result
现在从这个月开始,随着Instagram的变化,api我无法获得供稿。 任何建议都会有所帮助
答案 0 :(得分:0)
按照我的步骤
首先,您需要在Instagram开发者网站上注册您的应用程序并获取Client ID
& Client Secret
代码,然后您必须使用access_token
创建Client ID
& Client Secret
访问此处:https://elfsight.com/blog/2016/05/how-to-get-instagram-access-token/创建Client ID
,Client Secret
& access_token
然后,在控制器功能中添加以下代码
$access_token = 'xxxxxxxxxx.xxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; // your access_token will be this format
$count_feed = 2; // how many feed want to load
$requestURL = 'https://api.instagram.com/v1/users/self/media/recent?access_token='.$access_token.'&count='.$count_feed;
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $requestURL,
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => 1
));
$json_response = curl_exec($ch);
curl_close($ch);
$insta_feeds = json_decode($json_response, true);
_e($insta_feeds); // $insta_feeds['data'] will return feed
您可以使用 Instagram库获取Feed。在这里查看图书馆:https://github.com/suhindra/CodeIgniter-Instagram-API