Instagram bot implemented in Kotlin to perform all major operations supported by Instagram app.
Kotlin - A modern programming language for Android/JVM that makes developers happier.
Coroutines - For asynchronous programming
Flow - A cold asynchronous data stream that sequentially emits values and completes normally or with an exception.
JsonPathKt - A lighter and more efficient implementation of JsonPath in Kotlin
Add JitPack to your build.gradle.kts file
repositories {
...
maven(url = "https://jitpack.io")
}
Add Gradle dependency to your build.gradle.kts file
dependencies {
implementation("com.github.hadiyarajesh:insta-bot:Tag")
}
Set your Instagram username and password in Credentials.Kt file
object Credentials {
const val USERNAME = "your_instagram_username"
const val PASSWORD = "your_instagram_password"
}
Initialize InstagramBot class with credential value and call prepare method. Then, call login method to login into instagram. (Prepare method must be called before login method)
val username = Credentials.USERNAME
val password = Credentials.PASSWORD
val bot = InstagramBot()
bot.prepare(username)
bot.login(username, password)
Now you can perform any operations of your choice like.
// Get 100 followers of you
bot.getSelfFollowers(100).collect { println(it) }
// Like 5 medias from explore page
bot.likeMediasByExplorePage(5).collect { println(it) }
// Approve all pending follow requests
bot.approveAllPendingFollowRequests().collect { println(it) }
// Watch stories of 200 users based on given location
bot.watchLocationUsersStories("enter_location_name_here", 200).collect { println(it) }
For more details, refer BotTest file.
You can find ready to use sample scripts here
You can find documentation here
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by Instagram, Facebook inc. or any of its affiliates or subsidiaries. This is an independent and unofficial API. Use it at your own risk.