instagrapi icon indicating copy to clipboard operation
instagrapi copied to clipboard

Can we reach users with Instagram suggestions?

Open Veucci opened this issue 3 years ago • 2 comments

I want to see and follow my suggestion list. Can I see the suggestion list like the home page of the mobile app? Like this: suggestions

Veucci avatar Jan 20 '22 21:01 Veucci

I worked on this last week. There is currently a public request method 'profile_related_info' in the library. However, Instagram is no longer responding to this public request. Instead I found an "fbsearch" request with the fbsearch/accounts_recs/ endpoint from web browser network activities.

I added the following method to fbsearch.py. It returns 80 suggested profiles for each profile.

def fbsearch_suggested_profiles(self, user_id: str) -> List[UserShort]:
        params = {
            "target_user_id": user_id,
            "include_friendship_status": "true",
        }
        result = self.private_request("fbsearch/accounts_recs/", params=params)
        return result["users"]

abdullahbektass avatar Jan 31 '22 06:01 abdullahbektass

@abdullahbektass Thank you, It really works. I've create a PR, so it will be easier for other to use if merged.

yeeyou avatar Mar 21 '22 16:03 yeeyou