ProfileData is the data carrier for Instagram user information returned by the mobile API. Profile extends ProfileData and adds action methods that operate on the authenticated session — such as following, unfollowing, blocking, and fetching a user’s posts, stories, and highlights. You obtain a Profile instance from JxInsta.getProfile(username), which populates all fields and binds the auth token for subsequent calls.
ProfileData fields
ProfileData is populated from the raw JSON object returned by the Instagram user info endpoint. All fields are public and set in the constructor.
The account’s Instagram username (the handle shown after
@).The user’s unique numeric primary key as returned by the API. Resolved from
pk_id, pk, or id in that order of preference.The user’s display name (full name), sourced from the
full_name field.The text content of the user’s profile bio.
The URL of the user’s current profile picture, sourced from
profile_pic_url.true if the account is set to private, false if it is public.true if the account has a verified badge.true if the account is registered as a business profile, sourced from is_business.Total number of media posts published by the account, sourced from
media_count.The account’s current follower count, sourced from
follower_count.The number of accounts the user is following, sourced from
following_count.toString()
Returns a human-readable representation of all ProfileData fields, useful for logging and debugging.
ProfileData.java
Profile methods
Profile extends ProfileData and requires an auth token. All methods below use the token bound during construction.
getPosts()
Returns a PostPaginator for lazily iterating through all media posts published by this user. No network request is made until the paginator is advanced.
Profile.java
PostPaginator
getFollowers()
Returns a ProfilePaginator for lazily iterating through the user’s follower list. Each page yields a batch of ProfileData objects.
Profile.java
ProfilePaginator
getFollowings()
Returns a ProfilePaginator for lazily iterating through the list of accounts this user follows.
Profile.java
ProfilePaginator
getStory()
Fetches the currently active story items for this user. Returns an empty list if the user has no active stories or if the items key is absent from the API response.
Profile.java
List<Story>
Throws — InstagramException
getHighlights()
Fetches all story items stored in this user’s highlight reels. Items from every highlight tray are flattened into a single list.
Profile.java
List<Story>
Throws — InstagramException
follow()
Sends a follow request to this user. For private accounts this creates a pending request; for public accounts the follow is immediate.
Profile.java
void
Throws — InstagramException
unfollow()
Unfollows this user on behalf of the authenticated account.
Profile.java
void
Throws — InstagramException
block()
Blocks this user, preventing them from viewing the authenticated account’s profile and posts.
Profile.java
void
Throws — InstagramException