【发布时间】:2020-04-17 13:24:31
【问题描述】:
Instagram 如何现在获取最新的 Instagram 图片它正在获取最旧的图片
我正在使用该代码 -
function insta( $api_url ){
$connection_c = curl_init(); // initializing
curl_setopt( $connection_c, CURLOPT_URL, $api_url ); // API URL to connect
curl_setopt( $connection_c, CURLOPT_RETURNTRANSFER, 1 ); // return the result, do not print
curl_setopt( $connection_c, CURLOPT_TIMEOUT, 20 );
$json_return = curl_exec( $connection_c ); // connect and get json data
curl_close( $connection_c ); // close connection
return json_decode( $json_return ); // decode and return
}
$return = insta("https://graph.instagram.com/me/media?fields=id,caption&access_token=xyz");
为什么只有 25 张图片来了?
这是我遵循的文档 - 1 - https://developers.facebook.com/docs/instagram-basic-display-api/getting-started
2 - https://developers.facebook.com/docs/instagram-basic-display-api/guides/getting-profiles-and-media
【问题讨论】:
-
您有 API 文档的链接吗?是否指定返回的默认图像数量?
-
@NigelRen 我在我的问题中提到了 doc,但我没有看到任何默认数字
-
在响应 JSON 中,您有
"paging值吗?也许你需要继续调用它来获取额外的图像。 -
@NigelRen 是的,我认为分页值会在那里,但我只需要最新的 5 张图片,只需要最新的日期
标签: php instagram instagram-api instagram-graph-api