Instagram Post Scraper + Comments & Metadata avatar

Instagram Post Scraper + Comments & Metadata

Pricing

from $1.50 / 1,000 results

Go to Apify Store
Instagram Post Scraper + Comments & Metadata

Instagram Post Scraper + Comments & Metadata

Scrape Instagram posts by username, profile URL, post/reel URL, or user ID. Returns captions, hashtags, mentions, likes, comments, media URLs, video views, location, and more — fast, reliable, no login required for public content.

Pricing

from $1.50 / 1,000 results

Rating

0.0

(0)

Developer

Cynix Dev

Cynix Dev

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

21 hours ago

Last modified

Share

Instagram Post Scraper

Extract Instagram posts, reels, and carousels at scale — by username, profile URL, post/reel URL, or user ID. No login required for public content. Fast, reliable, and priced to be the best value on Apify Store.

What it does

Give it any mix of Instagram usernames, profile links, or post/reel links and it returns clean, structured data for every post: caption, hashtags, mentions, likes, comments, video views, media URLs, location, owner details, and more.

Features

  • Four input modes — usernames/handles, profile URLs, post/reel/TV URLs, or numeric user IDs. Mix and match freely.
  • No login needed for public posts — anonymous extraction via Apify Residential proxy.
  • Optional authenticated mode — paste your session cookies to unlock higher volume and age-restricted/limited profiles.
  • Full pagination — scrape from 1 to thousands of posts per profile.
  • Media type filter — return only images, only videos/reels, only carousels, or all.
  • Rich output — ~30 fields per post including carousel children, tagged users, coauthors, reel audio, and paid-partnership flags.
  • Cost guardrails — sensible resultsLimit default so you never over-scrape by accident.
  • Comment scraping (optional) — fetch top-level comments per post, plus nested replies, with author, text, likes, and timestamps. See below.

Comment scraping (requires login)

Instagram gates comments behind a logged-in session, so anonymous requests are blocked. To scrape comments you must supply your Instagram session cookies (sessionid + ds_user_id). The post itself is still scraped without them — only the comments need the login.

Step 1 — log in to Instagram in your browser

Open a desktop browser (Chrome, Edge, Firefox, Brave) and go to https://www.instagram.com, then log in to the account you want to scrape with. Use a secondary/spare account — automated access can trigger rate limits or a login challenge on the account whose cookie you use.

Option A — browser DevTools (no extension needed):

  1. With the Instagram tab open and you still logged in, press F12 (or Cmd+Option+I / Ctrl+Shift+I) to open DevTools.
  2. Go to the Application tab → Cookieshttps://www.instagram.com. (In Firefox it's StorageCookies.)
  3. Find the row named sessionid and copy its Value.
  4. Find the row named ds_user_id and copy its Value.

Option B — "Get cookies.txt" extension:

  1. Install a cookie-export extension such as "Get cookies.txt LOCALLY" from your browser's add-on store.
  2. On the Instagram tab, click the extension and export as JSON (or .txt).
  3. From the export, locate the sessionid and ds_user_id values and copy them.

The sessionid is a long opaque string (e.g. starts with a digit + dot). ds_user_id is your numeric account ID. Both must come from the same logged-in session or comments won't load.

Step 3 — paste them into the Actor input

The easiest way: in the Actor's input, fill in the two dedicated text boxes — no JSON needed:

  • Instagram sessionid → paste the sessionid value.
  • Instagram ds_user_id → paste the ds_user_id value.
  • (Optional) Instagram csrftoken → paste if you ever see auth errors.

That's enough for comment scraping and higher-volume access.

Step 4 — enable comment scraping

  • Turn Scrape comments ON.
  • Set Max comments per post (default 20).
  • Optionally turn on Include comment replies for nested replies.

That's it. Each scraped post will then include a commentsScraped array with author, text, likes, timestamps, and nested replies.

"commentsScraped": [
{ "id": "...", "text": "...", "username": "fan_one", "likes": 42,
"timestamp": "2026-06-16T...", "ownerUsername": "natgeo",
"childComments": [ { "text": "reply here", "username": "fan_two", ... } ] }
],
"commentsScrapedCount": 10

If Scrape comments is enabled but Session cookies is empty, the Actor skips comments and logs a clear warning instead of failing — your posts are still scraped.

Input example

Basic (posts only):

{
"usernames": ["natgeo", "nasa"],
"directUrls": ["https://www.instagram.com/p/DZpQwxqimz2/"],
"resultsLimit": 30,
"mediaTypeFilter": "all",
"includePinned": true,
"proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}

With comments enabled (requires session cookies — see above):

{
"usernames": ["natgeo"],
"resultsLimit": 10,
"scrapeComments": true,
"maxComments": 25,
"scrapeCommentReplies": true,
"sessionCookies": [
{ "name": "sessionid", "value": "PASTE_YOUR_sessionid_VALUE_HERE" },
{ "name": "ds_user_id", "value": "PASTE_YOUR_ds_user_id_VALUE_HERE" }
],
"proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}

Output example (one post)

{
"id": "3920738671208852726",
"type": "Video",
"shortCode": "DZpQwxqimz2",
"url": "https://www.instagram.com/p/DZpQwxqimz2/",
"caption": "There's more to the story of Pompeii...",
"hashtags": ["PompeiiOutOfTime"],
"mentions": ["twhiddleston", "NatGeoTV"],
"timestamp": "2026-06-16T16:00:07+00:00",
"likesCount": 139079,
"commentsCount": 1222,
"isVideo": true,
"mediaType": "video",
"ownerUsername": "natgeo",
"ownerFollowersCount": 280000000,
"displayUrl": "https://scontent.cdninstagram.com/....jpg"
}

How to use

  1. Enter one or more usernames or paste Instagram URLs.
  2. Set Max posts per profile (default 30).
  3. Optionally choose a Media type filter and toggle Include pinned posts.
  4. Click Start. Results appear in the dataset — export to JSON, CSV, Excel, or via API.

Proxies

Instagram aggressively rate-limits datacenter IPs. This Actor defaults to Apify Residential proxy, which is required for stable results. You can set a specific exit country with Proxy country.

For heavy usage or limited profiles, export your Instagram cookies (e.g. with a "Get cookies.txt" browser extension) and paste the sessionid and ds_user_id entries into Session cookies. The Actor will attach them to every request.

Use a secondary account for scraping. Automated access can trigger Instagram rate limits or blocks on the account whose cookies you provide.

Pricing

This Actor uses pay-per-result: you are charged per post returned, plus your Apify platform usage (compute + residential proxy traffic). See the Actor's pricing tab for the current per-result rate.

Data you can extract

Post ID, type, shortcode, URL, caption, hashtags, mentions, timestamp, likes, comments, video views, video duration, media type, display URL, all image URLs, video URL, carousel children, tagged users, coauthors, reel audio, location, owner username/ID/full name/verified/followers, product type, and paid-partnership flag.

Scrape only publicly available data and use it in compliance with Instagram's Terms of Service, the GDPR/CCPA, and applicable laws. You are responsible for how you use the data. This Actor does not collect private or non-public information.

Support

Found a bug or need a field added? Open an issue on the Actor's Issues tab.