Prerequisites
- Java 21 or later
- Gradle or Maven build system
- An Instagram account (username and password)
Add the dependency
Add the JitPack repository and the JxInsta module to your build file. Choose
mobile for DM support or web for session-based access and public endpoints.- Gradle (Mobile)
- Gradle (Web)
settings.gradle
build.gradle
Authenticate
Create a To reuse an existing token:
JxInsta instance with your username and password. After login, save the credential for reuse to avoid repeated logins.- Mobile
- Web
Fetch a profile
Call
getProfile() with any Instagram username to retrieve profile data and perform social actions.Post a picture
Upload an image to Instagram using an
InputStream. Optionally disable likes and comments.Authentication guide
Learn more about login options, 2FA, and session reuse
Error handling
Handle every InstagramException reason code