InstagramBot

@ExperimentalCoroutinesApi()
class InstagramBot

Functions

approveAllPendingFollowRequests
Link copied to clipboard
suspend fun approveAllPendingFollowRequests(): Flow<String>
Approve all pending follow requests
approveAllPendingThreadRequests
Link copied to clipboard
suspend fun approveAllPendingThreadRequests(): Flow<String>
Approve all pending message request of user(self)
approvePendingFollowRequest
Link copied to clipboard
fun approvePendingFollowRequest(username: String): Boolean
Approve pending follow request of given user
archiveMedias
Link copied to clipboard
fun archiveMedias(mediaIds: List<String>): Flow<String>
Archive given medias
blockUsers
Link copied to clipboard
fun blockUsers(usernames: List<String>): Flow<String>
Block given users
changePassword
Link copied to clipboard
fun changePassword(newPassword: String): Boolean
Change password of user(self)
commentMedias
Link copied to clipboard
fun commentMedias(mediaIds: List<String>, commentList: List<String>): Flow<String>
Comment given amount of medias with given comment text
commentMediasByExplorePage
Link copied to clipboard
suspend fun commentMediasByExplorePage(commentList: List<String>, amountOfMedias: Int): Flow<String>
Comment given amount of medias from explore page of user(self) with given comment text
commentMediasByHashTag
Link copied to clipboard
suspend fun commentMediasByHashTag(hashTag: String, commentList: List<String>, amountOfMedias: Int = 5): Flow<String>
Comment given amount of hashtag medias with given comment text
commentMediasByLocation
Link copied to clipboard
suspend fun commentMediasByLocation(locationName: String, commentList: List<String>, amountOfMedias: Int = 5, amountOfLocation: Int = 5): Flow<String>
Comment given amount of medias of given location with given comment text
commentMediasByTimeline
Link copied to clipboard
suspend fun commentMediasByTimeline(commentList: List<String>, amountOfMedias: Int = 5): Flow<String>
Comment given amount of medias from timeline of user(self) with given comment text
commentMediasByUser
Link copied to clipboard
suspend fun commentMediasByUser(username: String, commentList: List<String>, amountOfMedias: Int = 5): Flow<String>
Comment given amount of medias of given user with given comment text
deleteComment
Link copied to clipboard
fun deleteComment(mediaId: String, commentId: String): Boolean
Delete comment by given comment of given media
deleteMedias
Link copied to clipboard
fun deleteMedias(mediaIds: List<String>): Flow<String>
Delete list of given medias
downloadMedia
Link copied to clipboard
suspend fun downloadMedia(url: String, username: String, folderName: String, fileName: String): Boolean
Generic method to download given media (story, photo, video)
downloadUserMedias
Link copied to clipboard
suspend fun downloadUserMedias(username: String, amountOfMedias: Int, saveCaption: Boolean = false): Flow<String>
Download given numbers of media of given users
downloadUserStories
Link copied to clipboard
fun downloadUserStories(username: String): Flow<String>
download stories of given user
editProfile
Link copied to clipboard
fun editProfile(firstName: String, biography: String, email: String, gender: Int, phone: String, url: String = ""): JSONObject?
Edit profile of user(self)
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
followExploreTabUsers
Link copied to clipboard
suspend fun followExploreTabUsers(amountOfUsers: Int): Flow<String>
Follow given amount of users appeared on explore page of user(self)
followUserFollowers
Link copied to clipboard
suspend fun followUserFollowers(username: String, amountOfFollowers: Int, isFilterPrivate: Boolean = false, isFilterVerified: Boolean = false): Flow<String>
Follow given amount of followers of given user
followUserFollowing
Link copied to clipboard
suspend fun followUserFollowing(username: String, amountOfFollowing: Int, isFilterPrivate: Boolean = false, isFilterVerified: Boolean = false): Flow<String>
Follow given amount of following of given user
followUsers
Link copied to clipboard
fun followUsers(usernames: List<String>): Flow<String>
Follow given amount of users
followUsersByLocation
Link copied to clipboard
suspend fun followUsersByLocation(locationName: String, amountOfUsers: Int): Flow<String>
Follow given amount of users having given location
getAllUsersByExplorePage
Link copied to clipboard
fun getAllUsersByExplorePage(): Flow<JSONObject>
Get list of all users whose media appeared in explore page and users that are tagged in it
getAllUsersByLocation
Link copied to clipboard
fun getAllUsersByLocation(locationName: String, amountOfUsers: Int, amountOfLocation: Int = 5): Flow<JSONObject>
Get list of all users whose media appeared in given location and users that are tagged in it
getCommentLikers
Link copied to clipboard
fun getCommentLikers(commentId: String): Flow<JSONObject>
Get likers(user who liked comment) of given comment
getInbox
Link copied to clipboard
fun getInbox(): Flow<JSONObject>
Get inbox(direct messages) of user(self)
getLikedMedias
Link copied to clipboard
fun getLikedMedias(amountOfMedias: Int = Int.MAX_VALUE): Flow<JSONObject>
Get given number of medias liked user(self)
getMediaCommenters
Link copied to clipboard
fun getMediaCommenters(mediaId: String, amountOfUsers: Int = 10): Flow<JSONObject>
Get given number of commenter(user who commented on media) of given media
getMediaComments
Link copied to clipboard
fun getMediaComments(mediaId: String, amountOfComments: Int = 5): Flow<JSONObject>
Get given number of comments of given media
getMediaIdFromLink
Link copied to clipboard
fun getMediaIdFromLink(mediaLink: String): String?
Get media id from link
getMediaInfo
Link copied to clipboard
fun getMediaInfo(mediaId: String): JSONObject?
Get media info by given media id
getMediaLikers
Link copied to clipboard
fun getMediaLikers(mediaId: String, amountOfUsers: Int = 10): Flow<JSONObject>
Get likers(user who liked media) of given media
getMediaLinkFromId
Link copied to clipboard
fun getMediaLinkFromId(mediaId: String): String
Get media link from id
getMediasByExplorePage
Link copied to clipboard
fun getMediasByExplorePage(amountOfMedias: Int = 5): Flow<JSONObject>
Get list of medias from explore page of user(self)
getMediasByHashTag
Link copied to clipboard
fun getMediasByHashTag(hashTag: String, amountOfMedias: Int = 5): Flow<JSONObject>
Get given number of medias of given hashtag
getMediasByLocation
Link copied to clipboard
fun getMediasByLocation(locationName: String, amountOfMedias: Int = 5, amountOfLocation: Int = 5): Flow<JSONObject>
Get list of medias by given location
getMediasBySelf
Link copied to clipboard
fun getMediasBySelf(amountOfMedias: Int = Int.MAX_VALUE): Flow<JSONObject>
Get given number of medias of user(self)
getMediasByTaggedUser
Link copied to clipboard
fun getMediasByTaggedUser(username: String): Flow<JSONObject>
Get medias tagged to given user
getMediasByTimeline
Link copied to clipboard
fun getMediasByTimeline(amountOfMedias: Int = 5): Flow<JSONObject>
Get timeline medias of user(self)
getMediasByUser
Link copied to clipboard
fun getMediasByUser(username: String, amountOfMedias: Int = Int.MAX_VALUE): Flow<JSONObject>
Get given number of medias of given user
getMutedUsers
Link copied to clipboard
fun getMutedUsers(): Flow<JSONObject>
Get list of user that are muted by user(self)
getPendingFollowRequests
Link copied to clipboard
fun getPendingFollowRequests(): Flow<JSONObject>
Get all pending follow requests of user(self)
getPendingThreadRequests
Link copied to clipboard
fun getPendingThreadRequests(): Flow<JSONObject>
Get all pending message requests of user(self)
getProfileData
Link copied to clipboard
fun getProfileData(): JSONObject?
Get profile information of user(self)
getSavedMedias
Link copied to clipboard
fun getSavedMedias(): Flow<JSONObject>
Get list of saved medias of user(self)
getSelfFollowers
Link copied to clipboard
fun getSelfFollowers(amountOfFollowers: Int = Int.MAX_VALUE, isUsername: Boolean = false, isFilterPrivate: Boolean = false, isFilterVerified: Boolean = false, fileNameToWrite: String = "", isOverwrite: Boolean = false): Flow<String>
Get follower list of self
getSelfFollowing
Link copied to clipboard
fun getSelfFollowing(amountOfFollowing: Int = Int.MAX_VALUE, isUsername: Boolean = false, isFilterPrivate: Boolean = false, isFilterVerified: Boolean = false, fileNameToWrite: String = "", isOverwrite: Boolean = false): Flow<String>
Get following list of self
getSelfStoryViewers
Link copied to clipboard
fun getSelfStoryViewers(): Flow<JSONObject>
Get list of story viewers of user(self)
getUserFollowers
Link copied to clipboard
fun getUserFollowers(username: String, amountOfFollowers: Int = Int.MAX_VALUE, isUsername: Boolean = false, isFilterPrivate: Boolean = false, isFilterVerified: Boolean = false, fileNameToWrite: String = "", isOverwrite: Boolean = false): Flow<String>
Get follower list of given user
getUserFollowing
Link copied to clipboard
fun getUserFollowing(username: String, amountOfFollowing: Int = Int.MAX_VALUE, isUsername: Boolean = false, isFilterPrivate: Boolean = false, isFilterVerified: Boolean = false, fileNameToWrite: String = "", isOverwrite: Boolean = false): Flow<String>
Get following list of given user
getUserInfoByName
Link copied to clipboard
fun getUserInfoByName(username: String): JSONObject?
Get user information by given username
getUserLikers
Link copied to clipboard
suspend fun getUserLikers(username: String, amountOfUsers: Int = 5): List<JSONObject>
Get likers(user who liked recent medias) of given users
getUsersByExplorePage
Link copied to clipboard
fun getUsersByExplorePage(amountOfUsers: Int = 10): Flow<JSONObject>
Get list of users whose media appeared in explore page
getUsersByHashTag
Link copied to clipboard
fun getUsersByHashTag(hashTag: String, amountOfUsers: Int = 10): Flow<JSONObject>
Get given number of users of given hashtag
getUsersByLocation
Link copied to clipboard
fun getUsersByLocation(locationName: String, amountOfUsers: Int = 5, amountOfLocation: Int = 5): Flow<JSONObject>
Get list of users whose media appeared in given location
getUsersByTimeline
Link copied to clipboard
fun getUsersByTimeline(): Flow<JSONObject>
Get list of timeline users of user(self)
getUsersStories
Link copied to clipboard
fun getUsersStories(usernames: List<String>): Flow<JSONObject>
Get all info about stories of given users
getUsersStoriesItems
Link copied to clipboard
fun getUsersStoriesItems(usernames: List<String>): Flow<JSONObject>
Get all items of stories of given users individually
getUsersTaggedInExplorePage
Link copied to clipboard
fun getUsersTaggedInExplorePage(amountOfUsers: Int): Flow<JSONObject>
Get list of users tagged in explore page medias
getUsersTaggedInLocation
Link copied to clipboard
fun getUsersTaggedInLocation(locationName: String, amountOfUsers: Int = 5, amountOfLocation: Int = 5): Flow<JSONObject>
Get list of users tagged in medias of given location
hashCode
Link copied to clipboard
open fun hashCode(): Int
hideAllPendingThreadRequests
Link copied to clipboard
suspend fun hideAllPendingThreadRequests(): Flow<String>
Hide all pending message request of user(self)
likeComment
Link copied to clipboard
suspend fun likeComment(commentId: String): Boolean
Generic method to perform like action on given comment
likeMediaComments
Link copied to clipboard
suspend fun likeMediaComments(mediaId: String, amount: Int = 5): Flow<String>
Like given amount of comments of given media
likeMediasByExplorePage
Link copied to clipboard
suspend fun likeMediasByExplorePage(amountOfMedias: Int): Flow<String>
Like given amount of medias appeared in explore page of user(self)
likeMediasByHashTag
Link copied to clipboard
suspend fun likeMediasByHashTag(hashTag: String, amountOfMedias: Int = 5): Flow<String>
Like given amount of medias having given hashtag
likeMediasByLocation
Link copied to clipboard
suspend fun likeMediasByLocation(locationName: String, amountOfMedias: Int = 5, amountOfLocation: Int = 5): Flow<String>
Like given amount of medias having given location
likeMediasByTimeline
Link copied to clipboard
suspend fun likeMediasByTimeline(amountOfMedias: Int = 5): Flow<String>
Like given amount of medias appeared on timeline of user(self)
likeMediasByUser
Link copied to clipboard
suspend fun likeMediasByUser(username: String, amountOfMedias: Int = 5): Flow<String>
Like given amount of medias of given user
likeMediasByUserFollowers
Link copied to clipboard
suspend fun likeMediasByUserFollowers(username: String, amountOfFollowers: Int = 1, amountOfMedias: Int = 1): Flow<String>
Like given amount of medias of followers of given user
likeMediasByUserFollowing
Link copied to clipboard
suspend fun likeMediasByUserFollowing(username: String, amountOfFollowing: Int = 1, amountOfMedias: Int = 1): Flow<String>
Like given amount of medias of followings of given user
login
Link copied to clipboard
fun login(username: String, password: String, forceLogin: Boolean = false): Boolean
Login to instagram with given username/password and interactively handle all scenarios of Two factor authentication code and/or challenge required and/or login confirmation by showing options in prompt.
logout
Link copied to clipboard
fun logout(): Boolean
Logout from Instagram
prepare
Link copied to clipboard
fun prepare(username: String)
Prepare the api client before login
rejectAllPendingFollowRequests
Link copied to clipboard
suspend fun rejectAllPendingFollowRequests(): Flow<String>
Reject all pending follow requests
rejectAllPendingThreadRequests
Link copied to clipboard
suspend fun rejectAllPendingThreadRequests(): Flow<String>
Reject all pending message request of user(self)
rejectPendingFollowRequest
Link copied to clipboard
fun rejectPendingFollowRequest(username: String): Boolean
Reject pending follow request of given user
replyToComment
Link copied to clipboard
suspend fun replyToComment(mediaId: String, parentCommentId: String, commentText: String): Boolean
Generic method to perform reply on given comment of given media
searchUsers
Link copied to clipboard
fun searchUsers(username: String): Flow<JSONObject>
Get(search) list of users similar to given username
sendDirectHashTagToUsers
Link copied to clipboard
fun sendDirectHashTagToUsers(usernames: List<String>, hashTag: String, text: String, toGroup: Boolean = false): Flow<String>
Send direct hashtag to given users individually or in group
sendDirectLikeToUsers
Link copied to clipboard
fun sendDirectLikeToUsers(usernames: List<String>, toGroup: Boolean = false): Flow<String>
Send direct like to given users individually or in group
sendDirectMediaToUsers
Link copied to clipboard
fun sendDirectMediaToUsers(usernames: List<String>, mediaId: String, text: String, toGroup: Boolean = false): Flow<String>
Send direct media to given users individually or in group
sendDirectMessageToUsers
Link copied to clipboard
fun sendDirectMessageToUsers(usernames: List<String>, text: String, toGroup: Boolean = false): Flow<String>
Send direct messages to given users individually or in group
sendDirectPhotoToUsers
Link copied to clipboard
fun sendDirectPhotoToUsers(usernames: List<String>, filePath: String, toGroup: Boolean = false): Flow<String>
Send direct photo to given users individually or in group
sendDirectProfileToUsers
Link copied to clipboard
fun sendDirectProfileToUsers(usernames: List<String>, profileId: String, text: String, toGroup: Boolean = false): Flow<String>
Send direct profile to given users individually or in group
setAccountPrivate
Link copied to clipboard
fun setAccountPrivate(): Boolean
Set user(self) account as private
setAccountsPublic
Link copied to clipboard
fun setAccountsPublic(): Boolean
Set user(self) account as public
toString
Link copied to clipboard
open fun toString(): String
unArchiveMedias
Link copied to clipboard
fun unArchiveMedias(mediaIds: List<String>): Flow<String>
Generic method to perform Un-archive(unsave media from collection) action
unblockUsers
Link copied to clipboard
fun unblockUsers(usernames: List<String>): Flow<String>
Un-block(previously blocked) given users
unfollowNonFollowers
Link copied to clipboard
suspend fun unfollowNonFollowers(): Flow<String>
Unfollow users who are not following back to user(self)
unfollowUsers
Link copied to clipboard
fun unfollowUsers(usernames: List<String>): Flow<String>
Unfollow(previously followed) given amount of users
unlikeComment
Link copied to clipboard
suspend fun unlikeComment(commentId: String): Boolean
Generic method to perform Unlike action on given comment
unlikeMediaComments
Link copied to clipboard
fun unlikeMediaComments(mediaId: String): Flow<String>
Unlike(previously liked) comments of given media
unlikeMedias
Link copied to clipboard
fun unlikeMedias(mediaIds: List<String>): Flow<String>
Unlike(previously liked) given amount of medias
unlikeUserMedias
Link copied to clipboard
suspend fun unlikeUserMedias(username: String, amount: Int = 5): Flow<String>
Unlike(previously liked) given amount of medias of given user
watchExploreTabUsersStories
Link copied to clipboard
suspend fun watchExploreTabUsersStories(): Flow<Int>
Watch stories of users appeared in explore page
watchLocationUsersStories
Link copied to clipboard
suspend fun watchLocationUsersStories(locationName: String, amountOfUsers: Int, amountOfLocation: Int = 5): Flow<Int>
Watch stories of users having given location
watchUsersStories
Link copied to clipboard
suspend fun watchUsersStories(usernames: List<String>): Flow<Int>
Generic method to watch stories of given users It will use randomly generated amount of users in each iteration to limit getting amount of stories

Properties

lastJson
Link copied to clipboard
val lastJson: JsonResult?
Last JSON response
lastStatusCode
Link copied to clipboard
val lastStatusCode: Int
Status code of last response
maxSleepTime
Link copied to clipboard
var maxSleepTime: Int = 120
Maximum time in seconds to sleep before performing next action
minSleepTime
Link copied to clipboard
var minSleepTime: Int = 60
Minimum time in seconds to sleep before performing next action
username
Link copied to clipboard
val username: String
Username of instagram user