instauto.helpers package
instauto.helpers.friendships module
- instauto.helpers.friendships.follow_user(client: ApiClient, user_id: Optional[int] = None, username: Optional[str] = None) bool
Send a follow request to a user.
Either user_id or username need to be provided. If both are provided, the user_id takes precedence.
- Parameters
client – your ApiClient
user_id – the user_id of the account to follow
username – the username of the account to follow
- Returns
True if success else False
- instauto.helpers.friendships.get_followers(client: ApiClient, limit: int, user_id: Optional[int] = None, username: Optional[str] = None) List[User]
Retrieve the first x amount of followers from an account.
Either user_id or username need to be provided. If both are provided, the user_id takes precedence.
- Parameters
client – your ApiClient
user_id – the user_id of the account to retrieve followers from
limit – the maximum amount of followers to retrieve
username – the username of the account to retrieve followers from
- Returns
A list containing Instagram user objects (examples/objects/user.json).
- instauto.helpers.friendships.get_following(client: ApiClient, limit: int, user_id: Optional[int] = None, username: Optional[str] = None) List[User]
Retrieve the first x amount of users that an account is following.
Either user_id or username need to be provided. If both are provided, the user_id takes precedence.
- Parameters
client – your ApiClient
user_id – the user_id of the account to retrieve following from
limit – the maximum amount of users to retrieve
username – the username of the account to retrieve following from
- Returns
A list containing Instagram user objects (examples/objects/user.json).
- instauto.helpers.friendships.unfollow_user(client: ApiClient, user_id: Optional[int] = None, username: Optional[str] = None) bool
Unfollow a user.
Either user_id or username need to be provided. If both are provided, the user_id takes precedence.
- Parameters
client – your ApiClient
user_id – the user_id of the account to unfollow
username – the username of the account to unfollow
- Returns
True if success else False
instauto.helpers.post module
- instauto.helpers.post.comment_post(client: ApiClient, media_id: str, comment: str) bool
Leave a comment on a post.
- Parameters
client – your ApiClient
media_id – the post to comment on
comment – the comment to place
- Returns
True if success else False
- instauto.helpers.post.get_commenters_of_post(client: ApiClient, media_id: str) List[User]
Get users that commented on a post.
- Parameters
client – your ApiClient
media_id – the post to retrieve the commenters from
- Returns
A list of Instagram user objects (objects/post.json).
- instauto.helpers.post.get_likers_of_post(client: ApiClient, media_id: str) List[User]
Get users that liked a post.
- Parameters
client – your ApiClient
media_id – the post to retrieve the likers from
- Returns
A list of Instagram user objects (objects/user.json).
- instauto.helpers.post.like_post(client: ApiClient, media_id: str) bool
Like a post.
- Parameters
client – your ApiClient
media_id – the post to like
- Returns
True if success else False
- instauto.helpers.post.retrieve_posts_from_tag(client: ApiClient, tag: str, limit: int) List[Post]
Retrieve x amount of posts tagged with a tag.
- Parameters
client – your ApiClient
limit – maximum amount of posts to retrieve
tag – the tag to search for
- Returns
A list of Instagram post objects (objects/post.json).
- instauto.helpers.post.retrieve_posts_from_user(client: ApiClient, limit: int, username: Optional[str] = None, user_id: Optional[int] = None) List[Post]
Retrieve x amount of posts from a user.
Either user_id or username need to be provided. If both are provided, the user_id takes precedence.
- Parameters
client – your ApiClient
limit – maximum amount of posts to retrieve
username – username of the account to retrieve posts from
user_id – user_id of the account to retrieve posts from
- Returns
A list of Instagram post objects (objects/post.json).
- instauto.helpers.post.retrieve_story_from_user(client: ApiClient, username: Optional[str] = None, user_id: Optional[int] = None) List[Story]
Retrieve x amount of posts from a user.
Either user_id or username need to be provided. If both are provided, the user_id takes precedence.
- Parameters
client – your ApiClient
limit – maximum amount of posts to retrieve
username – username of the account to retrieve posts from
user_id – user_id of the account to retrieve posts from
- Returns
A list of Instagram post objects (objects/post.json).
- instauto.helpers.post.save_post(client: ApiClient, media_id: str) bool
Save a post.
- Parameters
client – your ApiClient
media_id – the media_id of a post
- Returns
True if success else False
- instauto.helpers.post.unlike_post(client: ApiClient, media_id: str) bool
Undo the liking of a post.
- Parameters
client – your ApiClient
media_id – the media_id of a post
- Returns
True if success else False
Update the caption of a post.
- Parameters
client – your ApiClient
media_id – the media_id of a post
new_caption – the new caption
- Returns
True if success else False
- instauto.helpers.post.upload_image_to_feed(client: ApiClient, image_path: str, caption: Optional[str] = None, location: Optional[Location] = None) bool
Upload an image to your feed. Location and caption are optional.
- Parameters
client – your ApiClient
image_path – path to the image to upload
caption – the caption of the post
location – the location tag of the post
- Returns
True if success else False
instauto.helpers.search module
- instauto.helpers.search.get_user_by_username(client: ApiClient, username: str) Optional[User]
Retrieve a user by username.
- Parameters
client – your ApiClient
username – username to search for
- Returns
None if not found, else a user object (objects/user.json) containing the found user
- instauto.helpers.search.get_user_id_from_username(client: ApiClient, username: str) Optional[int]
Get the user id of a username.
- Parameters
client – your ApiClient
username – username to search for
- Returns
None if not found, else a user id of the found user
- instauto.helpers.search.search_username(client: ApiClient, username, count: int) List[User]
Search a username on Instagram.
- Parameters
client – your ApiClient
username – username to search
count – amount of results to retrieve
- Returns
List of user objects (objects/user.json) that Instagram matched with the provider username