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

cakkatrok-instagram-downloader

v2.0.2

Published

Instagram downloader for Node.js: download public reels, posts, videos, photos, and stories with simple API and CLI.

Readme

cakkatrok-instagram-downloader

Downloader media Instagram berbasis Node.js yang memakai endpoint SnapVideo.

Package ini mendukung:

  • Story Instagram dengan username saja.
  • Story Instagram dengan link story.
  • Reels dan postingan Instagram dengan link postingan.
  • Output media yang sudah difilter sesuai tipe: video hanya mengirim link video, foto hanya mengirim link foto.

Install

npm install cakkatrok-instagram-downloader

Untuk CLI global:

npm install -g cakkatrok-instagram-downloader

Usage

Download Story Dengan Username

const Instagram = require('cakkatrok-instagram-downloader');

Instagram.story('instagram')
  .then(result => {
    console.log(result.media);
  })
  .catch(console.error);

Username boleh memakai @:

Instagram.story('@instagram')
  .then(result => console.log(result.media))
  .catch(console.error);

Download Story Dengan Link

Instagram.story('https://www.instagram.com/stories/instagram/')
  .then(result => console.log(result.media))
  .catch(console.error);

Download Reels

Instagram.media('https://www.instagram.com/reel/SHORTCODE/')
  .then(result => console.log(result.media))
  .catch(console.error);

Download Postingan

Instagram.media('https://www.instagram.com/p/SHORTCODE/')
  .then(result => console.log(result.media))
  .catch(console.error);

Auto Mode

Function utama juga bisa dipakai langsung. Jika input bukan link, input dianggap sebagai username story.

Instagram('instagram')
  .then(result => console.log(result.media))
  .catch(console.error);

Instagram('https://www.instagram.com/reel/SHORTCODE/')
  .then(result => console.log(result.media))
  .catch(console.error);

Response

Contoh response:

{
  status: 'ok',
  input: 'instagram',
  query: 'https://www.instagram.com/stories/instagram/',
  type: 'story',
  media: [
    {
      url: 'https://dl.snapcdn.app/get?token=...',
      type: 'photo',
      text: '1080x1920',
      filename: 'SnapVideo.app_photo.jpg'
    },
    {
      url: 'https://dl.snapcdn.app/get?token=...',
      type: 'video',
      text: 'Download Video',
      filename: 'SnapVideo.app_video.mp4'
    }
  ],
  raw: {}
}

Catatan filtering:

  • Jika media adalah video, package hanya mengembalikan link video.
  • Thumbnail atau foto preview dari video tidak ikut dikirim.
  • Jika media adalah foto, package hanya mengembalikan link foto utama.
  • Jika story/carousel berisi foto dan video terpisah, keduanya tetap dikirim sebagai item berbeda.

Mixed Media

Satu story atau postingan bisa memiliki lebih dari satu tipe media, misalnya ada foto dan video dalam satu hasil. Package ini akan tetap mengirim semua media utama yang ditemukan.

Contoh response mixed media:

{
  status: 'ok',
  type: 'story',
  media: [
    {
      url: 'https://dl.snapcdn.app/get?token=...',
      type: 'photo',
      filename: 'story-photo.jpg'
    },
    {
      url: 'https://dl.snapcdn.app/get?token=...',
      type: 'video',
      filename: 'story-video.mp4'
    }
  ]
}

Gunakan field type untuk menentukan cara mengirim media. Ini berguna untuk bot WhatsApp atau Telegram karena foto dan video biasanya memakai method pengiriman yang berbeda.

Contoh Untuk Bot WhatsApp

Contoh umum:

const Instagram = require('cakkatrok-instagram-downloader');

async function sendInstagramToWhatsApp(sock, jid, input) {
  const result = await Instagram(input);

  for (const item of result.media) {
    if (item.type === 'video') {
      await sock.sendMessage(jid, {
        video: { url: item.url },
        caption: item.filename
      });
      continue;
    }

    if (item.type === 'photo') {
      await sock.sendMessage(jid, {
        image: { url: item.url },
        caption: item.filename
      });
      continue;
    }

    await sock.sendMessage(jid, {
      document: { url: item.url },
      fileName: item.filename
    });
  }
}

Contoh Untuk Bot Telegram

Contoh dengan Telegraf:

const Instagram = require('cakkatrok-instagram-downloader');

async function sendInstagramToTelegram(ctx, input) {
  const result = await Instagram(input);

  for (const item of result.media) {
    if (item.type === 'video') {
      await ctx.replyWithVideo(item.url, {
        caption: item.filename
      });
      continue;
    }

    if (item.type === 'photo') {
      await ctx.replyWithPhoto(item.url, {
        caption: item.filename
      });
      continue;
    }

    await ctx.replyWithDocument({
      url: item.url,
      filename: item.filename
    });
  }
}

CLI

Download story dengan username:

instagram-downloader instagram --story

Download story dengan link:

instagram-downloader https://www.instagram.com/stories/instagram/ --story

Download reels:

instagram-downloader https://www.instagram.com/reel/SHORTCODE/

Download postingan ke folder tertentu:

instagram-downloader https://www.instagram.com/p/SHORTCODE/ ./downloads

Test

npm test

Di PowerShell Windows, jika npm terkena execution policy, pakai:

npm.cmd test

Notes

  • Media dari akun private atau story yang tidak tersedia publik bisa gagal diproses.
  • Gunakan hanya untuk media yang memang boleh Anda akses dan simpan.

Credit

Created by RintisW.P.

Telegram: https://t.me/rintisdep

Bug Report

Jika menemukan bug, error endpoint, atau hasil media tidak sesuai, laporkan ke:

https://t.me/rintisdep

License

MIT