I'm using the Instagram API to get the number of people who follow a given account as follows.
$follow_info = file_get_contents('https://api.instagram.com/v1/users/477644454/followed-by?access_token=ACESS_TOKEN&count=-1');
$follow_info = @json_decode($follow_info, true);
This returns a set of 50 results. They do have a next_url
key in the array, but it becomes time consuming to keep on going to the next page of followers when dealing with tens of thousands.
I read on StackOverflow that setting the count
parameter to -1
would return the entire set. But, it doesn't seem to...
Option 1: The Manual Option. This first option is easy: just go to your profile on Instagram – the URL www.instagram.com/yourusername – and click on the “# followers” label up a the top. This will pop up a lightbox that will show you several pieces of information. The username of each person who follows you.
On the 29th of June, 2020, Instagram will stop using the old API (“Basic Permission”) to display photos from personal Instagram accounts to widgets. 3rd party apps using this, current API will no longer be able to display photos from your account if they don't switch to the new API after this date.
The Instagram Basic Display API allows users of your app to get basic profile information, photos, and videos in their Instagram accounts. The API can be used to access any type of Instagram account but only provides read-access to basic data.
Instagram limits the number of results returned in their API for all sorts of endpoints, and they change these limits arbitrarily, without warning, presumably to handle server load.
Several similar threads exist:
-1
returns 1 less result).In short, you won't be able to increase the maximum returned rows, and you'll be stuck paginating.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With