# IG Bulk DM (`api402/ig-bulk-dm`) Actor

Boost your Instagram outreach with the Instagram Bulk DM Sender. This powerful Apify Actor allows you to send personalized direct messages to multiple Instagram users automatically. Designed for efficiency, account safety, it supports message randomization and smart delays to mimic human behavior.

- **URL**: https://apify.com/api402/ig-bulk-dm.md
- **Developed by:** [Synapz (Api402)](https://apify.com/api402) (community)
- **Categories:** Automation, Social media, Integrations
- **Stats:** 21 total users, 2 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: No ratings yet

## Pricing

from $12.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

## Instagram Bulk DM Sender: Automated Instagram Messaging Tool

Boost your Instagram outreach with the **Instagram Bulk DM Sender**. This powerful Apify Actor allows you to send personalized direct messages to multiple Instagram users automatically. Designed for efficiency and account safety, it supports message randomization and smart delays to mimic human behavior.

---

### 🚀 Key Features

- **Automated Messaging**: Send DMs to a list of usernames effortlessly.
- **Message Randomization**: Use spintax like `{Hello|Hi|Hey}` to send unique variations to every user.
- **Account Safety**: Custom delays between messages to prevent rate limiting.
- **Dual Authentication**: Login using a **Session ID** or **JSON Cookies**.
- **Smart Fallback**: Reliable sending mechanism with built-in error handling.
- **Proxy Support**: Connect residential proxies for enhanced anonymity and higher success rates.

---

### 🛠️ How to Get Started

#### 1. Extracting Authentication Data (Required)
To use this tool, you need to provide your Instagram session data. There are two ways to do this:

##### **Method A: Extracting Cookies (Recommended)**
1. Install a browser extension like **[Cookie-Editor](https://cookie-editor.cgagnier.ca/)** or **[EditThisCookie](http://www.editthiscookie.com/)**.
2. Open [Instagram.com](https://www.instagram.com) and log into your account.
3. Click the extension icon and select **Export** (choose **JSON** format).
4. Paste the copied JSON into the `cookies` field in the Actor's input.

##### **Method B: Using Session ID**
1. Open Instagram in your browser (Chrome/Edge preferred).
2. Press `F12` to open **Developer Tools**.
3. Navigate to the **Application** tab → **Cookies** → `https://www.instagram.com`.
4. Locate the `sessionid` cookie and copy its value.
5. Paste this value into the `sessionId` field in the Actor's input.

---

### 🛡️ Best Practices for Account Safety

Instagram is strict about automation. To keep your account safe and avoid bans, follow these guidelines:

1. **Avoid Bulk Spams**: Do not send hundreds of messages at once. 
2. **Recommended Volume**: Perform **2-3 runs per day**, sending approximately **40-50 messages** in total.
3. **Use Smart Delays**: Set `min_delay` and `max_delay` to at least 90-180 seconds. Longer delays (2-5 minutes) are even safer.
4. **Message Variety**: Use the `{|}` syntax to ensure every message looks different.
5. **Proxy Usage**: Always use a **residential proxy** if you are sending messages frequently or from a different location than your usual IP.

> [!WARNING]
> **About Bans**: If you exceed Instagram's limits, you may receive a "Action Blocked" notification. These are usually **temporary** at first (lasting 24-48 hours). If you see this, stop all automation immediately and wait before resuming with longer delays.

---

### 📥 Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `usernames` | array | **Yes** | List of Instagram usernames (e.g., `["user1", "user2"]`). |
| `message` | string | **Yes** | The message to send. Supports spintax: `{Hi|Hey} {there|friend}!`. |
| `cookies` | string | Optional* | Your Instagram cookies in JSON format. |
| `sessionId` | string | Optional* | Your Instagram `sessionid` value. |
| `min_delay` | integer | No | Minimum delay in seconds between messages (Default: 90). |
| `max_delay` | integer | No | Maximum delay in seconds between messages (Default: 180). |
| `proxy` | string | No | Your proxy URL (e.g., `http://user:pass@host:port`). |

*\*Either `cookies` or `sessionId` is required for authentication.*

---

### 📤 Output Data

The Actor provides a detailed report of the operation in the following format:

```json
{
  "success": true,
  "total_sent": 15,
  "total_failed": 1,
  "sent_items": [
    {
      "username": "recipient_user",
      "status": "success",
      "timestamp": "2026-03-31T01:15:00Z"
    }
  ],
  "errors": []
}
````

***

### 🌐 SEO Keywords

Instagram Bulk DM, Instagram Automation, IG DM Bot, Send Instagram Messages, Instagram Marketing, Instagram outreach tool, automated DM sender, Instagram cookie login.

***

### 📄 Disclaimer

This tool is for educational and marketing outreach purposes only. Use it responsibly and comply with Instagram's [Terms of Service](https://help.instagram.com/581066165581870). We are not responsible for any account restrictions or bans resulting from the use of this software.

# Actor input Schema

## `cookies` (type: `string`):

Instagram cookies exported from your browser in JSON format. You can export cookies using a browser extension. Paste the entire JSON array here.

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

List of Instagram usernames, direct thread URLs (e.g., https://www.instagram.com/direct/t/17847593121604684), or thread IDs (e.g., 17847593121604684) to send messages to.

## `message` (type: `string`):

Message to send. You can use {option1|option2|option3} syntax for random variations. Example: 'Hey {there|hi}!'

## `min_delay` (type: `integer`):

Minimum delay between sending messages (in seconds). Recommended: 60-120 seconds to avoid rate limits.

## `max_delay` (type: `integer`):

Maximum delay between sending messages (in seconds). Recommended: 120-300 seconds.

## `save_session` (type: `boolean`):

Whether to save the authenticated session for future use.

## Actor input object example

```json
{
  "usernames": [
    "username1",
    "https://www.instagram.com/direct/t/17847593121604684",
    "17847593121604684"
  ],
  "message": "Hey [firstname] {hola|hi|hello}, how are you {doing|feeling} today?",
  "min_delay": 90,
  "max_delay": 180,
  "save_session": true
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `all_items` (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 = {
    "usernames": [
        "username1",
        "https://www.instagram.com/direct/t/17847593121604684",
        "17847593121604684"
    ],
    "message": "Hey [firstname] {hola|hi|hello}, how are you {doing|feeling} today?"
};

// Run the Actor and wait for it to finish
const run = await client.actor("api402/ig-bulk-dm").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 = {
    "usernames": [
        "username1",
        "https://www.instagram.com/direct/t/17847593121604684",
        "17847593121604684",
    ],
    "message": "Hey [firstname] {hola|hi|hello}, how are you {doing|feeling} today?",
}

# Run the Actor and wait for it to finish
run = client.actor("api402/ig-bulk-dm").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 '{
  "usernames": [
    "username1",
    "https://www.instagram.com/direct/t/17847593121604684",
    "17847593121604684"
  ],
  "message": "Hey [firstname] {hola|hi|hello}, how are you {doing|feeling} today?"
}' |
apify call api402/ig-bulk-dm --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=api402/ig-bulk-dm",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "IG Bulk DM",
        "description": "Boost your Instagram outreach with the Instagram Bulk DM Sender. This powerful Apify Actor allows you to send personalized direct messages to multiple Instagram users automatically. Designed for efficiency, account safety, it supports message randomization and smart delays to mimic human behavior.",
        "version": "0.0",
        "x-build-id": "jrnSpPuZvvh3bkaB9"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/api402~ig-bulk-dm/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-api402-ig-bulk-dm",
                "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/api402~ig-bulk-dm/runs": {
            "post": {
                "operationId": "runs-sync-api402-ig-bulk-dm",
                "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/api402~ig-bulk-dm/run-sync": {
            "post": {
                "operationId": "run-sync-api402-ig-bulk-dm",
                "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": [
                    "usernames",
                    "message"
                ],
                "properties": {
                    "cookies": {
                        "title": "Instagram Cookies (JSON)",
                        "type": "string",
                        "description": "Instagram cookies exported from your browser in JSON format. You can export cookies using a browser extension. Paste the entire JSON array here."
                    },
                    "usernames": {
                        "title": "Target Usernames / Direct Thread Links",
                        "type": "array",
                        "description": "List of Instagram usernames, direct thread URLs (e.g., https://www.instagram.com/direct/t/17847593121604684), or thread IDs (e.g., 17847593121604684) to send messages to.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "message": {
                        "title": "Message Template",
                        "type": "string",
                        "description": "Message to send. You can use {option1|option2|option3} syntax for random variations. Example: 'Hey {there|hi}!'"
                    },
                    "min_delay": {
                        "title": "Minimum Delay (seconds)",
                        "minimum": 30,
                        "type": "integer",
                        "description": "Minimum delay between sending messages (in seconds). Recommended: 60-120 seconds to avoid rate limits.",
                        "default": 90
                    },
                    "max_delay": {
                        "title": "Maximum Delay (seconds)",
                        "minimum": 60,
                        "type": "integer",
                        "description": "Maximum delay between sending messages (in seconds). Recommended: 120-300 seconds.",
                        "default": 180
                    },
                    "save_session": {
                        "title": "Save Session",
                        "type": "boolean",
                        "description": "Whether to save the authenticated session for future use.",
                        "default": true
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
