npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

instagram-bot-api

v1.0.1

Published

A professional Instagram Bot API with Realtime support, Multi-file Auth State, and Advanced Messaging features.

Readme

📸 Instagram Bot API (Professional Edition)


👤 Author & Support

Sheikh Tamim


🚀 Key Features

| Feature | Description | | :--- | :--- | | ⚡ Realtime MQTT | Sub-500ms latency for Direct Messages and Notifications. | | 🔐 Multi-File Auth | Baileys-style session management. No more re-logins! | | 🛠 Full Automation | Follow, Unfollow, Like, Comment, and Story interactions. | | 📁 Media Upload | High-quality Photo, Video, and Album uploads. | | 📡 Proxy Support | Built-in support for HTTP/SOCKS5 proxies. | | 🤖 Bot Logic | Easy-to-use event emitters for building responsive bots. |


📦 Installation

npm install instagram-bot-api

💻 Professional Code Examples

1️⃣ Advanced Login with Session Persistence

Stop logging in every time. Save your session to a folder and reuse it.

const { IgApiClient, useMultiFileAuthState } = require('instagram-bot-api');
const chalk = require('chalk');

async function initialize() {
  const ig = new IgApiClient();
  
  // 1. Setup Auth State (Persistence)
  const { state, saveCreds } = await useMultiFileAuthState('./auth_sessions');
  
  // 2. Device Configuration
  ig.state.generateDevice(process.env.IG_USERNAME);
  
  // 3. Optional: Proxy Setup
  // ig.state.proxyUrl = 'http://user:pass@host:port';

  try {
    console.log(chalk.blue('Logging in...'));
    const user = await ig.account.login(process.env.IG_USERNAME, process.env.IG_PASSWORD);
    console.log(chalk.green(`Logged in as: ${user.username}`));
    
    // Always save creds after successful login
    await saveCreds();
  } catch (e) {
    console.error(chalk.red('Login failed:'), e.message);
  }
}

2️⃣ Realtime Message Listener

Listen to incoming DMs in real-time using the MQTT protocol.

const { RealtimeClient } = require('instagram-bot-api');

async function startRealtime(ig) {
  const realtime = new RealtimeClient(ig);

  realtime.on('message', (payload) => {
    const { message, thread } = payload;
    console.log(`New message in ${thread.thread_id}: ${message.text}`);
    
    // Auto-reply example
    if (message.text.toLowerCase() === 'hi') {
      thread.broadcastText('Hello! This is an automated response.');
    }
  });

  await realtime.connect();
}

3️⃣ Bulk Messaging / Automation

Safely interact with users using built-in delay helpers.

async function automate(ig) {
  const targetUser = 'sheikh.tamim_lover';
  const userId = await ig.user.getIdByUsername(targetUser);
  
  // Follow a user
  await ig.friendship.create(userId);
  
  // Like the latest post
  const feed = ig.feed.user(userId);
  const items = await feed.items();
  if (items.length > 0) {
    await ig.media.like({
      mediaId: items[0].pk,
      moduleInfo: { module_name: 'profile' }
    });
  }
}

🛠 Advanced Features Table

  • Realtime Protocols: Iris Handshake, Skywalker, and MQTT Integration.
  • Direct Messaging: 18+ methods including text, media, story sharing, and voice.
  • Account Security: Native device replication to prevent bans.
  • Feed Management: Explore, Timeline, User, and Hashtag feeds.

📞 Get In Touch

Need a custom bot or professional integration? Reach out to Sheikh Tamim via Email or Instagram for 24/7 support.


Developed with ❤️ by Sheikh Tamim