Problem to solve
In the official Instagram Android app, under the Reels section, there is a "Friends" tab (next to Reels/Following). This tab displays a timeline feed of Reels that your friends have liked or interacted with. I want to build a cron job that checks this feed every 30 minutes to see what Reels my friends are liking, so I don't have to manually scroll through Instagram to stay connected with their interests. Currently, instagrapi supports clips/connected/ and clips/discover/ but there is no method to fetch this specific "Friends" reels feed.
Proposed API
# Add a new method in instagrapi/mixins/timeline.py under ReelsMixin
def friends_reels(self, amount: int = 10, last_media_pk: int = 0) -> List[Media]:
"""
Get reels from the 'Friends' tab (reels your friends liked)
"""
return self.reels_timeline_media("friends_reels", amount, last_media_pk) # also in Media we need liked friend detail (name, profile) as Instagram app shows it in the feed
Or maybe something else
Example usage
from instagrapi import Client
cl = Client()
cl.login("username", "password")
# Fetch 20 recent reels from the Friends tab
recent_friends_reels = cl.friends_reels(amount=20)
for reel in recent_friends_reels:
print(f"Reel {reel.pk} liked by friends") # also username of friends who liked it
Why current methods are insufficient
Currently, client.reels() uses clips/connected/ (which fetches reels from accounts you follow) and client.explore_reels() uses clips/discover/. Neither of these returns the specific feed of reels that friends have liked, which is what the "Friends" tab in the app does.
Does this require new Instagram endpoint knowledge?
yes
References, logs, HAR, or similar implementations
I cannot intercept the API call to find the exact endpoint because the Instagram app uses TLS pinning on Android, and I do not have a rooted device with a bypass setup. It is highly likely the endpoint is something similar to clips/friends/ or clips/friends_reels/. If anyone with an unpinned testing environment can switch to the "Friends" tab in Reels and capture the endpoint, we could easily add it to ReelsMixin.reels_timeline_media().
Problem to solve
In the official Instagram Android app, under the Reels section, there is a "Friends" tab (next to Reels/Following). This tab displays a timeline feed of Reels that your friends have liked or interacted with. I want to build a cron job that checks this feed every 30 minutes to see what Reels my friends are liking, so I don't have to manually scroll through Instagram to stay connected with their interests. Currently, instagrapi supports clips/connected/ and clips/discover/ but there is no method to fetch this specific "Friends" reels feed.
Proposed API
Example usage
Why current methods are insufficient
Currently, client.reels() uses clips/connected/ (which fetches reels from accounts you follow) and client.explore_reels() uses clips/discover/. Neither of these returns the specific feed of reels that friends have liked, which is what the "Friends" tab in the app does.
Does this require new Instagram endpoint knowledge?
yes
References, logs, HAR, or similar implementations
I cannot intercept the API call to find the exact endpoint because the Instagram app uses TLS pinning on Android, and I do not have a rooted device with a bypass setup. It is highly likely the endpoint is something similar to clips/friends/ or clips/friends_reels/. If anyone with an unpinned testing environment can switch to the "Friends" tab in Reels and capture the endpoint, we could easily add it to ReelsMixin.reels_timeline_media().