madhavtripathi05 / insta_public_api

Fetch details of a public Instagram account just by entering their username.
https://pub.dev/packages/insta_public_api
MIT License
6 stars 2 forks source link

Insta Public API

Fetch details of a public Instagram account just by entering their username

// Import the package
import 'package:insta_public_api/insta_public_api.dart';

// Initialize with username (must be public)
final ipa = InstaPublicApi('username');

// Get info like Full Name, Followers, Following etc
final info = await ipa.getBasicInfo();

print('Posts: ${info.noOfPosts}');
print('Followers: ${info.followers}');
print('Following: ${info.following}');

/*
  Basic Info contains:
    isPrivate,
    isVerified,
    profilePic,
    followers,
    following,
    fullName,
    noOfPosts,
    bio and more.
*/

// Get a List of Post with nested images and details eg. number of likes, comments, caption etc for first 12 posts.
final timelinePosts = await ipa.getTimelinePosts();

// Get List of all the posts present on the profile (by default limited to 100, can be modified)
final posts = await ipa.getAllPosts();

/*
  Each Post Contains:
    Nested images,
    no. of comments,
    no. of likes,
    captions and more.
*/

Example App

Example App
Click Here for Code

Currently Available Methods

Inspired from this article