# Crawlnest Instagram Comments (`complimentary_rho/crawlnest-instagram-comments`) Actor

Run a packaged Scrapy spider and export complete records to an Apify dataset.

- **URL**: https://apify.com/complimentary_rho/crawlnest-instagram-comments.md
- **Developed by:** [samir pathak](https://apify.com/complimentary_rho) (community)
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.12 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## CrawlNest Instagram Comments

Run the packaged crawler and collect its returned records in an Apify dataset. Download the results as JSON or CSV.

### Input

- `params`: Supply the Instagram post URL as `url`. Post, reel and reels links are normalized to `/p/CODE/`.
- `maxItems`: Maximum saved comments. Defaults to 20; the runner automatically sets the internal spider `max_comments` to 10 times this value. Any `params.max_comments` value is overridden. Setting `maxItems` to 0 makes both count limits unlimited; runtime limits still apply.
- `blockMedia`: Defaults to true. Skip images, media and fonts to reduce proxy bandwidth.
- `timeoutSeconds`: Run timeout in seconds, from 30 to 86400. Defaults to 1200.
- `proxyConfiguration`: Optional Apify or custom proxy configuration.

### Output and limitations

Records are saved to the default dataset with all fields yielded by the spider. `RUN_SUMMARY` in the default key-value store reports counts and the finish reason. Source restrictions, spider-specific limits and run timeouts can reduce results. Playwright queues are in memory and cannot resume pending browser requests after interruption.

See the Actor's Pricing tab for its configured charges. Customize this documentation for your packaged spider before publishing it.

Example cloud input:

```json
{
  "maxItems": 200,
  "params": {"url": "https://www.instagram.com/p/DdkAAtEvK0Y/"},
  "blockMedia": true,
  "timeoutSeconds": 180,
  "proxyConfiguration": {"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}
}
```

For local tests without proxy credentials, set `proxyConfiguration.useApifyProxy` to false. A limit is a maximum, not a guarantee: source availability, timeouts and rejected pagination can reduce results. Logs report comments-response status and scroll-target availability without dumping request credentials.

### Diagnosing a cloud failure

The default key-value store contains `COMMENTS_DIAGNOSTICS`: bounded GraphQL request/response events, capture rejection reasons, visible scroll-container measurements, final path, title, login-form presence and finish reason. It excludes request bodies, cookies, query strings and comment text. For a missed browser capture, opt into `saveDebugScreenshots: true` to also save `COMMENTS_FAILURE_SCREENSHOT` (the screenshot can show publicly loaded page content). Download the JSON report and optional screenshot from the run's Storage tab; these are not dataset items.

# Actor input Schema

## `blockMedia` (type: `boolean`):

Block images, video/audio and fonts during browser bootstrap. HTML, scripts, styles and API responses remain enabled. Disable to troubleshoot extraction.

## `saveDebugScreenshots` (type: `boolean`):

Opt in to failure screenshots. Basic navigation and failure metadata remain available.

## `params` (type: `object`):

Spider arguments. Choose the output limit with Maximum output records. Internal max_comments is automatically 10 times that limit; any supplied max_comments value is overridden.

## `maxItems` (type: `integer`):

0 disables the record-count cap. Runtime and Apify spending limits still apply.

## `timeoutSeconds` (type: `integer`):

Stop crawling after this many seconds; the platform run timeout can stop it sooner.

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

Optional Apify proxy or your own proxy URLs. Proxy use may incur extra charges.

## Actor input object example

```json
{
  "blockMedia": true,
  "saveDebugScreenshots": false,
  "params": {
    "url": "https://www.instagram.com/p/DdkAAtEvK0Y/",
    "headless": "true",
    "debug_pause": "0"
  },
  "maxItems": 20,
  "timeoutSeconds": 1200,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Complete records returned by the crawler, stored in the default dataset.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("complimentary_rho/crawlnest-instagram-comments").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("complimentary_rho/crawlnest-instagram-comments").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 '{}' |
apify call complimentary_rho/crawlnest-instagram-comments --silent --output-dataset

```

## MCP server setup

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

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/56W8wZmXJ1YCXKL3C/builds/fEOfld1oauNP8MeqH/openapi.json
