Instagram how to get latest Instagram images right now it is fetching oldest images
I am using that code -
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");
why only 25 images is coming ?
This is the docu which I followed - 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
"pagingvalues? Perhaps you need to keep on calling it to get the extra images. - Nigel Ren