# Instagram Post & Comments Scraper (`earlytern/instagram-post-comments-scraper`) Actor

Get details of public Instagram posts and Reels from their links: caption, hashtags, likes, comments count, date, media links, tagged accounts and the first comments. No login.

- **URL**: https://apify.com/earlytern/instagram-post-comments-scraper.md
- **Developed by:** [earlytern](https://apify.com/earlytern) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 posts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Instagram Post & Comments Scraper

Get the details of public Instagram posts and Reels from their links: caption, hashtags, mentions, like and comment
counts, publish date, photo and video links, tagged accounts, collaborators, Reel audio and the first comments under
each post. No login, no cookies, no browser. You pay per post and per comment saved.

### What does Instagram Post & Comments Scraper do?

Paste links to public Instagram posts or Reels (for example `https://www.instagram.com/p/DeuOR-CjKE9/` or
`https://www.instagram.com/reel/DXwiAJ4lMtM/`). For every link the Actor saves one row with:

- **Post details:** post number, type (photo, video or carousel), clean link, publish time, text, hashtags, mentions,
  whether the text was edited, alt text.
- **Engagement:** like count (when the owner does not hide it) and comment count.
- **Media:** best photo or cover link, video link, size in pixels, every photo and video of a carousel.
- **Account:** username, display name, number, verified badge, private flag.
- **People and places:** tagged accounts, collaborators, tagged place.
- **Reels:** audio title and artist, whether the video has sound.
- **First comments:** up to about a dozen comments Instagram shows on the post, each with author, text, time, likes
  and reply count.

Typical uses: measuring paid influencer posts, tracking campaign posts for a brand, checking giveaway entries,
collecting post data for research or for an AI agent.

### Quick start

1. Add one or more post or Reel links in **Post or Reel links** (post codes alone work too).
2. Choose **Comments per post** (0 for post details only).
3. Keep the residential proxy that is set by default.
4. Run the Actor and download the results as JSON, CSV or Excel, or read them through the Apify API.

### Input

| Field | What it is |
|---|---|
| `postUrls` | Links to public posts or Reels (`/p/`, `/reel/`, `/reels/`, `/tv/`), or post codes. Duplicates are skipped. |
| `maxComments` | First comments to add per post, 0-15 (default 10). Instagram shows logged-out visitors about 10-12. |
| `proxyConfiguration` | Connection used to open Instagram. Residential proxies by default. |

```json
{
  "postUrls": ["https://www.instagram.com/p/DeuOR-CjKE9/", "https://www.instagram.com/reel/DXwiAJ4lMtM/"],
  "maxComments": 10
}
```

### Output

One row per link. Shortened example:

```json
{
  "url": "https://www.instagram.com/reel/DXwiAJ4lMtM/",
  "shortcode": "DXwiAJ4lMtM",
  "status": "ok",
  "postUrl": "https://www.instagram.com/reel/DXwiAJ4lMtM/",
  "id": "3886756022615067468",
  "type": "video",
  "productType": "clips",
  "ownerUsername": "natgeo",
  "ownerIsVerified": true,
  "caption": "National Geographic Explorer and Photo Ark founder @joelsartore has photographed thousands of species...",
  "hashtags": [],
  "mentions": ["joelsartore"],
  "takenAt": "2026-04-30T16:00:03.000Z",
  "likeCount": 8321,
  "commentCount": 71,
  "videoUrl": "https://...mp4",
  "audioTitle": "Original audio",
  "audioArtist": "natgeo",
  "taggedUsers": [{ "username": "joelsartore", "fullName": "Joel Sartore- Photo Ark", "id": "225429667", "isVerified": true }],
  "comments": [
    { "id": "18101101847015644", "text": "🙌🙌🙌🙌", "createdAt": "2026-05-22T04:19:44.000Z", "likeCount": 0, "replyCount": 0, "ownerUsername": "example_user", "ownerId": "1000000001", "ownerIsVerified": false }
  ],
  "scrapedAt": "2026-11-22T01:00:00.000Z"
}
```

`status` tells you what happened to each link:

- `ok`: the post was read.
- `not_found`: the post was removed, or only logged-in users can see it (private account, age limit). Free.
- `blocked` or `error`: Instagram did not answer with the post after several tries on new IP addresses. Free; run
  those links again later.

Photo and video links from Instagram expire after a few days. Download the files you need soon after the run.

### How much does it cost to scrape Instagram posts and comments?

Pay per event, no monthly fee:

- **$1.50 per 1,000 posts** saved with their details (less on higher Apify plans).
- **$0.50 per 1,000 comments** saved with a post.
- Rows for removed, private or unreadable posts are free.

Examples: 1,000 posts without comments cost $1.50. 1,000 posts with 10 comments each cost $1.50 + $5.00 = $6.50.
The run stops when it reaches the maximum cost per run you set; comments that do not fit are left out first.

### Limits and reliability

- Only the first comments Instagram shows to logged-out visitors are available (about 10-12 per post). The comment
  count on the post includes comments the Actor cannot see. Replies are counted (`replyCount`), not listed.
- View counts of Reels are not part of the post data Instagram shows logged-out visitors, so they are not returned.
- Posts from private accounts and age-limited posts are not available without login and come back as `not_found`.
- Each post takes one light request (no browser). Blocked tries are repeated on a new IP address, up to four times.

### Responsible use

Posts, comments and usernames are personal data. You are responsible for having a lawful basis to collect and process
them (for example under the GDPR or other applicable privacy laws), respecting Instagram's terms, limiting retention,
and honoring rights requests such as deletion. Public availability does not itself establish a lawful basis. This
Actor only reads posts anyone can see without login; it does not collect private accounts, messages or anything
behind a login. It is not affiliated with or endorsed by Meta or Instagram.

### Related Actors

[Facebook Comments Scraper](https://apify.com/earlytern/facebook-comments-scraper) collects comments of public
Facebook posts. [Threads Search Scraper](https://apify.com/earlytern/threads-search-scraper) finds public Threads posts
by keyword or profile.

### FAQ

**Do I need an Instagram account or cookies?** No. The Actor reads public posts as a logged-out visitor.

**Can I get all comments of a post?** No. Instagram shows only the first comments to logged-out visitors. Use this
Actor for post details and a sample of comments.

**Which links work?** Post, Reel and IGTV links, with or without a username in the path, and bare post codes.
Profile links do not work; open the profile and copy the post links.

**Why did a post come back as `blocked`?** Instagram sometimes refuses an IP address. The Actor retries on new
addresses; if all tries fail the row is free and you can run that link again later.

**Can I use it through the API or with AI agents?** Yes. Start runs and read results through the Apify API, the
official clients, or any tool that can call Apify Actors.

# Changelog

This Actor's version history is a separate document: https://apify.com/earlytern/instagram-post-comments-scraper/changelog.md

# Actor input Schema

## `postUrls` (type: `array`):

Links to public Instagram posts or Reels (instagram.com/p/… or instagram.com/reel/…), one per line. Post codes alone also work.

## `maxComments` (type: `integer`):

How many of the first comments shown on each post to add (Instagram shows logged-out visitors about 10-12). 0 = post details only.

## `proxyConfiguration` (type: `object`):

Connection used to open Instagram. Residential proxies work best; each try uses a new IP address.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.instagram.com/p/DeuOR-CjKE9/"
  ],
  "maxComments": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "postUrls": [
        "https://www.instagram.com/p/DeuOR-CjKE9/"
    ],
    "maxComments": 10,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("earlytern/instagram-post-comments-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "postUrls": ["https://www.instagram.com/p/DeuOR-CjKE9/"],
    "maxComments": 10,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("earlytern/instagram-post-comments-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "postUrls": [
    "https://www.instagram.com/p/DeuOR-CjKE9/"
  ],
  "maxComments": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call earlytern/instagram-post-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,earlytern/instagram-post-comments-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/EltMnJ7ya4pQsdx1j/builds/eZYbPlHyJz7VVedR8/openapi.json
