# InstaReach AI - Smart Instagram DM Automation & Mass Outreach (`automation_studio/instareach-instagram-dm-automation`) Actor

Next-generation, ultra-safe Instagram Direct Message (DM) automation and cold outreach tool with multi-account rotation, smart Spintax personalization, and anti-ban protection.

- **URL**: https://apify.com/automation\_studio/instareach-instagram-dm-automation.md
- **Developed by:** [Asad Naeem](https://apify.com/automation_studio) (community)
- **Categories:** Social media, Automation, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

## 🚀 InstaReach AI - Smart Instagram DM Automation & Cold Outreach

> **Next-generation, ultra-safe Instagram Direct Message (DM) automation and cold outreach engine with multi-account rotation, smart Spintax personalization, and anti-ban humanized pacing.**

***

### 🔥 Why InstaReach AI is Superior

| Feature | Legacy Instagram Senders | **InstaReach AI** |
| :--- | :--- | :--- |
| **Deliverability Rate** | Low (~30%, high failure & action blocks) | **High Deliverability (Humanized Jitter & Anti-Ban Protection)** 🛡️ |
| **Spintax & Personalization** | Static Text (triggers spam filters) | **Full Spintax (`{Hi|Hey}`) + Dynamic Tags (`{username}`, `{name}`)** 🧠 |
| **Multi-Account Rotation** | 1 Account Only | **Multi-Account Session Pool (Round-Robin)** 👥 |
| **Session Health Validator** | Crashes on expired sessions | **Pre-Run Cookie & Auth Verification** ✅ |
| **Pacing & Safety** | Fixed intervals | **Human Typing Emulation (35s - 75s variable jitter)** ⏱️ |
| **Pricing Model** | Expensive Flat Monthly ($20–$40/mo) | **Transparent Pay-Per-Event ($0.005 / Delivered DM)** 💳 |

***

### 🛠️ How to Extract Instagram Session Cookies (1-Minute Guide)

1. Open Chrome / Brave / Edge on your computer and log in to [Instagram.com](https://www.instagram.com).
2. Install a free cookie extension like **Cookie-Editor** or **EditThisCookie**.
3. While on Instagram, click the extension icon and click **Export (JSON)** or copy the `sessionid`, `ds_user_id`, and `csrftoken` values.
4. Paste the cookies into the **Sender Accounts** input field.

***

### 🧠 Spintax & Dynamic Variable Guide

Make every single message 100% unique so Instagram's algorithm never flags your messages as automated:

```text
{Hi|Hey|Hello} {username}! {Loved your recent content|Really enjoy your profile|Great work on your page}. {Would love to connect regarding a quick question|Hope you're having a wonderful week|Let's connect soon}!
```

#### Available Dynamic Tags:

- `{username}` - Recipient's exact Instagram handle (e.g. `garyvee`).
- `{first_name}` - Recipient's first name derived from their profile.
- `{full_name}` - Recipient's full name.

***

### ⚙️ Input Configuration

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `accounts` | Array | `[...]` | JSON list of sender accounts with session cookies. |
| `targetUsernames` | Array | `["garyvee"]` | List of target Instagram handles to receive DMs. |
| `messageTemplate` | String | *Spintax template* | Message template supporting `{Hi|Hello}` and `{username}`. |
| `minDelaySeconds` | Integer | `35` | Minimum human delay between consecutive messages. |
| `maxDelaySeconds` | Integer | `75` | Maximum delay between messages (randomized jitter). |
| `maxMessagesPerAccount` | Integer | `25` | Daily safety limit per account before rotating. |
| `skipAlreadyMessaged` | Boolean | `true` | Skip users with an existing chat thread. |

***

### 📊 Sample Output Record

```json
{
  "recipient_username": "garyvee",
  "status": "DELIVERED",
  "message_sent": "Hey garyvee! Loved your recent content. Would love to connect regarding a quick question!",
  "sender_account": "outreach_lead_pro",
  "thread_id": "340282366841710300949128123456789",
  "sent_at": "2026-08-23T15:20:00.123Z"
}
```

***

### 💳 Transparent Pay-Per-Event (PPE) Pricing

| Event | Price | Description |
| :--- | :--- | :--- |
| **Actor Start** (`apify-actor-start`) | **$0.0005** | Flat initialization fee per run. |
| **Direct Message Delivered** (`apify-default-dataset-item`) | **$0.005** | Only charged for successfully delivered DMs ($5.00 / 1,000 DMs). |
| **Platform Compute Costs** | **FREE** | Compute costs are covered under the Pay-Per-Event model. |

***

*Powered by Apify Python SDK & Stealth Automation Engine.*

# Actor input Schema

## `sessionId` (type: `string`):

Your Instagram `sessionid` cookie value. Found via Cookie-Editor extension or Chrome DevTools (F12 -> Application -> Cookies).

## `csrfToken` (type: `string`):

Your Instagram `csrftoken` cookie value (Optional, auto-resolved if left empty).

## `dsUserId` (type: `string`):

Your numeric Instagram User ID from cookies (Optional).

## `additionalAccountsCookies` (type: `array`):

Want to send from multiple accounts? Add one cookie string or Cookie-Editor JSON per line. The actor will rotate through all accounts round-robin to scale safely.

## `targetUsernames` (type: `array`):

Enter the Instagram usernames to receive your direct message (one username per line, e.g. `garyvee`, `shopify`, `hubspot`).

## `messageTemplate` (type: `string`):

Write your DM template. Use **Spintax** (`{Hi|Hey|Hello}`) and **Tags** (`{username}`, `{first_name}`) to make every single DM 100% unique.

## `minDelaySeconds` (type: `integer`):

Minimum delay in seconds before sending to the next recipient (Recommended: 30s - 60s for maximum safety).

## `maxDelaySeconds` (type: `integer`):

Maximum delay in seconds between sends (random jitter between Min and Max simulates natural human typing).

## `maxMessagesPerAccount` (type: `integer`):

Maximum direct messages an individual account will send before rotating to the next account (Recommended: 20–35).

## `skipAlreadyMessaged` (type: `boolean`):

When enabled, checks if an existing conversation thread exists with the recipient and skips them to avoid duplicate outreach.

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

Use Apify Residential Proxies to protect your account IP reputation.

## Actor input object example

```json
{
  "sessionId": "YOUR_INSTAGRAM_SESSION_ID",
  "additionalAccountsCookies": [
    "sessionid=SESSION_FOR_ACCOUNT_2; ds_user_id=1234567; csrftoken=abc123",
    "sessionid=SESSION_FOR_ACCOUNT_3; ds_user_id=7654321; csrftoken=xyz789"
  ],
  "targetUsernames": [
    "garyvee",
    "hubspot",
    "shopify"
  ],
  "messageTemplate": "{Hi|Hey|Hello} {username}! {Loved your recent content|Really enjoy your profile|Great work on your page}. {Would love to connect with you regarding a quick question|Hope you're having an awesome week|Let's connect soon}!",
  "minDelaySeconds": 35,
  "maxDelaySeconds": 75,
  "maxMessagesPerAccount": 25,
  "skipAlreadyMessaged": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all delivered Instagram direct messages, delivery status, and outreach metrics

# 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 = {
    "sessionId": "YOUR_INSTAGRAM_SESSION_ID",
    "additionalAccountsCookies": [
        "sessionid=SESSION_FOR_ACCOUNT_2; ds_user_id=1234567; csrftoken=abc123",
        "sessionid=SESSION_FOR_ACCOUNT_3; ds_user_id=7654321; csrftoken=xyz789"
    ],
    "targetUsernames": [
        "garyvee",
        "hubspot",
        "shopify"
    ],
    "messageTemplate": "{Hi|Hey|Hello} {username}! {Loved your recent content|Really enjoy your profile|Great work on your page}. {Would love to connect with you regarding a quick question|Hope you're having an awesome week|Let's connect soon}!"
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation_studio/instareach-instagram-dm-automation").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 = {
    "sessionId": "YOUR_INSTAGRAM_SESSION_ID",
    "additionalAccountsCookies": [
        "sessionid=SESSION_FOR_ACCOUNT_2; ds_user_id=1234567; csrftoken=abc123",
        "sessionid=SESSION_FOR_ACCOUNT_3; ds_user_id=7654321; csrftoken=xyz789",
    ],
    "targetUsernames": [
        "garyvee",
        "hubspot",
        "shopify",
    ],
    "messageTemplate": "{Hi|Hey|Hello} {username}! {Loved your recent content|Really enjoy your profile|Great work on your page}. {Would love to connect with you regarding a quick question|Hope you're having an awesome week|Let's connect soon}!",
}

# Run the Actor and wait for it to finish
run = client.actor("automation_studio/instareach-instagram-dm-automation").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 '{
  "sessionId": "YOUR_INSTAGRAM_SESSION_ID",
  "additionalAccountsCookies": [
    "sessionid=SESSION_FOR_ACCOUNT_2; ds_user_id=1234567; csrftoken=abc123",
    "sessionid=SESSION_FOR_ACCOUNT_3; ds_user_id=7654321; csrftoken=xyz789"
  ],
  "targetUsernames": [
    "garyvee",
    "hubspot",
    "shopify"
  ],
  "messageTemplate": "{Hi|Hey|Hello} {username}! {Loved your recent content|Really enjoy your profile|Great work on your page}. {Would love to connect with you regarding a quick question|Hope you'\''re having an awesome week|Let'\''s connect soon}!"
}' |
apify call automation_studio/instareach-instagram-dm-automation --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation_studio/instareach-instagram-dm-automation"
        }
    }
}

```

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/6ObgdxgjsRZhlQ2Ej/builds/svOYZLn9fXAmqTwQm/openapi.json
