From bungkust-skills
Scrapes Instagram posts from public/private accounts using browser cookies and insta-fetcher Android API. Extracts images/carousels, captions, likes/comments; supports OCR and local saves.
npx claudepluginhub bungkust/bungkust-skillsThis skill uses the workspace's default tool permissions.
> General-purpose Instagram scraper for any account. Uses browser cookie + Android API — no camoufox needed, works reliably.
CLI for Instagram: view feeds/posts/profiles/comments/likes, search users/hashtags/places, engage (like/comment/follow/save) via cookie auth from browser.
Scrapes daily Heartopia game updates from Instagram @myheartopia.id, extracts weather, events, resource locations via OCR on carousel images, parses data, and appends structured entries to Obsidian vault Markdown file.
Interacts with Instagram DMs via CLI: send/read messages, list conversations, manage accounts using browser cookie extraction or username/password auth with 2FA.
Share bugs, ideas, or general feedback.
General-purpose Instagram scraper for any account. Uses browser cookie + Android API — no camoufox needed, works reliably.
# Required: Instagram session cookie from your browser
# Instagram → DevTools (F12) → Application → Cookies → Copy sessionid value
# Install deps (if not already)
cd /tmp/heartopia-scrape
npm install insta-fetcher 2>/dev/null
# Run scraper
node /root/.hermes/skills/social-media/instagram-scraper/scripts/ig_scrape.mjs \
--user myheartopia.id \
--cookie "sessionid=YOUR_SESSIONID..." \
--amount 5
Full cookie string from browser (not just sessionid):
csrftoken=xxx; sessionid=xxx%3Axxx%3Axxx; mid=xxx; ig_did=xxx; datr=xxx; ds_user_id=xxx; ps_l=1; ps_n=1;
Get it from: Instagram web → DevTools → Application → Cookies → Select instagram.com → Copy all visible cookie name/value pairs.
# Basic — fetch latest 5 posts
node ig_scrape.mjs --user USERNAME --cookie "COOKIE_STRING"
# With amount
node ig_scrape.mjs --user USERNAME --cookie "..." --amount 10
# Save images locally
node ig_scrape.mjs --user USERNAME --cookie "..." --save-images
# OCR on images
node ig_scrape.mjs --user USERNAME --cookie "..." --ocr
# Combined
node ig_scrape.mjs --user USERNAME --cookie "..." --amount 3 --save-images --ocr
{
"username": "myheartopia.id",
"fetched_at": "2026-05-02T...",
"posts": [
{
"shortcode": "ABC123xyz",
"taken_at": "2026-05-02T14:30:00.000Z",
"caption": "Update Harian...",
"likes": 1234,
"comments": 56,
"images": ["url1", "url2"],
"is_carousel": true,
"ocr_text": "optional extracted text from images"
}
]
}
posts[].node.code → shortcode
posts[].node.taken_at → Unix timestamp (Android API uses taken_at, NOT taken_at_timestamp)
posts[].node.caption.text → caption text
posts[].node.likes_count → likes
posts[].node.comments_count → comments
posts[].node.carousel_media → array (if carousel)
[].image_versions2.candidates[0].url → image URL
posts[].node.image_versions2.candidates[0].url → single image URL
# Install tesseract if needed
apt-get install -y tesseract-ocr
# OCR command
ffmpeg -i img.jpg -q:v 3 img.png -y
tesseract img.png stdout 2>/dev/null
If you get "Page Not Found" or auth errors:
| Error | Cause | Fix |
|---|---|---|
| "useragent mismatch" | sessionid tied to different UA | Use Android UA: Instagram 270.0.0.0.0 Android (24/7.0; ...) |
| "Access denied" | Server IP blocked | Can't scrape from server — use browser cookie only |
| "No posts found" | Private account / wrong username | Check username is correct |
| Empty carousel | Post is single image | Single images under image_versions2.candidates |
| OCR empty | Text too small/color matching bg | Preprocess: convert to PNG, increase contrast |
i.instagram.com/api/v1/ endpointscarousel_media array existsImages saved to /tmp/ig_scrape/{username}/{shortcode}/