JxInsta is distributed through JitPack, which builds and serves GitHub-hosted libraries on demand. You add JitPack as a repository, then declare the mobile or web artifact as a dependency. Both modules are independent — add only the one you need.
Choose a module
Both modules expose the same Java types but differ in how they authenticate and which features they support:
mobile — authenticates with a bearer token (username + password). Use this if you need direct messages, the home feed, or story uploads.
web — authenticates with session cookies (username + password). Use this for public endpoints, hashtag search, and profile scraping without a token.
If you are unsure which module to pick, start with web. It requires no token management and covers the most common read operations. Switch to mobile if you need DMs or the home feed.
Add the JitPack repository
Before adding the dependency, register the JitPack repository in your build configuration.
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add the dependency
Add one of the two module dependencies to your build file. Do not include both in the same project.
dependencies {
implementation 'com.github.Errorxcode.jxinsta:mobile:2.0' // Mobile API
// OR
implementation 'com.github.Errorxcode.jxinsta:web:2.0' // Web API
}
<!-- Mobile module -->
<dependency>
<groupId>com.github.Errorxcode.jxinsta</groupId>
<artifactId>mobile</artifactId>
<version>2.0</version>
</dependency>
<!-- Web module (use one or the other, not both) -->
<dependency>
<groupId>com.github.Errorxcode.jxinsta</groupId>
<artifactId>web</artifactId>
<version>2.0</version>
</dependency>
JitPack builds the library the first time it is requested. If your build stalls on dependency resolution, wait 60–90 seconds and retry — JitPack may be compiling the artifact for the first time.
Module comparison
| Feature | Mobile (com.jxinsta.mobile) | Web (com.jxinsta.web) |
|---|
| Authentication | Bearer token | Session cookies |
| Direct messages | Yes | No |
| Home feed | Yes | Yes |
| Story upload | Yes | No |
| Hashtag search | No | Yes |
| Profile fetch | Yes | Yes |
| Follower/following list | Yes | Yes |
| Like and comment | Yes | Yes |
| Public API | No | Yes |
Next steps
Once the dependency is on your classpath, proceed to the Quickstart to authenticate and make your first API call.