# Twitter Auto DM API | Bulk Direct Message Sender & Automation (`fastcrawler/twitter-auto-dm-api-bulk-direct-message-sender-automation`) Actor

Automate Twitter direct messages (DMs) at scale without needing an official Twitter Developer account. The perfect API for marketing outreach, bulk messaging, and user engagement. Send automated DMs seamlessly, fast, and reliably.

- **URL**: https://apify.com/fastcrawler/twitter-auto-dm-api-bulk-direct-message-sender-automation.md
- **Developed by:** [fastcrawler](https://apify.com/fastcrawler) (community)
- **Categories:** Social media
- **Stats:** 29 total users, 6 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 1.00 out of 5 stars

## Pricing

$25.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

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

## Twitter Auto DM API | Bulk Direct Message Sender & Automation

Automate your Twitter (X) direct messages at scale **without needing an official Twitter Developer account or API access**. 

Built for marketing outreach, bulk messaging, and audience engagement, this ultimate DM automation tool empowers you to scale your communication seamlessly, safely, and affordably.

---

### ✨ Key Features & Benefits

* 🚫 **No API Key or Dev Account Needed:** Works directly with your logged-in account sessions. Bypass official API restrictions instantly.
* 💰 **Unbeatable Value:** Flat **$10/month** for unlimited usage (fair-use pacing included). No hidden per-message costs.
* 📦 **Bulk Outreach Ready:** Import CSV or TXT lists of usernames/user IDs for automated, sequential batch messaging.
* 🔄 **Multi-Account Rotation:** Provide multiple `cookie` sets. The tool automatically rotates them for continuous messaging and to prevent rate limits.
* 📎 **Rich Media Support:** Make your DMs stand out by sending text alongside image or video attachments (via URL).
* 🛡️ **Safe & Reliable:** Built-in human-like delays, randomized pacing, and duplicate-checking to protect your accounts from bans.

---

### 🚀 Input Parameters

| Field | Type | Description |
| :--- | :--- | :--- |
| **`cookie`** | String | Your Twitter session cookies (supports multiple). Used for secure authentication. |
| **`recipient`** | String | The target Twitter username, user ID, or full profile URL. |
| **`message`** | String | The text content of your direct message. |
| **`mediaUrl`** | String | *(Optional)* Direct URL of an image or video to attach to the DM. |
| **`listFile`** | String | *(Optional)* URL to a CSV or TXT file containing multiple recipients for bulk sending. |

---

### 🔑 How to Get Your Twitter `cookie`

A cookie acts as your browser session token, allowing the tool to authenticate securely without API keys. 

**Quick Step-by-Step Guide:**
1. Install the [Cookie-Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) extension in your browser.
2. Log in to your Twitter/X account.
3. Open the Cookie-Editor extension and select **Export As `Headers String`**.
4. Paste the exported string into the `cookie` input field of this tool.

👉 *Need more help? Watch the [Step-by-step video guide](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie).*

---

### 🙋 Frequently Asked Questions (FAQ)

**Q: Does this tool use the official Twitter API?**
**A:** No. It simulates logged-in browser actions using your provided cookie. You do not need to apply for Twitter developer access.

**Q: Can I run multiple accounts at once?**
**A:** Yes. You can input multiple cookies from different accounts. The tool is designed to rotate through them automatically for continuous, high-volume messaging.

**Q: Can I send DMs to a large list of users?**
**A:** Yes. Simply provide a `listFile` (CSV or TXT), and the actor will process the usernames or IDs sequentially.

---

### 💸 Pricing & Plans

* **$10 / Month** — Unlimited DMs
* Includes regular updates & technical support.
* Cancel anytime.

> *Agency & enterprise packages (custom features) are available upon request.*

---

### 📬 Contact & Feature Requests

We are actively maintaining this tool. Planned enhancements include *Real-time DM monitoring*, *Message template rotation*, and *Scheduled messaging*.

Need custom features or support? Reach out to us:
* 📧 **Email:** [fastcrawler9@gmail.com](mailto:fastcrawler9@gmail.com)
* ✈️ **Telegram:** [Join Community](https://t.me/+MUMR3PKOoVVjNzE9)
* 💬 **Discord:** [Join Server](https://discord.gg/s4jyupzaWu)

# Actor input Schema

## `cookie` (type: `string`):

Cookies are used to authorize the actor with twitter 

 Follow these steps to get the cookies:

1. Install [Cookie-Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) chrome extension
2. Login to your twitter account
3. Click on the extension and Export As 'Headers String' and export the twitter cookies
4. Paste the copied contents here. 

 [how-to-get-twitter-cookie](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie)
## `username` (type: `string`):

The username of twitter you want to follow.
## `msg` (type: `string`):

The dm you want to follow.

## Actor input object example

```json
{
  "cookie": "auth_token=b07bd",
  "username": "elonmusk",
  "msg": "hello"
}
````

# 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 = {
    "cookie": "auth_token=b07bd",
    "username": "elonmusk",
    "msg": "hello"
};

// Run the Actor and wait for it to finish
const run = await client.actor("fastcrawler/twitter-auto-dm-api-bulk-direct-message-sender-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 = {
    "cookie": "auth_token=b07bd",
    "username": "elonmusk",
    "msg": "hello",
}

# Run the Actor and wait for it to finish
run = client.actor("fastcrawler/twitter-auto-dm-api-bulk-direct-message-sender-automation").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 '{
  "cookie": "auth_token=b07bd",
  "username": "elonmusk",
  "msg": "hello"
}' |
apify call fastcrawler/twitter-auto-dm-api-bulk-direct-message-sender-automation --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=fastcrawler/twitter-auto-dm-api-bulk-direct-message-sender-automation",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Twitter Auto DM API | Bulk Direct Message Sender & Automation",
        "description": "Automate Twitter direct messages (DMs) at scale without needing an official Twitter Developer account. The perfect API for marketing outreach, bulk messaging, and user engagement. Send automated DMs seamlessly, fast, and reliably.",
        "version": "0.0",
        "x-build-id": "xaO7Sd9kTVlolcbON"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/fastcrawler~twitter-auto-dm-api-bulk-direct-message-sender-automation/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-fastcrawler-twitter-auto-dm-api-bulk-direct-message-sender-automation",
                "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/fastcrawler~twitter-auto-dm-api-bulk-direct-message-sender-automation/runs": {
            "post": {
                "operationId": "runs-sync-fastcrawler-twitter-auto-dm-api-bulk-direct-message-sender-automation",
                "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/fastcrawler~twitter-auto-dm-api-bulk-direct-message-sender-automation/run-sync": {
            "post": {
                "operationId": "run-sync-fastcrawler-twitter-auto-dm-api-bulk-direct-message-sender-automation",
                "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": [
                    "cookie",
                    "username",
                    "msg"
                ],
                "properties": {
                    "cookie": {
                        "title": "Cookies: Cookies are used to authorize the actor with twitter",
                        "type": "string",
                        "description": "Cookies are used to authorize the actor with twitter \n\n Follow these steps to get the cookies:\n\n1. Install [Cookie-Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) chrome extension\n2. Login to your twitter account\n3. Click on the extension and Export As 'Headers String' and export the twitter cookies\n4. Paste the copied contents here. \n\n [how-to-get-twitter-cookie](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie)"
                    },
                    "username": {
                        "title": "username u want to follow,eg: elonmusk",
                        "type": "string",
                        "description": "The username of twitter you want to follow."
                    },
                    "msg": {
                        "title": "dm u want to send",
                        "type": "string",
                        "description": "The dm you want to follow."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
