# Instagram Comments Scraper - Reels, Photos & Posts (`lofomachines/instagram-comments-replies-scraper`) Actor

Scrape public Instagram comments from reels, photos, videos and carousels. Bulk URLs, newest-first results, date filter and CSV, Excel or JSON exports. No login. Reply coverage is reported.

- **URL**: https://apify.com/lofomachines/instagram-comments-replies-scraper.md
- **Developed by:** [Lofomachines](https://apify.com/lofomachines) (community)
- **Categories:** Social media, Automation
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 4 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.16 / 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/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 Comments Scraper - Reels, Photos & Posts

**Read in:** [English](#english) · [简体中文](#chinese-simplified) · [繁體中文](#chinese-traditional) · [Italiano](#italiano)

### English

Turn public Instagram conversations into a spreadsheet you can use. **Instagram Comments Scraper** exports available comments from **Reels, photos, videos and carousel posts** with the original text, author, publication time, likes and direct comment link. Paste several links, choose a limit or date, and download **Excel, CSV or JSON**.

**No Instagram login. Bulk links. Newest comments first within each post.**

**Reply coverage:** Instagram's anonymous comment list currently omits reply threads and usually returns no reply count. This Actor collects the main comments that are exposed publicly. It preserves replies only if Instagram includes them in a response; **it does not promise complete reply extraction**. The coverage report makes this visible, and unknown reply counts stay `null` instead of being reported as zero.

#### Why use this Instagram comments scraper?

- **Analyze Reels and photo posts together.** Standard links and links containing the creator's username are recognized automatically.
- **Spend less time preparing data.** One comment per row, clean columns and ready-to-download spreadsheets.
- **Collect a batch in one run.** Paste up to 1,000 links; equivalent links are deduplicated and posts run in parallel.
- **Focus on recent conversations.** Choose an optional start date from the calendar and a maximum number of main comments per post.
- **Know what was collected.** Every post receives a coverage report with its result count, Instagram's counter and collection notes.
- **Keep costs controlled.** Lightweight HTTP requests, bounded retries, automatic time and result limits, and no paid third-party scraping API or browser required.

#### Start in three steps

1. Add your links under **Instagram links**. For a list, choose **Bulk edit** and paste one URL per line.
2. Set **Maximum comments per post** or leave `0` for all available comments within the automatic limits. Optionally choose **Comments since**.
3. Click **Start**. Open the results and download Excel, CSV or JSON.

This Actor reads public content. It cannot open private accounts, recover deleted comments or access content that Instagram withholds from anonymous visitors. It does not require an Instagram password, session cookie or account connection.

#### Supported Instagram links

- `https://www.instagram.com/reel/DfUah5TMx4p/`
- `https://www.instagram.com/p/DfT6F86Rqs_/`
- `https://www.instagram.com/giorgiameloni/reel/DfUah5TMx4p/?hl=it`
- Standard `/p/`, `/reel/`, `/reels/` and `/tv/` post links, with or without a username and tracking parameters.

Photos, videos and carousels use the same input. A carousel has one shared comment list, not a separate list for every slide. Profile, hashtag, Story and private-content URLs are outside this Actor's scope.

#### Input guide

| Field | Default | What it does |
| --- | --- | --- |
| `startUrls` | Required | Public Instagram post or reel links, up to 1,000. Use one URL per line in Bulk edit. |
| `includeReplies` | `true` | Preserve replies if they are explicitly exposed in a public response. Does not unlock reply threads or use authentication. |
| `maxComments` | `0` | Maximum main comments inspected per post. `0` means no user-selected cap, subject to safety limits. Any exposed replies are additional rows. |
| `commentsSince` | Empty | Earliest date to include, `YYYY-MM-DD`, inclusive from 00:00 UTC. Leave empty for all dates. |

The comment limit applies **before** the date filter. Results can therefore contain fewer rows than the selected maximum. Posts are grouped in completion order; rows are newest first **within each post**, not across the entire batch. New comments may appear while the collection is running.

##### Collect the available comments from a Reel and a photo

```json
{
  "startUrls": [
    "https://www.instagram.com/giorgiameloni/reel/DfUah5TMx4p/?hl=it",
    "https://www.instagram.com/giorgiameloni/p/DfT6F86Rqs_/?hl=it"
  ],
  "maxComments": 0,
  "includeReplies": true
}
```

##### Check up to 500 main comments per post, keeping only recent comments

```json
{
  "startUrls": ["https://www.instagram.com/reel/DfUah5TMx4p/"],
  "maxComments": 500,
  "commentsSince": "2026-11-01",
  "includeReplies": false
}
```

#### Output: one comment per row

The dataset contains comment records only. Coverage reports and failures are separate, so they do not pollute the spreadsheet with empty comment rows.

| Fields | Meaning |
| --- | --- |
| `type`, `commentId`, `parentCommentId` | Comment/reply type, unique comment ID, and parent ID when exposed. IDs are strings to preserve precision. |
| `text`, `createdAt`, `commentUrl` | Original text, UTC publication time and a link to the comment. Text is not translated. |
| `likesCount`, `replyCount` | Public like and reply counts. `null` means not exposed, not zero. |
| `authorId`, `authorUsername`, `authorProfileUrl` | Public commenter identity and profile link. |
| `authorIsVerified`, `authorProfilePictureUrl` | Public verification indicator and profile image URL when exposed. |
| `isPostAuthor`, `gifUrl` | Whether the commenter is the post owner, and the comment GIF URL when available. |
| `postId`, `shortcode`, `postUrl`, `postType`, `inputUrl` | Source content identifiers, resolved link, media type and normalized input link. |
| `postAuthorUsername`, `postCaption`, `postCreatedAt` | Public post author, caption and UTC publication time. |
| `instagramReportedCommentCount` | Instagram's post-level counter, which can exceed accessible comments. |
| `scrapedAt` | UTC collection time. |

**Illustrative output**, using a fictional commenter and comment ID:

```json
{
  "type": "comment",
  "commentId": "18000000000000001",
  "parentCommentId": null,
  "shortcode": "DfUah5TMx4p",
  "postUrl": "https://www.instagram.com/p/DfUah5TMx4p/",
  "postType": "reel",
  "text": "Thanks for sharing this update!",
  "createdAt": "2026-11-05T10:30:00.000Z",
  "authorUsername": "example_viewer",
  "likesCount": 3,
  "replyCount": null
}
```

Some metadata may be unavailable. Unknown values remain `null`. Image and GIF links can expire.

#### Coverage and practical limits

Open **Run summary** for result counts and **Post details** for source links and collection notes. Instagram may withhold replies and other comments from anonymous visitors, so exported totals can differ from its displayed counter.

Automatic limits keep individual posts from consuming an entire batch: up to 25,000 rows, 2,000 requests and about 15 minutes per post, with a run budget of about 58 minutes. Long batches can need multiple runs. Duplicate, looping or stalled pagination is stopped; rate-limit retries are bounded. An unavailable link does not prevent other valid links from being processed. Keep enough run time in Apify's run options for the chosen batch size.

#### Use cases

**Social listening and sentiment analysis:** export the source comments for your analysis tools, with timestamps and post links for traceability.

**Campaign reporting:** compare responses to Reels, photos and carousels, identify frequently discussed topics and track public engagement.

**Community management:** find questions, feedback and recurring requests in a spreadsheet, without manually copying comments.

**Creator and competitor research:** compare publicly accessible conversations across selected posts. This Actor collects text; it does not infer sensitive traits or classify individual commenters.

**Giveaway review:** export the available entries and check dates and mentions in your own workflow. Limited anonymous coverage means this is not a guarantee of a complete entrant list.

#### Use with AI agents and MCP

Actor identifier: **`lofomachines/instagram-comments-replies-scraper`**.

Connect through the [Apify MCP server](https://mcp.apify.com/?tools=lofomachines/instagram-comments-replies-scraper) in an MCP-capable client such as Claude or Codex. Other assistants need their own compatible Apify/MCP integration; this is not a claim of built-in support in every chatbot. Use an authorized Apify connection to run the Actor.

A useful instruction is: “Collect the available public comments from these Instagram post and Reel URLs, with `maxComments: 500`. Return the dataset and the per-post coverage report. Explicitly state whether replies were exposed.”

Use this tool when you have specific public Instagram content URLs and need comment rows. Use a different tool for profile discovery, followers, Stories or private content. Use **Run summary** for result counts and collection notes. Output schemas identify the dataset, downloadable formats and coverage records for automation.

#### Frequently asked questions

**Does it scrape Instagram Reel comments and photo comments?** Yes. Paste either type of public link in the same input. Carousel and video post links are also supported.

**Can I export all Instagram comments without login?** You can collect the public main-comment list to its available end, within the limits. Instagram may omit replies, hidden comments and other content, so its displayed counter is not a completeness guarantee.

**Does “Include available replies” recover missing replies?** No. It preserves reply records only if Instagram explicitly returns them publicly. The anonymous route currently normally omits reply threads. A zero exported-reply total must not be interpreted as “this post has no replies.”

**Is the newest-first order global across all links?** No. Each post's comments are sorted newest first; posts are exported as separate groups in completion order.

**Does the Chinese README translate comment text?** No. Documentation is localized, while comments keep their original language.

**Can I run it daily?** Save an Apify task and attach a schedule. Use `commentsSince` to focus on recent dates. Deduplicate historical exports by `commentId`, as overlapping dates include comments already collected on earlier runs.

**Build your next workflow:** discover more social media and data tools from [Lofomachines on Apify](https://apify.com/lofomachines).

### Chinese Simplified

#### Instagram 评论采集器：批量导出 Reels、图片和帖子评论

把公开 Instagram 帖子下的讨论变成可分析的数据。输入 Reels、图片、视频或轮播帖子的链接，即可导出公开可获取的评论正文、发布时间、点赞数、作者信息和评论链接，支持 **Excel、CSV 和 JSON**。

**无需 Instagram 登录；支持批量链接、日历日期筛选，以及每个帖子内按最新时间排序。**

**回复限制：** Instagram 面向未登录访客的评论列表目前通常不提供回复内容或回复数量。本工具采集公开主评论；仅在返回数据明确包含回复时保留回复。不能保证采集所有回复。`replyCount: null` 表示未知，不能当作零。

#### 三步开始

1. 在 **Instagram links** 中添加链接，或选择 **Bulk edit**，每行粘贴一个链接，最多 1,000 个。
2. 在 **Maximum comments per post** 设置每个帖子最多检查多少条主评论；`0` 表示在自动安全限制内尽量收集。**Comments since** 可选择最早日期。
3. 点击 **Start**，完成后下载表格，并查看 **Run summary** 的覆盖情况。

#### 输入说明

| 参数 | 说明 |
| --- | --- |
| `startUrls` | 公开帖子或 Reel 链接数组。支持包含用户名或跟踪参数的链接；重复帖子只导出一次。 |
| `includeReplies` | 默认 `true`。仅保留公开响应实际包含的回复，不会启用登录或解锁隐藏回复。 |
| `maxComments` | 默认 `0`，主评论检查上限按每个帖子计算。数量上限先于日期筛选生效。 |
| `commentsSince` | 可选 `YYYY-MM-DD` 日期，从当天 UTC 00:00 起包含。留空表示不限日期。 |

```json
{
  "startUrls": [
    "https://www.instagram.com/reel/DfUah5TMx4p/",
    "https://www.instagram.com/p/DfT6F86Rqs_/"
  ],
  "maxComments": 1000,
  "includeReplies": true
}
```

#### 输出

每条评论占一行，主要字段包括 `commentId`、`text`、`createdAt`、`authorUsername`、`authorProfileUrl`、`likesCount`、`replyCount`、`parentCommentId`、`postUrl` 和 `postType`。时间使用 UTC，评论保持原文，不会自动翻译。

适合跨境电商品牌、出海营销团队、社交媒体运营、活动复盘、评论情绪分析和公开内容研究。

#### 覆盖情况与常见问题

- Instagram 显示的评论总数可能包含未公开的回复、隐藏内容或其他不可访问的评论。结果少于显示总数不等于程序丢失了可获取的评论。
- 每个帖子最多 25,000 行、2,000 次请求、约 15 分钟；单次运行约 58 分钟。大批量任务可能需要拆分。
- 数据按每个帖子分别从新到旧排列，不是所有链接全局排序。私人账户、Stories 和个人主页链接不在采集范围内。
- 可通过 Apify 任务与计划定期运行。连接 MCP 的 AI 助手可以使用该工具，使用时需要授权的 Apify 连接。

**发现更多数据工具：** [访问 Lofomachines 的其他 Apify Actors](https://apify.com/lofomachines)。

### Chinese Traditional

#### Instagram 留言擷取工具：批次匯出 Reels、相片與貼文留言

將公開 Instagram 討論整理成可分析的表格。輸入 Reels、相片、影片或輪播貼文連結，即可匯出公開可取得的留言原文、發布時間、按讚數、作者資訊及留言連結，支援 **Excel、CSV 和 JSON**。

**無須 Instagram 登入；支援批次連結、日曆日期篩選及每篇貼文內由新到舊排序。**

**回覆限制：** Instagram 提供給未登入訪客的清單目前通常不包含回覆串及回覆數量。本工具擷取公開主留言，只在回傳資料明確包含回覆時保留回覆。`replyCount: null` 代表未知，並非零。

#### 使用方式與輸入設定

1. 在 **Instagram links** 新增連結，或以 **Bulk edit** 每行貼上一個網址，最多 1,000 個。
2. 設定 **Maximum comments per post**，`0` 代表在自動安全限制內收集可取得的主留言。可用 **Comments since** 日曆選擇最早日期。
3. 按下 **Start**，下載結果並檢查 **Run summary**。

| 參數 | 說明 |
| --- | --- |
| `startUrls` | 公開貼文與 Reel 網址陣列，接受含使用者名稱的網址。重複貼文會跳過。 |
| `includeReplies` | 預設 `true`，僅保留公開資料實際提供的回覆，不會啟用登入。 |
| `maxComments` | 每篇貼文要檢查的主留言上限，預設 `0`。先套用數量上限，再篩選日期。 |
| `commentsSince` | 可選 `YYYY-MM-DD`，包含當天 UTC 00:00 之後的留言，留空則不限日期。 |

```json
{
  "startUrls": ["https://www.instagram.com/p/DfT6F86Rqs_/"],
  "maxComments": 500,
  "includeReplies": false,
  "commentsSince": "2026-11-01"
}
```

#### 結果與適用情境

每筆留言獨立一行，包含 `commentId`、`text`、`createdAt`、`authorUsername`、`authorProfileUrl`、`likesCount`、`replyCount`、`parentCommentId`、`postUrl` 及 `postType` 等欄位。留言保留原始語言，時間以 UTC 表示。

適用於品牌社群分析、跨境行銷、活動成效報告、公開競品研究及留言情緒分析。

Instagram 的總數可能包含無法公開存取的回覆或隱藏留言，不能保證與匯出數量相同。

每篇貼文的自動限制為 25,000 行、2,000 次請求及約 15 分鐘，單次執行約 58 分鐘。結果按每篇貼文由新到舊排列，並非跨所有連結的全域排序。私人帳號、限時動態及個人檔案網址不適用。

可搭配 Apify 排程及支援 MCP 的 AI 助手；使用時需要獲授權的 Apify 連線。

**探索更多工具：** [查看 Lofomachines 的其他 Apify Actors](https://apify.com/lofomachines)。

### Italiano

#### Esporta commenti Instagram da reel, foto e caroselli

Trasforma le conversazioni pubbliche su Instagram in un foglio pronto per l'analisi. Incolla i link e raccogli i commenti disponibili con testo originale, autore, data, like e collegamento diretto. Esporta in **Excel, CSV o JSON**, senza login Instagram.

**Limite sulle risposte:** Instagram normalmente non fornisce i thread di risposta né il loro conteggio ai visitatori anonimi. L'Actor raccoglie i commenti principali pubblici e conserva le risposte solo se effettivamente esposte. Non promette di recuperare tutte le risposte. `replyCount: null` significa dato non disponibile, non zero.

#### Come iniziare

1. Aggiungi i link in **Instagram links**, oppure usa **Bulk edit**, con un URL per riga fino a 1.000 link.
2. Imposta **Maximum comments per post**: `0` raccoglie quanto disponibile entro i limiti automatici. Scegli eventualmente una data nel calendario **Comments since**.
3. Premi **Start**, scarica i risultati e controlla **Run summary**.

| Campo | Significato |
| --- | --- |
| `startUrls` | Link pubblici di reel, foto, video o caroselli. Accetta anche link contenenti il nome del profilo. Elimina i duplicati. |
| `includeReplies` | `true` conserva le risposte soltanto se presenti nei dati pubblici. Non abilita l'autenticazione. |
| `maxComments` | Massimo di commenti principali da esaminare per post; `0` senza limite scelto dall'utente. Le eventuali risposte sono aggiuntive. |
| `commentsSince` | Data minima facoltativa `YYYY-MM-DD`, inclusiva dalle 00:00 UTC. Vuoto per tutte le date. |

```json
{
  "startUrls": [
    "https://www.instagram.com/giorgiameloni/reel/DfUah5TMx4p/?hl=it",
    "https://www.instagram.com/giorgiameloni/p/DfT6F86Rqs_/?hl=it"
  ],
  "maxComments": 0,
  "includeReplies": true
}
```

#### Output

Una riga per commento con `commentId`, `text`, `createdAt`, `authorUsername`, `authorProfileUrl`, `likesCount`, `replyCount`, `parentCommentId`, `postUrl`, `postType` e i metadati pubblici del contenuto. Il dataset contiene solo commenti; errori e copertura sono in report separati.

Utile per social listening, report delle campagne, analisi dei feedback, community management e ricerca sui contenuti pubblici.

#### Copertura e domande frequenti

Il limite massimo si applica prima del filtro data. I risultati sono dal più recente all'interno di ciascun post; i post vengono raggruppati nell'ordine di completamento. Non è un ordinamento globale dell'intero batch.

Il contatore visibile può includere risposte, commenti nascosti o non disponibili: raggiungere la fine della lista pubblica non garantisce di eguagliarlo.

I limiti automatici sono 25.000 righe, 2.000 richieste e circa 15 minuti per post; la run ha un budget di circa 58 minuti. I batch molto grandi possono richiedere più esecuzioni. Profili, hashtag, Stories e contenuti privati non sono supportati.

Per esecuzioni periodiche salva un task Apify e aggiungi una pianificazione. Per gli assistenti AI usa una connessione Apify MCP autorizzata: gli schemi descrivono input, output e report di copertura.

**Scopri altri strumenti per i tuoi workflow:** [visita tutti gli Actor di Lofomachines](https://apify.com/lofomachines).

### Instagram comments API: get results in one request

Connect public Instagram conversations to dashboards, AI assistants, Make or n8n. The **Server** interface returns comments and available replies directly as JSON. Use it for quick post checks, customer feedback workflows and on-demand conversation analysis. For large exports or multiple posts, keep using the **Input** tab.

#### Try it without code

1. Open **Server**, expand **POST /scrape**, and select **Try it out**.
2. Paste one public Instagram post link into `startUrls`. Choose how many main comments to inspect and whether to include available replies.
3. Select **Execute**. Read `data.comments`, the counts, and the collection notes in `coverage`.

#### Example request

Copy the service URL from the Server tab. External tools use `Authorization: Bearer YOUR_APIFY_TOKEN` and `Content-Type: application/json`.

```json
{
  "startUrls": [
    "https://www.instagram.com/reel/DfUah5TMx4p/"
  ],
  "maxComments": 10,
  "includeReplies": true
}
```

#### Example response

Illustrative empty response; nonempty `data.comments` contains the same comment and reply records documented above.

```json
{
  "requestId": "example-request",
  "status": "ok",
  "counts": { "total": 0, "comments": 0, "replies": 0 },
  "data": { "comments": [] },
  "coverage": { "totalRows": 0, "issues": [] }
}
```

`ok` means the request was processed. It does **not** promise every comment was accessible: read `coverage.issues`. Private, hidden, removed or login-only comments cannot be recovered. Instagram often does not expose reply threads anonymously; check repliesAvailability in coverage.

#### Limits and pricing

- One post per request; **1–50 main comments**, default 10. Replies are additional; at most **250 total rows** are returned. Facebook reply expansion is also limited to 20 per thread.
- Collection budget: **90 seconds**. Available results may be returned when a safety limit is reached, with an explanation in `coverage`.
- Each returned **comment or reply** charges one **Server result** (`server-result`), at the same plan-based per-result rate as batch exports. No result means no result charge. There is no Actor-start fee per Server request. See **Pricing** for current rates.
- Results are isolated per request and returned directly, without a shared dataset. Use **Input** for CSV, Excel, JSON downloads and resumable runs.
- Repeating a request performs a new collection and can charge again. Billing is confirmed before the response; a billing error returns no results.
- A busy instance returns **429**, with `Retry-After: 5`; invalid input returns **400**; unavailable posts return **502**.

Multi-tenant hosting shares warm instances across users, while each request has its own inputs, network client, results and billing ID. The server accepts public URLs; it does not accept account cookies or login credentials.

Discover more no-code tools for social research: [Explore all Lofomachines Actors](https://apify.com/lofomachines).

# Actor input Schema

## `startUrls` (type: `array`):

Paste public Instagram reel, photo, video or carousel post links. Use Bulk edit for one URL per line, up to 1,000 links. Posts run in parallel and duplicate links are skipped.

## `includeReplies` (type: `boolean`):

Keep replies if Instagram exposes them publicly. Anonymous Instagram responses usually omit reply threads and reply counts. Check the coverage report; this option does not enable login or recover hidden replies.

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

Maximum main comments to inspect per post, starting with the newest. Replies, if exposed, are separate. 0 collects available comments within automatic safety limits. The limit applies before the date filter.

## `commentsSince` (type: `string`):

Choose the earliest comment date to include, starting at 00:00 UTC. Leave empty for all dates. Results exclude older comments; anonymous reply coverage remains limited.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.instagram.com/reel/DfUah5TMx4p/",
    "https://www.instagram.com/p/DfT6F86Rqs_/"
  ],
  "includeReplies": true,
  "maxComments": 0
}
```

# Actor output Schema

## `comments` (type: `string`):

Default dataset table: one row per comment or reply, including source post links.

## `summary` (type: `string`):

Result counts, source posts, applied filters and collection notes.

## `json` (type: `string`):

Full comment and reply records as JSON. Metadata can be null when Instagram does not expose it.

## `csv` (type: `string`):

CSV export of the comments view for spreadsheet analysis.

## `excel` (type: `string`):

Excel export of the comments view.

## `coverage` (type: `string`):

Per-post counts, source links and collection notes.

## `resolution` (type: `string`):

Submitted Instagram links and the associated public post permalinks when resolution succeeds.

# 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 = {
    "startUrls": [
        "https://www.instagram.com/reel/DfUah5TMx4p/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lofomachines/instagram-comments-replies-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 = { "startUrls": ["https://www.instagram.com/reel/DfUah5TMx4p/"] }

# Run the Actor and wait for it to finish
run = client.actor("lofomachines/instagram-comments-replies-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 '{
  "startUrls": [
    "https://www.instagram.com/reel/DfUah5TMx4p/"
  ]
}' |
apify call lofomachines/instagram-comments-replies-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lofomachines/instagram-comments-replies-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/0bhQaDDhpc0RQ8HC2/builds/Rl84K5jdLI2RFWlSl/openapi.json
