Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including instatouch with all npm packages installed. Try it out:

var instatouch = require("instatouch")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

instatouch v2.3.0

Scrape instagram posts from Username, Hashtag or Location pages. Download media and save them to a ZIP archive. Create JSON/CSV files with a post information. No login required


NPM npm Codacy grade

Scrape useful information from instagram.

No login or password are required.

This is not an official API support and etc. This is just a scraper that is using instagram graph api to scrape media.

Buy Me A Coffee





  • Scrape media posts from username, hashtag or location
  • Scrape comments from a specific instagram post
  • Scrape users who liked specific post
  • Download and save media to a ZIP archive
  • Create JSON/CSV files with a post information

To Do

  • [ ] Improve documentation
  • [ ] More examples
  • [ ] Web interface

Possible errors from instagram API

  • Rate Limit - Instagram API temporarily blocked your IP, you can wait a little, try to use a proxy or set the higher {timeout}


instatouch requires Node.js v8.6.0+ to run.

Install from NPM

$ npm i -g instatouch

Install from YARN

$ yarn global add instatouch


In Terminal

$ instatouch --help

Usage: cli <command> [options]

  instatouch user [id]                 Scrape posts from username. Enter only username
  instatouch hashtag [id]              Scrape posts from hashtag. Enter hashtag without
  instatouch location [id]             Scrape posts from a specific location. Enter
                                location ID
  instatouch comments [id]             Scrape comments from a post. Enter post url or
                                post id
  instatouch likers [id]               Scrape users who liked a post. Enter post url or
                                post id
  instatouch history                   View previous download history
  instatouch from-file [file] [async]  Scrape users, hashtags, music, videos mentioned
                                in a file. 1 value per 1 line

  --version            Show version number                             [boolean]
  --count, -c          Number of post to scrape                     [default: 0]
  --mediaType, -m      Media type to scrape
                             [choices: "image", "video", "all"] [default: "all"]
  --proxy, -p          Set single proxy                            [default: ""]
  --proxy-file         Use proxies from a file. Scraper will use random proxies
                       from the file per each request. 1 line 1 proxy.
                                                                   [default: ""]
  --timeout            If you will receive error saying 'rate limit', you can
                       try to set timeout. Timeout is in mls: 1000 mls = 1
                       second                                       [default: 0]
  --download, -d       Download all scraped posts     [boolean] [default: false]
  --zip, -z            ZIP all downloaded posts       [boolean] [default: false]
  --asyncDownload, -a  How many posts should be downloaded at the same time.
                       Try not to set more then 5                   [default: 5]
  --filename, -f       Set custom filename for the output files    [default: ""]
  --filepath           Directory to save all output files.
   [default: "/Users/blah/blah"]
  --filetype, -t       Type of output file where post information will be
                       saved. 'all' - save information about all posts to a
                       'json' and 'csv'
                                [choices: "csv", "json", "all"] [default: "csv"]
  --store, -s          Scraper will save the progress in the OS TMP or Custom
                       folder and in the future usage will only download new
                       posts avoiding duplicates     [boolean] [default: false]
  --historypath        Set custom path where history file/files will be stored
                   [default: "/var/folders/d5/fyh1_f2926q7c65g7skc0qh80000gn/T"]
  --remove, -r         Delete the history record by entering "TYPE:INPUT" or
                       "all" to clean all the history. For example: user:bob
                                                                   [default: ""]
  --help               Show help                                       [boolean]

Output File Example




.user('tiktok', options) // User feed
.hashtag('summer', options) // Hashtag feed
.location('', options) // Location feed
.comments('', options) // Post comments
.likers('', options) // People who liked post

.getUserMeta('USERNAME', options) // Get user metadata
.getPostMeta('', options) // Get post metadata


const options = {
    // Number of posts to scrape: {int default: 0}
    count: 0,

    // Download posts or not. {boolean default: false}
    download: false,
    // Archive downloaded posts. {boolean default: false}
    // If set to {false} then posts will be saved in the newly created folder
    zip: false

    // How many post should be downloaded asynchronously. Only if {download:true}: {int default: 5}
    asyncDownload: 5,

    // Media type to scrape: ["image", "video", "all"]: {string default: 'all'}
    mediaType: 'all',

    // Set proxy {string[] | string default: ''}
    // http proxy:
    // socks proxy: socks5://
    // You can pass proxies as an array and scraper will randomly select a proxy from the array to execute the requests
    proxy: '',

    // File name that will be used to save data to: {string default: '[id]'}
    filename: '[id]',

    // File path where all files will be saved: {string default: 'USER_HOME_DIR'}
    filepath: `USER_HOME_DIR`,

    // Output with information can be saved to a CSV or JSON files: {string default: 'na'}
    // 'csv' to save in csv
    // 'json' to save in json
    // 'all' to save in json and csv
    // 'na' to skip this step
    filetype: `na`,
    // Set initial cursor value to start pagination over the feed from the specific point: {string default: ''}
    endCursor: ''

    // Timeout between requests. If error 'rate limit' received then this option can be useful: {int default: 0}
    timeout: 0,

Result will contain a bunch of data

instaTouch {
    //Files are below
    zip: '/{CURRENT_PATH}/',
    json: '/{CURRENT_PATH}/natgeo_1552963581094.json',
    csv: '/{CURRENT_PATH}/natgeo_1552963581094.csv'

Json Output Example


Example output for the methods: user, hashtag, location

    id: '2311886241697642614',
    shortcode: 'CAVeEm1gDh2',
    type: 'GraphSidecar',
    is_video: false,
    dimension: { height: 1080, width: 1080 },
    owner: { id: '25025320', username: 'instagram' },
    comments: 5050,
    likes: 412657,
    comments_disabled: false,
    taken_at_timestamp: 1589818338,
    location: { id: '213385402', has_public_page: true, name: 'London,UnitedKingdom', slug: 'london-united-kingdom' },
    hashtags: ['#ThisWeekOnInstagram'],
    mentions: ['@mglhs_com', '@mglhs_com'],

Example output for the methods: comments

    id: '17854856327003928',
    text: 'Böyle şeytani figürleri yayınlamak mi zorundasınız. Euzu billahi mineşşeytanirracim Bismillahirrahmanirrahim.',
    created_at: 1589837238,
    did_report_as_spam: false,
    owner: {
        id: '13492154487',
        is_verified: false,
        username: 'hasan_dede4809',
    likes: 0,
    comments: 0,

Example output for the methods: likers

    id: '27165506664',
    username: 'josedhl_priv',
    full_name: 'José David',
    is_private: true,
    is_verified: false,



Free Software

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free