Skip to content

Commit

Permalink
add multiple endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
rocketapi-io committed Dec 30, 2022
1 parent ed29a9a commit a329b88
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
71 changes: 71 additions & 0 deletions rocketapi/instagramapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ def get_user_media(self, user_id, count=12, max_id=None):
payload['max_id'] = max_id
return self.request('instagram/user/get_media', payload)

def get_user_clips(self, user_id, max_id=None):
payload = {'id': user_id}
if max_id is not None:
payload['max_id'] = max_id
return self.request('instagram/user/get_clips', payload)

def get_user_guides(self, user_id, max_id=None):
payload = {'id': user_id}
if max_id is not None:
payload['max_id'] = max_id
return self.request('instagram/user/get_guides', payload)

def get_user_tags(self, user_id, count=12, max_id=None):
payload = {'id': user_id, 'count': count}
if max_id is not None:
payload['max_id'] = max_id
return self.request('instagram/user/get_tags', payload)

def get_user_following(self, user_id, count=12, max_id=None):
payload = {'id': user_id, 'count': count}
if max_id is not None:
Expand All @@ -56,6 +74,15 @@ def get_user_stories_bulk(self, user_ids):
def get_user_stories(self, user_id):
return self.get_user_stories_bulk([user_id])

def get_user_highlights(self, user_id):
return self.request('instagram/user/get_highlights', {'id': user_id})

def get_user_live(self, user_id):
return self.request('instagram/user/get_live', {'id': user_id})

def get_user_similar_accounts(self, user_id):
return self.request('instagram/user/get_similar_accounts', {'id': user_id})

def get_media_info(self, media_id):
return self.request('instagram/media/get_info', {'id': media_id})

Expand All @@ -71,8 +98,52 @@ def get_media_comments(self, media_id, can_support_threading=True, min_id=None):
payload['min_id'] = min_id
return self.request('instagram/media/get_comments', payload)

def get_media_shortcode_by_id(self, media_id):
return self.request('instagram/media/get_shortcode_by_id', {'id': media_id})

def get_media_id_by_shortcode(self, shortcode):
return self.request('instagram/media/get_id_by_shortcode', {'shortcode': shortcode})

def get_guide_info(self, guide_id):
return self.request('instagram/guide/get_info', {'id': guide_id})

def get_location_info(self, location_id):
return self.request('instagram/location/get_info', {'id': location_id})

def get_location_media(self, location_id, page=None, max_id=None):
payload = {'id': location_id}
if page is not None:
payload['page'] = page
if max_id is not None:
payload['max_id'] = max_id
return self.request('instagram/location/get_media', payload)

def get_hashtag_info(self, name):
return self.request('instagram/hashtag/get_info', {'name': name})

def get_hashtag_media(self, name, page=None, max_id=None):
payload = {'name': name}
if page is not None:
payload['page'] = page
if max_id is not None:
payload['max_id'] = max_id
return self.request('instagram/hashtag/get_media', payload)

def get_highlight_stories_bulk(self, highlight_ids):
return self.request('instagram/highlight/get_stories', {'ids': highlight_ids})

def get_highlight_stories(self, highlight_id):
return self.get_highlight_stories_bulk([highlight_id])

def get_comment_likes(self, comment_id, max_id=None):
payload = {'id': comment_id}
if max_id is not None:
payload['max_id'] = max_id
return self.request('instagram/comment/get_likes', payload)

def get_audio_media(self, audio_id, max_id=None):
payload = {'id': audio_id}
if max_id is not None:
payload['max_id'] = max_id
return self.request('instagram/audio/get_media', payload)

3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

setuptools.setup(
name="rocketapi",
version="1.0.0",
version="1.0.1",
author="RocketAPI",
author_email="developer@rocketapi.io",
description="RocketAPI Python SDK",
packages=["rocketapi"],
url="https://github.com/rocketapi-io/rocketapi-python",
download_url="https://github.com/rocketapi-io/rocketapi-python/archive/refs/tags/v1.0.1.tar.gz",
install_requires=["requests"]
)

0 comments on commit a329b88

Please sign in to comment.