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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@minhchi1509/instagram-downloader

v1.0.3

Published

Download all posts, reels, highlights, stoties of an Instagram account

Downloads

301

Readme

Features

  • Download photos, videos from all user posts
  • Download all user reels
  • Download all user highlight stories
  • Download all active stories of user
  • Download reel, highlight, post medias by its CODE
  • Delete All Instagram Posts on Your Account

[!WARNING] The above features only apply to public or private instagram profiles (you have already followed).

[!NOTE] All downloaded photos and videos will be saved in the Downloads folder (for Windows) on your computer.

Installation

npm install @minhchi1509/instagram-downloader

Usage

  • This is an example:
import {
  InstagramDownloader,
  ProfileCleaner,
} from "@minhchi1509/instagram-downloader";

// Cookies of your Instagram account. You can get it by using Cookie-Editor extension on Chrome
const cookies = "YOUR_INSTAGRAM_COOKIES";
// Username of the Instagram account you want to download
const username = "minhchi1509";

const instagramDownloader = new InstagramDownloader(cookies);
const profileCleaner = new ProfileCleaner(cookies);

// Download all posts of the user
instagramDownloader.post.downloadAllUserPosts(username);

// Download all reels of the user
instagramDownloader.reel.downloadAllUserReels(username);

// Download all highlights of the user
instagramDownloader.highlight.downloadAllUserHighlightStories(username);

// Download active stories of the user
instagramDownloader.story.downloadAllUserStories(username);

// Download reel, post, highlight medias by its code
const postCode = "DC6XbjFpCF8"; // From url: https://www.instagram.com/p/DC6XbjFpCF8/
const reelCode = "DBONFumvXTH"; // From url: https://www.instagram.com/reel/DBONFumvXTH/
const highlightId = "18040128229968128"; // From url: https://www.instagram.com/stories/highlights/18040128229968128/
instagramDownloader.post.downloadPostByCode(postCode);
instagramDownloader.reel.downloadReelByCode(reelCode);
instagramDownloader.highlight.downloadHighlightStoryById(highlightId);

// Delete all posts of your account
profileCleaner.clearAllPosts();

API Documentation

Download posts, reels, highlights, stories

instagramDownloader.post.downloadAllUserPosts(
  username,
  writeStatisticFile,
  downloadMedia,
  limit
);
instagramDownloader.reel.downloadAllUserReels(
  username,
  writeStatisticFile,
  downloadMedia,
  limit
);
instagramDownloader.highlight.downloadAllUserHighlightStories(
  username,
  writeStatisticFile,
  downloadMedia
);
instagramDownloader.story.downloadAllUserStories(username);

Parameters:

  • username (string, required): The username of instagram user that you want to download their media
  • writeStatisticFile (boolean, optional): If true, it will output a CSV file containing information about the posts. Default value: true
  • downloadMedia (boolean, optional): If true, it will download videos, photos about the posts. Default value: true
  • limit (number, optional): The limit number of posts/reels you want to download in one execution and it MUST be a multiple of 12. Suitable when a user has too many posts/reels and you only want to download (example: 120 posts/reels) at a time per execution. Default value: Infinity

[!WARNING] Note that when you specify the value of limit parameter, after the batch download is complete, there will be a folder named cache_cursor/[username] and it contains files like posts.json, reels.json to save information for the next posts/reels download. Please DO NOT edit anything in these files. If you want to download posts or reels again from the beginning, delete the corresponding files.

Download post, reel, highlight by its ID/CODE

instagramDownloader.post.downloadPostByCode(postCode: string);
instagramDownloader.reel.downloadReelByCode(reelCode: string);
instagramDownloader.highlight.downloadHighlightStoryById(highlightId: string);

Get profile information

instagramDownloader.getProfileInfor(): Promise<IProfile>

Return value: return general information about a user. Include: id, username, full_name, avatar_url (HD), follower, following, is_private_account, total_posts

Delete all profile's posts

profileCleaner.clearAllPosts(limit);

Parameters:

  • limit (number, optional): The limit number of your first posts you want to delete. Default value: Infinity