# IG Post & Reel Comment Bot (`mikolabs/ig-post-reel-comment-bot`) Actor

A Smart tool to post comments on Instagram posts and reels using your logged-in session cookies. Supports multiple URLs, customizable messages, and basic human-like typing delays for more natural interaction.

- **URL**: https://apify.com/mikolabs/ig-post-reel-comment-bot.md
- **Developed by:** [mikolabs](https://apify.com/mikolabs) (community)
- **Categories:** Social media, Automation
- **Stats:** 3 total users, 2 monthly users, 14.3% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## 🚀 IG Post & Reel Comment Bot

A smart Instagram automation tool that posts comments on multiple Instagram posts and reels using your logged-in session cookies. Built for scalable engagement with human-like behavior, customizable messages, and bulk processing.

---

### ✨ Features

- Comment on multiple Instagram posts & reels in a single run  
- Secure login using Instagram session cookies  
- Dynamic comment templates with random variations  
- Human-like typing with delays and natural pauses  
- Sequential processing to mimic real user behavior  
- Automatic retries for failed attempts  
- Detailed dataset output for every processed URL  

---

### 🧠 What It Does

This Actor automates Instagram commenting by:

- Accepting multiple post or reel URLs  
- Opening a logged-in session using your cookies  
- Generating randomized comment messages  
- Typing comments with human-like delays  
- Posting comments one by one  
- Saving structured results for each URL  

---

### 📥 Input

The Actor requires the following fields:

#### Required Fields

- **`postUrls`**  
  Add one or more Instagram post or reel URLs.  
  The Actor processes them sequentially.

- **`commentMessage`**  
  The comment to post on each URL.  

  Supports random variations using `{}` and `|`.

  Example:
  ```text
  Hey {hi|hello}, how are you {doing|feeling} today?

Possible outputs:

Hey hi, how are you doing today?

Hey hello, how are you feeling today?

cookies
Instagram session cookies from a logged-in browser.

👉 You can export cookies using tools like:
Export Cookie JSON File (Chrome extension)



---

⚙️ Advanced Settings

Field	Default	Description

navigationTimeoutSecs	45	Maximum page load time
slowdownMaxMs	1800	Human delay between actions
typingDelayMaxMs	140	Typing speed simulation
maxRetries	2	Retry attempts on failure



---

📝 Example Input

{
  "postUrls": [
    { "url": "https://www.instagram.com/p/DWSH3tDDMTO/" },
    { "url": "https://www.instagram.com/reels/DUp5DscClpv/" }
  ],
  "commentMessage": "{Haha|Hahaha}, is that true?",
  "cookies": [
    {
      "name": "sessionid",
      "value": "your-session-cookie",
      "domain": ".instagram.com",
      "path": "/",
      "httpOnly": true,
      "secure": true
    }
  ],
  "navigationTimeoutSecs": 45,
  "slowdownMaxMs": 1800,
  "typingDelayMaxMs": 140,
  "maxRetries": 2
}


---

🎲 Random Comment Variations

Use {option1|option2} syntax to generate dynamic comments.

Example

{Nice|Awesome}, love this!

Output Examples

Nice, love this!

Awesome, love this!



---

📊 Output

Each processed URL generates one dataset item with:

status

success

postUrl

contentType

commentMessage

resolvedCommentMessage

commentSubmitted

attemptsUsed

cookiesLoaded

finalUrl

error (if any)

timestamp



---

🚀 How To Use

1. Open the Actor in Apify


2. Add Instagram post/reel URLs in postUrls


3. Enter your comment template in commentMessage


4. Paste your Instagram cookies in cookies


5. (Optional) Adjust settings in Advanced tab


6. Start the run


7. Review results in the dataset




---

💡 Use Cases

Automate Instagram engagement

Comment on multiple reels efficiently

Run marketing campaigns with reusable templates

Save time on repetitive social media tasks

Generate varied comments automatically



---

⚠️ Important Usage Guidelines

Use responsibly to avoid Instagram restrictions.

Best Practices

Keep delays natural (≥ 1800 ms recommended)

Avoid posting too many comments quickly

Use valid and fresh session cookies

Do not aggressively reduce delay settings

Avoid spam-like behavior


⚠️ Improper usage may lead to:

Rate limits

Temporary action blocks

Login challenges

Account restrictions



---

🔐 Notes

Works with Instagram posts and reels only

Does not support direct messages (DMs)

Requires an active logged-in session

Runs headless on Apify cloud



---

🔍 SEO Keywords

instagram comment bot, instagram automation tool, auto comment instagram posts, instagram reels bot, bulk instagram commenting, social media automation, apify instagram bot, instagram engagement tool


---

💬 Summary

IG Post & Reel Comment Bot helps you automate Instagram commenting in a scalable and natural way. With smart randomization and human-like interaction, it enables efficient engagement without compromising authenticity.


---

# Actor input Schema

## `cookies` (type: `array`):

Paste the exported Instagram cookies array, using the same structure as the local cookies.json example.
## `postUrls` (type: `array`):

Add one or more Instagram post or reel URLs. The Actor will process them one by one in the same run.
## `commentMessage` (type: `string`):

Comment text to post on each Instagram post or reel. You can use random options like Hey {hola|hi|hello}, how are you {doing|feeling} today?
## `navigationTimeoutSecs` (type: `integer`):

Maximum time to wait for page loads and UI interactions.
## `slowdownMaxMs` (type: `integer`):

Maximum randomized delay used between interactions to mimic more human-like behavior.
## `typingDelayMaxMs` (type: `integer`):

Maximum randomized delay between typed characters. Lower values are faster but riskier. Very low delays can increase the chance of Instagram blocking or challenging the account.
## `maxRetries` (type: `integer`):

Maximum retry attempts per post or reel when an interaction fails.

## Actor input object example

```json
{
  "cookies": [
    {
      "name": "sessionid",
      "value": "your-session-cookie",
      "domain": ".instagram.com",
      "path": "/",
      "httpOnly": true,
      "secure": true
    }
  ],
  "postUrls": [
    {
      "url": "https://www.instagram.com/p/DWSH3tDDMTO/"
    },
    {
      "url": "https://www.instagram.com/reels/DUp5DscClpv/"
    }
  ],
  "commentMessage": "{Haha|Hahaha}, is that true?",
  "navigationTimeoutSecs": 45,
  "slowdownMaxMs": 1800,
  "typingDelayMaxMs": 140,
  "maxRetries": 2
}
````

# Actor output Schema

## `dataset` (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 = {
    "cookies": [
        {
            "name": "sessionid",
            "value": "your-session-cookie",
            "domain": ".instagram.com",
            "path": "/",
            "httpOnly": true,
            "secure": true
        }
    ],
    "postUrls": [
        {
            "url": "https://www.instagram.com/p/DWSH3tDDMTO/"
        },
        {
            "url": "https://www.instagram.com/reels/DUp5DscClpv/"
        }
    ],
    "commentMessage": "{Haha|Hahaha}, is that true?"
};

// Run the Actor and wait for it to finish
const run = await client.actor("mikolabs/ig-post-reel-comment-bot").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 = {
    "cookies": [{
            "name": "sessionid",
            "value": "your-session-cookie",
            "domain": ".instagram.com",
            "path": "/",
            "httpOnly": True,
            "secure": True,
        }],
    "postUrls": [
        { "url": "https://www.instagram.com/p/DWSH3tDDMTO/" },
        { "url": "https://www.instagram.com/reels/DUp5DscClpv/" },
    ],
    "commentMessage": "{Haha|Hahaha}, is that true?",
}

# Run the Actor and wait for it to finish
run = client.actor("mikolabs/ig-post-reel-comment-bot").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 '{
  "cookies": [
    {
      "name": "sessionid",
      "value": "your-session-cookie",
      "domain": ".instagram.com",
      "path": "/",
      "httpOnly": true,
      "secure": true
    }
  ],
  "postUrls": [
    {
      "url": "https://www.instagram.com/p/DWSH3tDDMTO/"
    },
    {
      "url": "https://www.instagram.com/reels/DUp5DscClpv/"
    }
  ],
  "commentMessage": "{Haha|Hahaha}, is that true?"
}' |
apify call mikolabs/ig-post-reel-comment-bot --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=mikolabs/ig-post-reel-comment-bot",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "IG Post & Reel Comment Bot",
        "description": "A Smart tool to post comments on Instagram posts and reels using your logged-in session cookies. Supports multiple URLs, customizable messages, and basic human-like typing delays for more natural interaction.",
        "version": "0.0",
        "x-build-id": "61Wa8ceBTzVsnDDIW"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/mikolabs~ig-post-reel-comment-bot/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-mikolabs-ig-post-reel-comment-bot",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/mikolabs~ig-post-reel-comment-bot/runs": {
            "post": {
                "operationId": "runs-sync-mikolabs-ig-post-reel-comment-bot",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/mikolabs~ig-post-reel-comment-bot/run-sync": {
            "post": {
                "operationId": "run-sync-mikolabs-ig-post-reel-comment-bot",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "postUrls",
                    "commentMessage",
                    "cookies"
                ],
                "properties": {
                    "cookies": {
                        "title": "Instagram Cookies",
                        "type": "array",
                        "description": "Paste the exported Instagram cookies array, using the same structure as the local cookies.json example."
                    },
                    "postUrls": {
                        "title": "Instagram Post or Reel URLs",
                        "type": "array",
                        "description": "Add one or more Instagram post or reel URLs. The Actor will process them one by one in the same run.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "commentMessage": {
                        "title": "Comment Message",
                        "type": "string",
                        "description": "Comment text to post on each Instagram post or reel. You can use random options like Hey {hola|hi|hello}, how are you {doing|feeling} today?"
                    },
                    "navigationTimeoutSecs": {
                        "title": "Navigation Timeout (seconds)",
                        "minimum": 10,
                        "type": "integer",
                        "description": "Maximum time to wait for page loads and UI interactions.",
                        "default": 45
                    },
                    "slowdownMaxMs": {
                        "title": "Human Delay Max (ms)",
                        "minimum": 250,
                        "type": "integer",
                        "description": "Maximum randomized delay used between interactions to mimic more human-like behavior.",
                        "default": 1800
                    },
                    "typingDelayMaxMs": {
                        "title": "Typing Delay Max (ms)",
                        "minimum": 30,
                        "type": "integer",
                        "description": "Maximum randomized delay between typed characters. Lower values are faster but riskier. Very low delays can increase the chance of Instagram blocking or challenging the account.",
                        "default": 140
                    },
                    "maxRetries": {
                        "title": "Max Retries",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum retry attempts per post or reel when an interaction fails.",
                        "default": 2
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
