instagram-scraper-cli
v0.1.0
Published
Instagram scraper CLI and Node client: public profiles, posts and Reels as JSON or CSV, no login. A thin client of the ShortsIntel API.
Maintainers
Readme
Instagram Scraper
Scrape public Instagram profiles, posts and Reels from your terminal or your code. No Instagram login, output as JSON or CSV.
pip install instagram-scraper && instagram-scraper natgeo --csv > natgeo.csvor with Node:
npx instagram-scraper-cli natgeo --csv > natgeo.csvNo code? Use the free web tool: Instagram Scraper on ShortsIntel.
This repo is a thin client of the ShortsIntel API. It contains no scraping code: ShortsIntel reads public Instagram pages and this client calls its /v1 API with your key. New accounts get 1,000 credits free, valid for 90 days.
Setup
- Get an API key at shortsintel.com/console/keys.
- Export it:
export SHORTSINTEL_API_KEY=sk_live_...Usage
instagram-scraper <username|profile URL|post URL> [--posts N] [--csv|--json]| Input | What you get |
|---|---|
| natgeo, @natgeo or https://www.instagram.com/natgeo/ | The profile and its latest Reels (12 by default, --posts N for more) |
| https://www.instagram.com/reel/<code>/ or /p/<code>/ | That one post or Reel |
--json (the default) prints { "profile": {...}, "posts": [...] }. The objects use the same field names as the API: stats, engagement, hashtags, posted_at, url.
--csv prints one row per post, with the profile columns repeated on each row.
Example output
instagram-scraper plunge --csv --posts 2handle,name,followers,following,post_url,posted_at,caption,views,likes,comments,hashtags,mentions,duration_seconds
plunge,Plunge,512300,180,https://www.instagram.com/reel/DAbCdEfGhIA/,2026-09-05T06:32:11.000Z,"Cold plunge, day 30: ""worth it""
Full routine in bio #coldplunge",1284000,143200,2810,coldplunge,coldplungeco,31
plunge,Plunge,512300,180,https://www.instagram.com/reel/DAbCdEfGhIB/,2026-09-02T17:10:00.000Z,Ice bath vs cold shower #recovery,96200,8140,212,recovery,,31instagram-scraper plunge --posts 1{
"profile": {
"platform": "instagram",
"handle": "plunge",
"name": "Plunge",
"url": "https://www.instagram.com/plunge/",
"bio": "Cold water every morning.",
"stats": { "followers": 512300, "following": 180, "videos": null, "likes": null, "views": null }
},
"posts": [
{
"platform": "instagram",
"id": "DAbCdEfGhIA",
"url": "https://www.instagram.com/reel/DAbCdEfGhIA/",
"description": "Cold plunge, day 30: \"worth it\"\nFull routine in bio #coldplunge",
"posted_at": "2026-09-05T06:32:11.000Z",
"hashtags": ["coldplunge"],
"engagement": { "views": 1284000, "likes": 143200, "comments": 2810 }
}
]
}(Trimmed. The real output has every field the API returns.)
Python
from instagram_scraper import Client, scrape, to_csv
client = Client("sk_live_...")
data = scrape(client, "natgeo", posts=24)
print(data["profile"]["stats"]["followers"])
open("natgeo.csv", "w").write(to_csv(data))
reel = client.post("https://www.instagram.com/reel/<code>/")Python 3.9+, no dependencies.
Node
npm install instagram-scraper-cliimport { Client, scrape, toCsv } from "instagram-scraper-cli";
const client = new Client(process.env.SHORTSINTEL_API_KEY);
const data = await scrape(client, "natgeo", 24);
console.log(data.profile.stats.followers);
const reel = await client.post("https://www.instagram.com/reel/<code>/");Node 18.3+, no dependencies.
API calls it makes
| Call | When |
|---|---|
| GET /v1/creators/instagram/{handle}?include=videos | Profile input. Pages on with cursor when --posts is larger than one page |
| POST /v1/videos/lookup | Post or Reel URL input |
| GET /v1/runs/{id} | Only when a lookup takes longer than 60 seconds |
Base URL: https://www.shortsintel.com/v1, auth Authorization: Bearer $SHORTSINTEL_API_KEY. Prices per call are on the pricing page and in the API reference.
Scope
Public data only: no private accounts, follower lists, Stories or DMs. Profile input returns Reels.
Development
cd python && python -m venv .venv && .venv/bin/pip install -e . pytest && .venv/bin/pytest
cd node && npm testTests run against fixture responses in fixtures/. They make no network calls.
License
MIT
