Skip to main content
JxInsta paginators implement Java’s Iterator<List<T>> interface, giving you a consistent hasNext() / next() loop across all paginated resources. Each call to next() fetches the next page from the API. Web paginators accept an optional cursor string for the initial page; mobile paginators manage cursor state internally.

Feed paginator

Iterate through posts on the logged-in user’s home feed.
FeedPaginator feed = insta.getFeed();
while (feed.hasNext()) {
    List<Post> posts = feed.next();
    for (Post post : posts) {
        System.out.println(post.caption);
    }
}

Post paginator

Iterate through posts on a user’s profile. Obtain a PostPaginator from a Profile instance.
PostPaginator posts = profile.getPosts();
while (posts.hasNext()) {
    List<Post> page = posts.next();
}

Profile paginator

Iterate through a user’s followers or followings. Both getFollowers and getFollowings return a ProfilePaginator that yields pages of Profile objects.
ProfilePaginator followers = profile.getFollowers();
while (followers.hasNext()) {
    List<Profile> page = followers.next();
    for (Profile user : page) {
        System.out.println(user.username);
    }
}

Comment paginator

Obtain a CommentPaginator from a Post instance to iterate through comments.
CommentPaginator comments = post.getComments();
while (comments.hasNext()) {
    List<Comment> page = comments.next();
}

Message paginator (mobile only)

Obtain a MessagePaginator from a Thread instance to paginate through message history.
MessagePaginator messages = thread.getMessages();

Hashtag paginator (web, no login required)

The web module includes a HashtagPaginator for browsing posts by hashtag without authentication. See public APIs for details.
All paginators implement Java’s standard Iterator interface. You can use them with any code that accepts an Iterator, including third-party libraries.
Web paginators take an optional cursor String — pass null for the first page. Mobile paginators manage cursor state internally and always start from the first page.

Build docs developers (and LLMs) love