Skip to main content
JxInsta is an open-source Java library that wraps Instagram’s private API, continuing where the popular instagram4j library left off. It follows a clean object-oriented design — every Instagram entity (profile, post, story, message) is a first-class Java object with its own methods. You never need an official Instagram API token or a Facebook developer app to use it.
JxInsta uses Instagram’s undocumented private API. It is not affiliated with or endorsed by Meta or Instagram. Use it responsibly and within Instagram’s terms of service.

Two modules, one API surface

JxInsta ships as two independent Maven/Gradle artifacts. Both expose the same high-level Java types (Profile, Post, Story, etc.), but they authenticate differently and support different feature sets.
ModulePackageAuthenticationBest for
Mobilecom.jxinsta.mobileBearer token (username + password)DMs, feed, stories, social actions
Webcom.jxinsta.webSession cookies (username + password)Public endpoints, hashtag search, profiles
The Mobile module mimics the official Instagram Android app, exchanging credentials for a bearer token. The Web module mimics the Instagram website, maintaining a session via cookies. You only need one module per project — choose based on which features you need.

Key capabilities

JxInsta covers the most common Instagram automation needs out of the box:
  • Profiles — fetch bios, follower counts, post grids, and profile pictures; follow and unfollow users
  • Posts — like, dislike, and comment on posts; list likers; upload pictures; paginate comments
  • Direct messages — send and receive text and image DMs; paginate message history (Mobile module only)
  • Stories and highlights — read active stories and highlight reels for any user
  • Followers and following — paginate follower and following lists; check relationships
  • Feed — scroll the home feed and explore page (Mobile module)
  • Hashtag search — search posts by hashtag (Web module)

Get started

Installation

Add JxInsta to Gradle or Maven using the JitPack repository.

Quickstart

Authenticate, fetch a profile, and follow a user in under 10 lines of Java.

Authentication

Understand bearer tokens vs session cookies and how to cache them.