# Instagram Auto Commenter: Comment Bot for Posts & Reels (`am_production/instagram-auto-commenter`) Actor

Instagram auto commenter and comment bot. Automatically comment on the newest posts and reels of any usernames, or on exact post URLs, from your own account. Rotating comments, human-like typing and delays, action-block protection. Only verified comments are charged. Pay per comment.

- **URL**: https://apify.com/am\_production/instagram-auto-commenter.md
- **Developed by:** [NoSite](https://apify.com/am_production) (community)
- **Categories:** Social media, Automation
- **Stats:** 4 total users, 3 monthly users, 40.0% runs succeeded, 4 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $8.00 / 1,000 comment completeds

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?

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 Auto Commenter (Instagram Comment Bot)

**Auto comment on Instagram posts and reels from your own account.** Paste your session cookies, add the comments you want to leave, list the usernames or exact post URLs to engage with, then run it or put it on a schedule. This Instagram comment bot types each comment at a human pace with random delays, rotates your comment texts so no account sees the same line twice, and charges you only for comments that were verified on Instagram.

Typical uses:

- Show up in the comments of creators, prospects or customers before you DM them
- Keep a brand account visibly active on partner and community posts
- Run a daily engagement routine on a fixed list of accounts
- Comment on a hand-picked list of posts or reels found by another scraper
- Add a real engagement signal to an outreach or lead generation workflow

### How it works

1. Opens Instagram in a headless browser with your session cookies (no password needed).
2. Verifies the session is really logged in. If Instagram shows the login page or a checkpoint, the run stops immediately and you are not charged for comments.
3. For each username, visits the profile, scrolls the grid until it has as many posts as you asked for (or every post, if you asked for all) and opens them newest first. Exact post or reel URLs are opened directly.
4. Checks the visible comments for your own username and skips posts you already commented on, for free.
5. Picks a comment from your list, clicks the comment box, types it character by character with human-like timing and presses Post.
6. Confirms the comment appeared in the thread before counting it. Posts with comments turned off are skipped for free.
7. Stops on its own if Instagram raises an "Action Blocked" dialog or refuses to publish several comments in a row, and marks the remaining targets so you know to wait.

### Input

| Field | Description |
| --- | --- |
| `instagram_cookies` | JSON array exported from your browser while logged in. Works with "Export Cookie JSON file for Puppeteer", EditThisCookie and Cookie-Editor exports. Only `sessionid` is required. |
| `session_id` | Alternative to the cookie file: paste just the value of your `sessionid` cookie, or the whole export in any format. |
| `comments` | Comment texts, one per line. One is picked at random for each post. `{username}` is replaced by the target account name. |
| `usernames` | Accounts whose newest posts should get a comment. `@name` and profile URLs are accepted. |
| `post_urls` | Exact post or reel URLs to comment on. Use this on its own or together with usernames. |
| `posts_per_user` | Newest posts to comment on per username (default 1, up to 500). The profile is scrolled as far as needed. Set 0 to go through all posts, bounded by `max_comments_per_run`. |
| `comments_per_post` | Comments to leave on each post, each with a different text (1 to 5, default 1). |
| `max_comments_per_run` | Safety cap for the whole run (default 20). |
| `skip_already_commented` | Skip posts where your username already appears in the comments (default on). Turn it off to comment again on posts you already commented on. |
| `min_delay_seconds` / `max_delay_seconds` | Random pause range between comments (default 10 to 25 seconds). |
| `proxyConfiguration` | Optional Apify Proxy. Residential proxies from your account's country help when Instagram challenges datacenter logins. |

#### Writing comments that do not get flagged

- Add at least 5 to 10 different texts. Instagram treats identical comments across many posts as spam.
- Keep them short, specific and positive. Emoji are fine.
- Use `{username}` to personalise: `Great work, @{username}!`
- Avoid links, phone numbers and "check my page" style calls to action. Those trigger filters fastest.

#### Getting your cookies

Watch the 50 second walkthrough: [How to export your Instagram cookies](https://api.apify.com/v2/key-value-stores/jjiJaBviIermRzlKc/records/nosite-cookies.mp4)

<video src="https://api.apify.com/v2/key-value-stores/jjiJaBviIermRzlKc/records/nosite-cookies.mp4" controls width="640"></video>

1. Log in to instagram.com in Chrome or Firefox.
2. Install a cookie export extension (for example "Export Cookie JSON file for Puppeteer" or "Cookie-Editor").
3. On the Instagram tab, export cookies as JSON and paste the array into **Instagram cookies**. Or copy only the `sessionid` value into **Session ID**.

Cookies are used inside the run only and are not stored by the actor. Do not log out of that browser, logging out invalidates the session.

### Output

One dataset row per target (username or post URL):

```json
{
  "target": "natgeo",
  "target_type": "profile",
  "profile_url": "https://www.instagram.com/natgeo/",
  "status": "commented",
  "posts_found": 12,
  "comments_requested": 1,
  "comments_posted": 1,
  "already_commented": 0,
  "comments_off": 0,
  "posted": [
    {
      "post_url": "https://www.instagram.com/p/C9xxxxxxxxx/",
      "comment": "This is amazing 😍"
    }
  ],
  "error": null,
  "processed_at": "2026-09-13T09:41:03.512Z"
}
```

`status` is one of `commented`, `partial`, `already_commented`, `comments_off`, `no_posts`, `private`, `not_found`, `action_blocked`, `failed`. The **Posted comments** tab lists every comment with its post link. A run level `SUMMARY` record is stored in the key-value store.

### Pricing

Pay per event. You are charged only for comments that were verified on Instagram.

| Event | What it covers | Price (Free plan) | Paid plans |
| --- | --- | --- | --- |
| Comment completed | One comment newly published from your account and confirmed in the thread | $0.012 | $0.010 to $0.008 |
| Profile processed | One target profile opened and its grid read, even when nothing could be commented on (private, not found) | $0.002 | $0.002 |
| Actor start | Browser boot and session check, once per run per GB of memory | $0.010 | $0.005 |

Examples: one comment on each of 20 accounts every day costs about $0.29 a day on the Free plan. A failed login costs one Actor start only. Skipped posts (already commented, comments off) are free.

### Staying safe

- Comments are policed much harder than likes. Roughly 20 to 50 comments per day is the safe zone on an established account; new accounts should stay under 10.
- Keep delays at 10 seconds or more and schedule several small runs rather than one large one.
- Rotate many different comment texts. Repeating one line is the fastest way to get comments hidden or blocked.
- Start with one or two targets to make sure your cookies and comment texts are right.
- Automation is against Instagram's terms of service. Use this on accounts you own and accept that Instagram may limit them.

### FAQ

**Is this an Instagram auto commenter or a comment bot?** Both names describe the same thing: a tool that automatically posts comments on Instagram from your account. This actor comments on the newest posts and reels of the usernames you give it, or on exact post URLs.

**Does it need my password?** No. It uses the session cookies from a browser where you are already logged in. Nothing is stored after the run.

**Will it comment on the same post twice?** Not while "Skip posts I already commented on" is on. It looks for your username in the visible comments before typing, and skipped posts are not charged. If you do want several comments on one post, turn the toggle off or set **Comments per post** to 2 or more; each comment uses a different text from your list.

**Can it comment on all posts of an account?** Yes. Set **Posts to comment on per account** to 0 and the actor scrolls through the whole grid, oldest posts included, until it reaches your **Max comments per run**. Schedule the run daily and it continues from the newest post each time, skipping the ones you already commented on.

**Can I comment on specific posts instead of a whole profile?** Yes. Paste the post or reel URLs into **Post or reel URLs**. You can combine that with usernames in the same run.

**Does it work on reels?** Yes, reels and regular posts both appear in the profile grid and are handled the same way.

**How many comments per day are safe?** Roughly 20 to 50 on an established account. Keep the per-run cap low and schedule several small runs with long delays.

**What happens when comments are turned off on a post?** The post is skipped, counted under `comments_off` and not charged.

**Can it reply to comments or comment on hashtag or location feeds?** Not in this version. Open an issue on the actor page if you need it.

**Why did my run stop with "Action Blocked"?** Instagram temporarily limited comments on your account. The actor stops immediately so it does not make things worse. Wait 24 hours, then run with longer delays and fewer comments.

### Related actors

- [Instagram Auto Liker](https://apify.com/am_production/instagram-posts-auto-like-tool) likes the newest posts of the same usernames. Liking a post before commenting on it looks more natural.

### Support

Open an issue on the actor page or email the developer through the Apify Console.

# Actor input Schema

## `instagram_cookies` (type: `array`):

Cookies exported from a browser where you are logged in to Instagram (JSON array from the "Export Cookie JSON file for Puppeteer", "EditThisCookie" or "Cookie-Editor" extensions). Only the sessionid, csrftoken and ds\_user\_id cookies are needed. Alternatively leave this empty and fill in Session ID below.

## `session_id` (type: `string`):

Paste either the value of your Instagram sessionid cookie, or the whole exported cookie file in any format (JSON array, Cookie-Editor JSON with a cookies list, or a name=value; cookie header string). Use this if the JSON field above rejects your export.

## `comments` (type: `array`):

One comment per line. A random one is picked for each post, and the same text is not reused on the same account while other options remain. Use {username} to insert the target account name, for example: Love this, @{username}!

## `usernames` (type: `array`):

Instagram usernames whose newest posts and reels should get a comment. One per line, with or without the @. Profile URLs are accepted too.

## `post_urls` (type: `array`):

Exact Instagram post or reel URLs to comment on, one per line, for example https://www.instagram.com/p/C9xxxxxxxxx/ or https://www.instagram.com/reel/C9yyyyyyyyy/.

## `posts_per_user` (type: `integer`):

How many of the most recent posts or reels to comment on for each username. The actor scrolls the profile as far as needed. Set 0 to go through all posts (the run still stops at Max comments per run). Posts you already commented on are skipped and not charged.

## `comments_per_post` (type: `integer`):

How many comments to leave on each post. Each one uses a different text from your list, so add at least that many comments. More than one comment on the same post looks unnatural fast, keep it at 1 or 2.

## `max_comments_per_run` (type: `integer`):

Safety cap on the total number of comments in one run. Instagram tolerates far fewer comments than likes, roughly 20 to 50 per day on an established account. Keep runs small and schedule them.

## `skip_already_commented` (type: `boolean`):

Before the first comment on a post, checks the visible comments for your own username and skips the post if it finds one. Skipped posts are free. Turn this off if you want to comment on posts you already commented on.

## `min_delay_seconds` (type: `integer`):

Shortest pause between posting one comment and opening the next post. Comments are watched much more closely than likes, so keep this at 10 seconds or more.

## `max_delay_seconds` (type: `integer`):

Longest pause between comments. A random delay between min and max is used, and typing itself is slowed to a human pace.

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

Optional. Instagram sometimes challenges logins from datacenter IPs. Residential proxies from the country of your account reduce that. Off by default because most users do not need it.

## Actor input object example

```json
{
  "instagram_cookies": [],
  "comments": [
    "Love this! 🔥",
    "Great post, keep it up 👏",
    "This is amazing 😍",
    "So well done!"
  ],
  "usernames": [
    "natgeo",
    "nasa"
  ],
  "post_urls": [],
  "posts_per_user": 1,
  "comments_per_post": 1,
  "max_comments_per_run": 20,
  "skip_already_commented": true,
  "min_delay_seconds": 10,
  "max_delay_seconds": 25,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

JSON array with one object per target username or post URL: status, posts\_found, comments\_requested, comments\_posted, already\_commented, comments\_off, posted (post\_url + comment), error, processed\_at.

## `postedComments` (type: `string`):

Every comment published in this run with the post URL it was left on and the comment text.

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

Totals for the run: targets, comments\_posted, already\_commented, comments\_off and a count of rows per status.

## `loginScreenshot` (type: `string`):

PNG of the page Instagram showed when the cookies were rejected. Present only on a failed login.

## `failedCommentScreenshot` (type: `string`):

PNG of the post page after the first comment that did not register. Up to three are stored as COMMENT\_FAILED\_1 to COMMENT\_FAILED\_3.

# 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 = {
    "instagram_cookies": [],
    "comments": [
        "Love this! 🔥",
        "Great post, keep it up 👏",
        "This is amazing 😍",
        "So well done!"
    ],
    "usernames": [
        "natgeo",
        "nasa"
    ],
    "post_urls": [],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("am_production/instagram-auto-commenter").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 = {
    "instagram_cookies": [],
    "comments": [
        "Love this! 🔥",
        "Great post, keep it up 👏",
        "This is amazing 😍",
        "So well done!",
    ],
    "usernames": [
        "natgeo",
        "nasa",
    ],
    "post_urls": [],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("am_production/instagram-auto-commenter").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 '{
  "instagram_cookies": [],
  "comments": [
    "Love this! 🔥",
    "Great post, keep it up 👏",
    "This is amazing 😍",
    "So well done!"
  ],
  "usernames": [
    "natgeo",
    "nasa"
  ],
  "post_urls": [],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call am_production/instagram-auto-commenter --silent --output-dataset

```

## MCP server setup

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

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/TaM4KM5nPIMEhvK6X/builds/k4gCCo992tHQVmQDJ/openapi.json
