Filter media of followers list using private Instagram API in PHP

595 Views Asked by At

I'm using the Instagram private API to get the followers list of any user, and I want to filter users who have 10 or more media.

The result is an array of users with 10 or more media. However, I received a response

InstagramAPI\Response\FriendshipsShowManyResponse: Invalid user list.

I think my problem is in the following snippet. How can I fix this?

  $user_ids = [];
  foreach ($users as $i => $user) {
      if($user->getMediaCount()>10) {
           $user_ids[] = $user->getPk();
      }
  }
1

There are 1 best solutions below

0
On

This is deprecated by Instagram. See: https://www.instagram.com/developer/