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

instagram-public-crawler

v1.0.5

Published

Get media feed of an Instagram public account

Downloads

6

Readme

instagram-public-crawler

Get media feed of an Instagram public account

Install

From npm: npm install --save instagram-public-crawler

Usage

Minimal

Using .lite() to get media feed (only 25 media)

  • Example
const crawler = require('instagram-public-crawler');
await crawler.lite("permanahendra", { raw: false }); // using async await

crawler.lite("permanahendra", { raw: false }).then(result => {
            
}); // using promise
  • Usage

    .lite(<instagram_user_name>, options)

  • Options

    raw : boolean return raw result if true else only media

Advanced

Using .start() to get media feed (possible to get all media)

  • Example
let options = {
           raw: false,
           username: 'permanahendra',
           query_hash: 'f2405b236d85f8296cf30347g9f08c2a',
           media_count: 101,
           cookie: 'mid=W1X1XQALAAHJWRjBTgzM3UFeWkmt; mcd=3; datr=NQKFWxY73YsDC81ikryvMSy0; csrftoken=n8Kuf8UEN4jFyVUIysZ7ObSwZ6U1YX2x; fbm_124024574287414=base_domain=.instagram.com; csrftoken=7b8rpEE0Gl85fcKBalgGvRF5diWsjrmH; ds_user_id=1SD641929; sessionid=175641929%3AEPkOIsRX0S3oMf%3A15; shbid=5747; rur=ATN; shbts=1558734869.7421114; urlgen="{\"24.124.172.232\": 23693}:1hUIAS:6Q5ch4JClsyPEyL8yfeHqqDnxp1"'
       }
let media = await crawler.start(options); // using async await

crawler.start(options).then(result => {
           
}); // using promise
  • Usage

    .start(options)

  • Options

    raw : boolean return raw result if true else only media feed

    username : Username of public instagram account

    query_hash : hash of instagram GraphQL query. See below for instructions.

    media_count : The amount of media you want to get. Use -1 to get all media feed.

    cookie: See below for instructions.

Get query_hash

Open an public instagram account via Browser > inspect element > Network > copy query hash's value like image below

Get cookie

Open instagram web Browser > inspect element > Network > copy cookie from request header like image below

Note

Both cookie and query_hash are valid for almost one year. So it's safe for long running job.

Author

Developed by @hynra || Website