From 3dcd190aeb082d37ce2cf8ddbe9a9519c268dbe1 Mon Sep 17 00:00:00 2001 From: Nolan McCarthy Date: Tue, 8 Nov 2022 09:52:08 -0800 Subject: [PATCH 1/2] added small api changes, added max_id parameter for timeline to allow iteration --- InstagramAPI/endpoints.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/InstagramAPI/endpoints.py b/InstagramAPI/endpoints.py index ecdd5d4..0521a7f 100644 --- a/InstagramAPI/endpoints.py +++ b/InstagramAPI/endpoints.py @@ -324,12 +324,17 @@ def get_profile_data(self): def get_recent_activity(self): return self._sendrequest('news/inbox/?') - def get_timeline(self): - return self._sendrequest('feed/timeline/?rank_token=' + str(self._ranktoken) + '&ranked_content=true&') + def get_timeline(self,max_id=''): + return self._sendrequest('feed/timeline/?rank_token=' + str(self._ranktoken) + '&ranked_content=true&max_id='+str(max_id or '')) def get_user_feed(self, username_id, max_id='', min_timestamp=None): return self._sendrequest( - 'feed/user/' + str(username_id) + '/?max_id=' + str(max_id) + '&min_timestamp=' + str(min_timestamp) + + 'feed/user/' + str(username_id) + '/?count=12&max_id=' + str(max_id) + '&min_timestamp=' + str(min_timestamp) + + '&rank_token=' + str(self._ranktoken) + '&ranked_content=true') + + def get_username_feed(self, username, max_id='', min_timestamp=None): + return self._sendrequest( + 'feed/user/' + str(username) + '/username/?count=12&max_id=' + str(max_id) + '&min_timestamp=' + str(min_timestamp) + '&rank_token=' + str(self._ranktoken) + '&ranked_content=true') def get_user_followers(self, username_id, max_id=None): From 8398f4c3348ad176d7604b93241c993583a26e3f Mon Sep 17 00:00:00 2001 From: Nolan McCarthy Date: Tue, 8 Nov 2022 10:20:07 -0800 Subject: [PATCH 2/2] added reels/stories api endpoint methods --- InstagramAPI/endpoints.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/InstagramAPI/endpoints.py b/InstagramAPI/endpoints.py index 0521a7f..fb76eab 100644 --- a/InstagramAPI/endpoints.py +++ b/InstagramAPI/endpoints.py @@ -327,6 +327,13 @@ def get_recent_activity(self): def get_timeline(self,max_id=''): return self._sendrequest('feed/timeline/?rank_token=' + str(self._ranktoken) + '&ranked_content=true&max_id='+str(max_id or '')) + def get_reels(self): + return self._sendrequest('feed/reels_tray/') + + def get_reel_info(self,reel_id): + return self._sendrequest('feed/reels_media/?reel_ids='+str(reel_id)) + + def get_user_feed(self, username_id, max_id='', min_timestamp=None): return self._sendrequest( 'feed/user/' + str(username_id) + '/?count=12&max_id=' + str(max_id) + '&min_timestamp=' + str(min_timestamp) +