# Instagram Media Engagement Scraper — Info, Comments & Likes (`toolzerhub/instagram-media-engagement-scraper`) Actor

Fetch full media details for Instagram posts and reels by code, optionally attaching a page of comments and the full liker list to each result.

- **URL**: https://apify.com/toolzerhub/instagram-media-engagement-scraper.md
- **Developed by:** [ToolzerHub](https://apify.com/toolzerhub) (community)
- **Categories:** Social media, Marketing, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.85 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Instagram Media Engagement Scraper — Info, Comments & Likes

Get the full record for any public Instagram post or reel, and optionally the people who commented and liked it. No login, no cookie, no session.

Counts tell you a post did well. The comment and liker lists tell you who it reached.

### Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `codes` | array | — | **Required.** Shortcodes, numeric media IDs, or full post/reel URLs. |
| `scraperType` | enum | `mediaInfo` | **Required.** `mediaInfo` or `mediaInfoWeb`. |
| `addonComments` | boolean | `false` | Attaches a page of comments to each result. |
| `addonLikes` | boolean | `false` | Attaches the liker list to each result. |
| `commentsSortType` | enum | `popular` | `popular`, `recent`, `verified`. Only with comments on. |

```json
{
  "codes": ["DDPp2UWzWEm", "https://www.instagram.com/p/DDPp2UWzWEm/"],
  "scraperType": "mediaInfo",
  "addonComments": true,
  "commentsSortType": "recent"
}
```

Shortcodes, media IDs, and full URLs all work in the same field. The shortcode is the segment after `/p/` or `/reel/`, and it's the `code` field on every row from [Instagram Profile Content](https://apify.com/toolzerhub/instagram-profile-content-scraper) and [Instagram Hashtag & Keyword Search](https://apify.com/toolzerhub/instagram-hashtag-keyword-scraper).

### Output

| Field | What it holds |
|---|---|
| `pk` | Instagram media ID |
| `code` | Shortcode |
| `like_count` | Likes |
| `comment_count` | Comments |
| `taken_at` | When it was posted |
| `media_type` | Image, video, or carousel |
| `comments` | Comment records, with `addonComments` |
| `likes` | Liker records, with `addonLikes` |

```json
{
  "pk": "3412987456123456789",
  "code": "DDPp2UWzWEm",
  "like_count": 1842203,
  "comment_count": 12043,
  "taken_at": 1785312000
}
```

### Two modes, two sources

`mediaInfo` and `mediaInfoWeb` fetch the same post through different Instagram endpoints — the app API and the web GraphQL layer. They usually agree.

Use `mediaInfoWeb` as a fallback: when a post returns nothing on `mediaInfo`, the web variant sometimes resolves it, and the reverse also happens. If a code you're sure about comes back empty, try the other mode before assuming the post is gone. `mediaInfoWeb` returns a slightly narrower record — no `taken_at` or `media_type` — so prefer `mediaInfo` when both work.

### Questions

**`popular`, `recent`, or `verified` — which sort?**
`recent` for a complete sweep, since the order is stable and predictable. `popular` is Instagram's ranking, which surfaces the substantial comments first but reshuffles between runs, making it poor for diffing. `verified` narrows to verified accounts, which on a large post is the fastest way to find notable engagement in a flood of replies.

**Do I get every comment?**
No. `addonComments` attaches a page, and Instagram paginates. `comment_count` reports the real total, so on a heavily commented post the count and the attached array will disagree — the count is authoritative, the array is a sample.

**Do I get everyone who liked it?**
The liker list as Instagram serves it, which on very large posts is a bounded subset rather than the full set. `like_count` remains the true total.

**Why did a code return nothing?**
The post was deleted, made private, or the account went private. Failing that, try the other `scraperType` — the two endpoints don't always agree on what they can resolve. A code that fails on both is genuinely unavailable.

**What do the addons cost?**
`addonComments` and `addonLikes` are billed per media item each. Enabling both on 100 posts is 200 extra events on top of the 100 results. They're independent, so you can take comments without likers.

**Where do I get codes in bulk?**
The `code` field on rows from [Instagram Profile Content](https://apify.com/toolzerhub/instagram-profile-content-scraper) or [Instagram Hashtag & Keyword Search](https://apify.com/toolzerhub/instagram-hashtag-keyword-scraper). Typing them by hand doesn't scale past a handful.

**Can I read a private account's post?**
No. Public media only, and no session is used.

### Other Instagram Actors

| Actor | Use when |
|---|---|
| [Instagram Profile Content](https://apify.com/toolzerhub/instagram-profile-content-scraper) | You need codes — an account's posts and reels |
| [Instagram Hashtag & Keyword Search](https://apify.com/toolzerhub/instagram-hashtag-keyword-scraper) | You need codes by subject |
| [Instagram Followers & Following](https://apify.com/toolzerhub/instagram-profile-follower-followee-scraper) | You want an account's audience |
| [Instagram User Search](https://apify.com/toolzerhub/instagram-user-search-scraper) | You're looking for accounts by keyword |

### Support

Questions, bugs, or feature requests: **contact@toolzerhub.com**

Browse the rest: [apify.com/toolzerhub](https://apify.com/toolzerhub)

# Actor input Schema

## `codes` (type: `array`):

Instagram media shortcodes, numeric media IDs, or full post/reel URLs.

## `scraperType` (type: `string`):

Standard media-info endpoint or the web GraphQL variant.

## `addonComments` (type: `boolean`):

Attach a page of comments to each media result.

## `addonLikes` (type: `boolean`):

Attach the liker list to each media result.

## `commentsSortType` (type: `string`):

Sort order for attached comments. Only used when Include Comments is on.

## Actor input object example

```json
{
  "codes": [
    "DDPp2UWzWEm"
  ],
  "scraperType": "mediaInfo",
  "addonComments": false,
  "addonLikes": false,
  "commentsSortType": "popular"
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all scraped data

# 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 = {
    "codes": [
        "DDPp2UWzWEm"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/instagram-media-engagement-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 = { "codes": ["DDPp2UWzWEm"] }

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

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

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

```

## CLI example

```bash
echo '{
  "codes": [
    "DDPp2UWzWEm"
  ]
}' |
apify call toolzerhub/instagram-media-engagement-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=toolzerhub/instagram-media-engagement-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/fYLvs3LOpqz0vnQgc/builds/L5lmQohIKkXz2rGo4/openapi.json
