Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

insta-node-js

Latest version: v2.0.0

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
npm package Publisher: boruto7777
0 Stars
0 Forks
5 Versions
TypeScript Repo language

Scan summary

insta-node-js was last scanned on 23 Nov 2026 at version 2.0.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 5 versions, all published on 23 Nov 2026.
  • Findings: No rules fired in version 2.0.0.

Versions

5 versions published
Versions and the rules that fired in each
VersionPublishedStatus
2.0.0 LATEST 23 Nov 2026 No rules fired
1.0.2 23 Nov 2026 No rules fired
1.0.1 23 Nov 2026 No rules fired
1.0.0 23 Nov 2026 Not shown
0.0.0-stage 23 Nov 2026 Not shown

No rules fired in 2.0.0

Findings

Findings for v2.0.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 2.0.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

insta-node-js

💬 Support & community

👉 Join the Telegram channel

This is the Telegram channel where I offer support for clients — come join it. There is also another client by the same author, whalibmob — a WhatsApp client for SMS registration and more. Right now I offer support for insta-node-js and whalibmob.

Library for the Instagram API with MQTT support and much more — featured 2026.

A standalone Node.js library for the Instagram mobile API, written in TypeScript. It is fully self-contained: its own HTTP layer, request signing and realtime MQTT stack, with no dependency on any other Instagram client library.

  • Full mobile API coverage: login (2FA / TOTP, challenges, session reuse), users, followers, media, comments, likes, uploads (photo, video, album, Reels, IGTV, stories), downloads, stories, highlights, collections, hashtags, locations, Direct, notes, insights, notifications, search, music, Facebook/Threads cross-posting, signup and multiple accounts.
  • Realtime MQTT (MQTToT): live Direct messages, typing, seen and presence events, and sending Direct actions over MQTT.
  • FBNS push notifications over MQTT.
  • Native MQTT/Thrift implementation (no MQTT library needed).
  • Every error is a Boom error with an HTTP-like status code.
  • Typed models, async API, HTTP/SOCKS proxies, persistent sessions.

Table of contents

  • Requirements
  • Installation
  • Dependencies
  • Quick start
  • Conventions
  • Client options
  • Authentication
    • Login with username and password
    • Saving and reusing the session
    • Login with a sessionid
    • Two-factor authentication
    • Challenges (email / SMS codes)
    • Captcha
    • Logout
  • Proxy
  • Device, locale and timezone
  • Account
  • Users
  • Media
  • Comments
  • Uploading
  • Stories
  • Downloading
  • Highlights
  • Collections
  • Hashtags
  • Locations
  • Search
  • Direct messages
  • Notes
  • Insights
  • Explore, Reels and music
  • Pagination
  • Realtime MQTT
  • FBNS push notifications
  • Error handling (Boom)
  • Logging
  • Models
  • Disclaimer
  • License

Requirements

  • Node.js 20.9 or newer
  • Optional: ffmpeg and ffprobe for video processing (video, Reels, IGTV and video story uploads, StoryBuilder). They are installed automatically through the optional packages ffmpeg-static and ffprobe-static. A system binary also works (found on PATH, or set FFMPEG_PATH / FFPROBE_PATH).

Installation

From npm:

npm install insta-node-js

The npm package name is lowercase (insta-node-js), as npm requires; the GitHub repository is Kunboruto20/Insta-node-js.

Dependencies

Package Purpose
undici HTTP client (HTTP/1.1 and HTTP/2, keep-alive, HTTP/HTTPS proxies)
socks SOCKS4 / SOCKS5 proxies (HTTP requests and realtime / FBNS MQTT connections)
sharp Image processing (resize, crop, JPEG conversion, thumbnails)
@hapi/boom Errors with HTTP status codes
ffmpeg-static (optional) ffmpeg binary for video processing
ffprobe-static (optional) ffprobe binary for video metadata

sharp is loaded only when an image has to be processed. On platforms without a prebuilt sharp binary (for example Android / Termux) the library works normally, and only image processing (photo uploads, thumbnails, StoryBuilder) throws a Boom 424 error.

On Android / Termux, install the WebAssembly build of sharp to enable image processing:

npm install @img/sharp-wasm32

Video processing on Termux uses the system ffmpeg:

pkg install ffmpeg

With the WebAssembly build, StoryBuilder works without a caption; captions need a native sharp binary.

Quick start

import { Client } from 'insta-node-js';

async function main() {
  const cl = new Client();
  await cl.login('USERNAME', 'PASSWORD');

  const user = await cl.userInfoByUsername('instagram');
  console.log(user.pk, user.full_name, user.follower_count);

  const medias = await cl.userMedias(user.pk, 10);
  for (const media of medias) {
    console.log(media.code, media.like_count, media.caption_text);
  }
}

main().catch(console.error);

CommonJS:

const { Client } = require('insta-node-js');

Conventions

  • Methods are camelCase and async. Every method that talks to Instagram returns a Promise.
  • Model fields are snake_case, exactly as Instagram returns them: user.full_name, media.like_count, media.taken_at.
  • IDs are strings (user.pk, media.pk, media.id), because they can exceed Number.MAX_SAFE_INTEGER. Methods accept strings or numbers.
  • media.pk is the numeric media id (3141592653589793238). media.id is "<media_pk>_<owner_pk>". Most media methods accept either.
  • Methods with many optional arguments take an options object as the last parameter (for example photoUpload(path, caption, { usertags, location })).
  • Errors are Boom errors (see Error handling).

The library is written in TypeScript and ships full type definitions. This README covers the common tasks with examples, but the client has hundreds of methods; they are all nicely typed, so the full set of methods and their options shows up in your editor's autocomplete (IntelliSense in VS Code and similar). If you need a method that is not in this README, start typing client. and your editor will list what is available, with typed parameters and return values.

Client options

import { Client } from 'insta-node-js';

const cl = new Client({
  proxy: 'http://user:pass@1.2.3.4:8080', // HTTP, HTTPS, SOCKS4 or SOCKS5 proxy
  delayRange: [1, 3],                      // random pause (seconds) before each private request
  requestTimeout: 1,                       // pause (seconds) between retried requests
  timezoneOffset: 7200,                    // seconds from UTC
  timezoneName: 'Europe/Bucharest',
  pushDisabled: false,
  tlsVerify: true,                         // or a path to a CA bundle
  privateTransport: 'http2',               // 'http1' | 'http2' | 'mobile'
  publicTransport: 'http1',                // 'http1' | 'http2'
  sessionRetryTotal: 3,
  sessionRetryBackoffFactor: 2,
  sessionRetryStatuses: [500, 502, 503, 504],
});

All options are optional. settings accepts an object previously returned by getSettings(); logger accepts a custom logger (see Logging).

Authentication

Login with username and password
const cl = new Client();
await cl.login('USERNAME', 'PASSWORD');
console.log(cl.userId, cl.username);
Saving and reusing the session

Logging in every time is slow and looks suspicious to Instagram. Save the session once and reuse it:

import { existsSync } from 'fs';
import { Client, LoginRequired } from 'insta-node-js';

const SESSION_FILE = 'session.json';

async function getClient(): Promise<Client> {
  const cl = new Client();
  if (existsSync(SESSION_FILE)) {
    await cl.loadSettings(SESSION_FILE); // restores cookies, device and uuids
  }
  await cl.login('USERNAME', 'PASSWORD'); // reuses the session when it is still valid

  try {
    await cl.getTimelineFeed(); // check that the session works
  } catch (err) {
    if (err instanceof LoginRequired) {
      await cl.relogin(); // fresh login with the same device
    } else {
      throw err;
    }
  }

  await cl.dumpSettings(SESSION_FILE);
  return cl;
}

Settings can also be kept in memory or in a database:

const settings = cl.getSettings(); // plain JSON object
// ... store it ...
const cl2 = new Client({ settings });
// or: cl2.setSettings(settings);
Login with a sessionid

Use the sessionid cookie from a logged-in browser or app:

await cl.loginBySessionid('1234567890%3AabcdEFGH...');
Two-factor authentication

With an authenticator app (TOTP), generate the code from the seed:

const code = cl.totpGenerateCode('YOUR_TOTP_SEED');
await cl.login('USERNAME', 'PASSWORD', false, code);

With a code received by SMS / WhatsApp / app, pass it as verificationCode:

import { TwoFactorRequired } from 'insta-node-js';

try {
  await cl.login('USERNAME', 'PASSWORD');
} catch (err) {
  if (err instanceof TwoFactorRequired) {
    const smsCode = '123456'; // read it from the user
    await cl.login('USERNAME', 'PASSWORD', false, smsCode);
  } else {
    throw err;
  }
}

Enable TOTP on your own account:

const seed = await cl.totpGenerateSeed();             // add this seed to your authenticator app
const backupCodes = await cl.totpEnable(cl.totpGenerateCode(seed));
await cl.totpDisable();
Challenges (email / SMS codes)

When Instagram asks for a security code, the client calls challengeCodeHandler. By default it reads the code from the terminal. Provide your own handler to read it from email, a database, a bot, etc.:

import { ChallengeChoice } from 'insta-node-js';

cl.challengeCodeHandler = async (username, choice) => {
  if (choice === ChallengeChoice.EMAIL) {
    return await readCodeFromEmail(username);
  }
  return await readCodeFromSms(username);
};

// when Instagram forces a password change during a challenge
cl.changePasswordHandler = async (username) => 'NEW_STRONG_PASSWORD';

declare function readCodeFromEmail(username: string): Promise<string>;
declare function readCodeFromSms(username: string): Promise<string>;
Captcha
cl.setCaptchaHandler(async (details) => {
  // solve details (site key, url, ...) with your captcha service and return the token
  return 'CAPTCHA_TOKEN';
});
Logout
await cl.logout();

Proxy

cl.setProxy('http://user:pass@1.2.3.4:8080');
cl.setProxy('socks5://user:pass@1.2.3.4:1080');
cl.setProxy(null); // no proxy

The proxy is used for every connection the client makes: API and web requests, media downloads (including images passed to uploads as URLs) and the realtime / FBNS MQTT connections (http, https, socks4, socks4a, socks5, socks5h).

Device, locale and timezone

cl.setLocale('en_US');
cl.setCountry('US');
cl.setCountryCode(1);
cl.setTimezoneOffset(-5 * 3600, 'America/New_York');

cl.setDevice({
  manufacturer: 'samsung',
  model: 'SM-S918B',
  device: 'dm3q',
  android_version: 34,
  android_release: '14',
  dpi: '480dpi',
  resolution: '1080x2340',
  cpu: 'qcom',
});
cl.setUserAgent(); // rebuild the user agent from the device settings

Change these before the first login and keep them stable afterwards (they are saved in the settings).

Account

const me = await cl.accountInfo();
console.log(me.username, me.email, me.phone_number);

await cl.accountSetBiography('Hello from Node.js');
await cl.accountChangePicture('./avatar.jpg');
await cl.accountEdit({ full_name: 'New Name', external_url: 'https://example.com' });
await cl.accountSetPrivate();
await cl.accountSetPublic();
await cl.changePassword('OLD_PASSWORD', 'NEW_PASSWORD');

Users

const userId = await cl.userIdFromUsername('instagram');
const user = await cl.userInfo(userId);
const sameUser = await cl.userInfoByUsername('instagram');

console.log(user.username, user.follower_count, user.following_count, user.media_count, user.biography);

// followers / following are Maps keyed by user pk
const followers = await cl.userFollowers(userId, true, 100);
for (const [pk, follower] of followers) console.log(pk, follower.username);

const following = await cl.userFollowing(userId, true, 100);

await cl.userFollow(userId);
await cl.userUnfollow(userId);
await cl.userRemoveFollower(userId);
await cl.userBlock(userId);
await cl.userUnblock(userId);
await cl.closeFriendAdd(userId);

const medias = await cl.userMedias(userId, 20);
const reels = await cl.userClips(userId, 20);
const results = await cl.searchUsers('nasa');

Media

const pk = cl.mediaPkFromCode('B1LbfVPlwIA');               // from a shortcode
const pkFromUrl = await cl.mediaPkFromUrl('https://www.instagram.com/p/B1LbfVPlwIA/');
const code = cl.mediaCodeFromPk(pk);

const media = await cl.mediaInfo(pk);
console.log(media.media_type, media.product_type, media.caption_text, media.like_count, media.comment_count);
// media_type: 1 photo, 2 video (product_type 'feed' | 'igtv' | 'clips'), 8 album

const owner = await cl.mediaUser(pk);
const likers = await cl.mediaLikers(media.id);

await cl.mediaLike(media.id);
await cl.mediaUnlike(media.id);
await cl.mediaSave(media.id);
await cl.mediaArchive(media.id);
await cl.mediaEdit(media.id, 'New caption #tag');
await cl.mediaDelete(media.id);
await cl.mediaSeen([media.id]);

Comments

const comments = await cl.mediaComments(media.id, 50);
for (const c of comments) console.log(c.user.username, c.text);

const comment = await cl.mediaComment(media.id, 'Nice! 🔥');
await cl.mediaComment(media.id, 'Reply', comment.pk); // reply to a comment

await cl.commentLike(comment.pk);
await cl.commentLike(comment.pk, true); // unlike
await cl.commentPin(media.id, comment.pk);
await cl.commentBulkDelete(media.id, [comment.pk]);

Uploading

Photos (JPG, PNG, WEBP; converted and resized automatically):

import { makeUsertag, makeLocation } from 'insta-node-js';

const someone = await cl.userInfoByUsername('instagram');

const photo = await cl.photoUpload('./photo.jpg', 'Caption #hashtag @mention', {
  usertags: [makeUsertag({ user: someone, x: 0.5, y: 0.5 })],
  location: makeLocation({ name: 'Bucharest', lat: 44.4268, lng: 26.1025 }),
});
console.log(photo.code);

Video, album, Reels and IGTV (video needs ffmpeg):

await cl.videoUpload('./video.mp4', 'My video', { thumbnail: './cover.jpg' });

await cl.albumUpload(['./1.jpg', './2.jpg', './3.mp4'], 'Album caption');

await cl.clipUpload('./reel.mp4', 'My reel #reels', { thumbnail: './cover.jpg' });

const [track] = await cl.searchMusic('summer');
await cl.clipUploadWithMusic('./reel.mp4', 'Reel with music', track);

await cl.igtvUpload('./long-video.mp4', 'Title', 'Description');

Scheduling, coauthors and cross-posting:

await cl.photoUpload('./photo.jpg', 'Scheduled post', {
  scheduleAt: new Date(Date.now() + 2 * 3600 * 1000),
  coauthorUserIds: [someone.pk],
  shareToFacebook: true,
  shareToThreads: true,
});

Stories

Upload a story (photo or video) with stickers:

import { makeStoryMention, makeStoryLink, makeStoryHashtag } from 'insta-node-js';

const friend = await cl.userInfoByUsername('instagram');
const hashtag = await cl.hashtagInfo('nodejs');

const story = await cl.photoUploadToStory('./story.jpg', 'Story caption', {
  mentions: [makeStoryMention({ user: friend, x: 0.5, y: 0.5, width: 0.5, height: 0.1 })],
  links: [makeStoryLink({ webUri: 'https://example.com' })],
  hashtags: [makeStoryHashtag({ hashtag, x: 0.3, y: 0.7, width: 0.4, height: 0.1 })],
});

await cl.videoUploadToStory('./story.mp4', 'Video story');

Read stories:

const stories = await cl.userStories(friend.pk);
await cl.storySeen(stories.map((s) => s.pk));

const info = await cl.storyInfo(stories[0].pk);
const viewers = await cl.storyViewers(story.pk); // your own story
await cl.storyLike(stories[0].id);
await cl.storyDelete(story.pk);

Build a story image/video with a caption and mentions (StoryBuilder, needs ffmpeg):

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm insta-node-js

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

PHP2Shell, Day 5 93.6% of Measurable Instances Still Unpatched (1)
Vulnerability Insights

PHP2Shell, Day 5: The Panic Hasn’t Turned Into Patching

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Frame 2085668439 (1)
Group 1261154229