Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ig-headless-driver

andrew_b23ISC1.0.12

Scrape instagram posts by username, shortcode, or hashtag

instagram-scraper, instagram scraper, instagram-scrape, instagram scrape, post scraper, post-scraper, post scrape, post-scrape, user-scraper, user scraper, user-scrape, user scrape, tag-scraper, tag scraper, tag-scrape, tag scrape, user search, post search, tag search, instagram, scraper, scraping, scrape, insta, ig

readme

ig-headless-driver

This is a package that will go scrape instagram posts by username or hashtag.

It's response does NOT depend on loaded HTML, and is less suceptible to page changes.

It taps into public endpoints in Instagram's API, which they frequently make breaking changes to.

Something something read instagrams terms of service

Usage

import driver from 'ig-headless-driver'
// or use
const driver = require('ig-headless-driver')

// username string should NOT include @
let username = 'officialrickastley'

// shortcode string should NOT include slashes or leading /p/ 
// https://www.instagram.com/p/B2CZwZpAnzl/ 
let shortcode = 'B2CZwZpAnzl'

// tag should NOT include #
let tag = 'THEBESTOFME'

const userData = await driver.getUser(username)
const postData = await driver.getPost(shortcode)
const tagData  = await driver.getTag(tag)

console.log(userData) // {JSON object containing user data and timeline post data}

Available Methods

Currently there are three exposed methods to gather data:

driver.getUser(username)

driver.getPost(shortcode)

driver.getTag(tag)

Each method returns a JSON object, already parsed.

Each method is asyncronous

Each method is probably against Instagram's ToS for business use. I don't know, nobody reads those things.