VOOZH about

URL: https://apify.com/khadinakbar/discord-message-scraper

⇱ Discord Message Scraper β€” Channel & DM Messages API Β· Apify


Pricing

from $0.50 / 1,000 message scrapeds

Go to Apify Store

Discord Message Scraper

Scrape Discord channel & DM messages via the official API with your own bot or user token β€” content, author, timestamps, attachments, reactions, replies. HTTP-only, MCP-ready.

Pricing

from $0.50 / 1,000 message scrapeds

Rating

0.0

(0)

Developer

πŸ‘ Khadin Akbar

Khadin Akbar

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

1

Monthly active users

a day ago

Last modified

Share

Scrape Discord channel and DM messages through the official Discord REST API using your own bot token (recommended) or user token. Returns clean, flat, MCP-ready records β€” message content, author, timestamps, attachments, reactions, replies, and a direct jump link β€” with no browser, no proxy, and official-API-grade reliability.

Built for community managers, moderators, researchers, and AI agents that need structured Discord message history out of channels they have access to.

What it does

You supply a Discord token and one or more channel IDs (or channel URLs). The actor pages through each channel's message history newest-first via GET /channels/{id}/messages, applies your filters, and writes one record per message to the dataset. It handles Discord rate limits (429 back-off), resumable pagination, and date/message-ID ranges.

When to use it

  • Export a channel's full message history for analysis, backup, or compliance.
  • Pull messages from a date range or since a known message ID (incremental scrapes).
  • Collect messages from a specific user, containing a keyword, or with attachments.
  • Feed structured Discord conversation data to an LLM/agent via Apify MCP.

When NOT to use it: for server size, member counts, channel lists, or emoji metadata (no auth needed), use the companion Discord All-in-One Scraper. This actor reads message content, which Discord always gates behind a token.

Output

One record per message. Example (detailed format):

{
"messageId":"1180000000000000000",
"channelId":"112233445566778899",
"channelName":"general",
"guildId":"998877665544332211",
"authorId":"223344556677889900",
"authorUsername":"jdoe",
"authorGlobalName":"John",
"authorIsBot":false,
"content":"gm everyone, the giveaway starts now!",
"timestamp":"2024-03-01T12:00:00.000Z",
"editedTimestamp":null,
"messageType":"default",
"isPinned":false,
"mentionsEveryone":true,
"attachmentCount":1,
"embedCount":0,
"reactionCount":12,
"replyToMessageId":null,
"jumpUrl":"https://discord.com/channels/998877665544332211/112233445566778899/1180000000000000000",
"mentionedUserIds":["223344556677889900"],
"attachments":[{"url":"https://cdn.discordapp.com/...","filename":"banner.png","size":84211,"contentType":"image/png","width":1200,"height":630,"isImage":true}],
"reactions":[{"emoji":"πŸ”₯","emojiId":null,"count":12}],
"stickerNames":[]
}
FieldTypeDescription
messageIdstringDiscord message snowflake ID
channelId / channelNamestringSource channel ID and name
guildIdstring | nullServer ID (null for DMs)
authorId / authorUsername / authorGlobalNamestringAuthor identity
authorIsBotbooleanWhether the author is a bot
contentstringRaw message text
timestamp / editedTimestampISO 8601Sent / last-edited time
messageTypestringdefault, reply, thread_starter, …
isPinned / mentionsEveryonebooleanMessage flags
attachmentCount / embedCount / reactionCountintegerCounts
replyToMessageIdstring | nullParent message for replies
jumpUrlstringDirect link to the message
mentionedUserIds, attachments[], reactions[], stickerNames[]arrayPresent in detailed format only

Choose concise response format to drop the arrays and keep only counts β€” a smaller, token-efficient payload for LLM/agent use.

Pricing

Pay-per-event (plus optional pay-per-usage):

EventPrice
Actor start$0.00005
Message scraped$0.0005 / message

Cost is roughly channels Γ— maxMessagesPerChannel Γ— $0.0005. Scraping 1,000 messages costs about $0.50. The actor logs the upper-bound cost before it starts charging.

How to get a Discord bot token (recommended)

  1. Go to discord.com/developers/applications β†’ New Application.
  2. Open the Bot tab β†’ Reset Token β†’ copy the token. Paste it into the Discord token input (it is stored as a secret).
  3. Under Bot β†’ Privileged Gateway Intents, enable Message Content Intent.
  4. Open OAuth2 β†’ URL Generator, tick bot scope and the View Channels + Read Message History permissions, open the generated URL, and add the bot to your server.
  5. Enable Developer Mode in Discord (Settings β†’ Advanced), right-click a channel β†’ Copy Channel ID, and paste it into channels.

Keep Token type = Bot (the default).

User tokens

Setting Token type = User lets the actor read any channel/DM the account can already see, without adding a bot. This is self-botting and violates Discord's Terms of Service β€” it can get the account banned. Use only on accounts you accept that risk for.

Input example

{
"discordToken":"YOUR_BOT_TOKEN",
"tokenType":"bot",
"channels":["112233445566778899"],
"maxMessagesPerChannel":500,
"afterDate":"2024-01-01",
"filterContains":"giveaway",
"responseFormat":"detailed"
}

Run via API

curl-X POST "https://api.apify.com/v2/acts/khadinakbar~discord-message-scraper/runs?token=APIFY_TOKEN"\
-H"Content-Type: application/json"\
-d'{ "discordToken": "YOUR_BOT_TOKEN", "channels": ["112233445566778899"], "maxMessagesPerChannel": 200 }'

Use with AI agents (MCP)

This actor is MCP-ready. Connect via https://mcp.apify.com?tools=khadinakbar/discord-message-scraper and an agent can call it with a channel ID and token, receiving structured JSON it can reason over directly. Use responseFormat: "concise" to minimize token usage.

Tips & behavior

  • Threads: pass a thread's own channel ID in channels to scrape its messages.
  • Resuming: save the oldest messageId you received and pass it as beforeMessageId next run; or use afterMessageId to fetch only newer messages.
  • Inaccessible channels (bot not in server, missing Read Message History, or deleted) are skipped with a warning. If every channel is inaccessible, the run fails with a clear message rather than returning an empty success.
  • Filters (filterContains, filterFromUserId, onlyWithAttachments) are applied after fetching, so the per-channel cap counts post-filter results.

FAQ

Do I need a bot token? Yes β€” Discord requires authentication to read messages. A bot token is the legitimate path. User tokens work but violate Discord TOS.

Does it need a proxy? No. Discord rate-limits per token, not per IP, so the actor talks directly to the API with no proxy cost.

How fast is it? Up to ~100 messages per API request, throttled to respect Discord's rate limits. Expect a few thousand messages per minute per token.

Can it read DMs? With a user token, yes β€” pass the DM channel ID. Bot tokens cannot read user DMs.

Will it get blocked? No anti-bot is involved; it's the official API. The only failure modes are an invalid token (401) or a channel the token can't access (403/404).

Legal & compliance

This actor accesses Discord only with credentials you provide, for channels you have permission to read. You are responsible for complying with Discord's Terms of Service, Developer Terms, applicable privacy laws (e.g. GDPR), and any server rules. Scrape only data you are authorized to access. User-token (self-bot) usage violates Discord's Terms of Service; the bot-token path is recommended. This tool is provided for legitimate moderation, backup, research, and analytics use.

Related actors

You might also like

Discord Message Scraper

jungle_synthesizer/discord-message-scraper

Scrape messages from Discord channels

πŸ‘ User avatar

BowTiedRaccoon

223

Discord Channel Messages Scraper

felt/discord-message-scraper

Scraping messages from Discord channels.

Discord Scraper (Members and Messages)

curious_coder/discord-data-scraper

Scrape discord server members and messages with attachments from any channel.

1.2K

4.6

Discord Message Scraper

harvestedge/discord-message-scraper

Scrape Discord messages effortlessly with this Apify actor. Extract channel data, attachments, and embeds with customizable settings. Try now!

10

Discord Message Sentiment

harvestedge/discord-message-sentiment

The Discord Message Sentiment Scraper collects message data β€” including text, embeds, attachments, reactions, and mentions β€” from any channel and performs real-time sentiment analysis. Perfect for lead generation, data analysis, and marketing.

Discord Lead Scraper

scrapapi/discord-lead-scraper

Discord MCP Server

bhansalisoft/discord-mcp-server

Discord MCP Server unique tool for integration Discord tools into AI based automation.

Discord Bot Poster

alizarin_refrigerator-owner/discord-poster

Send automated messages to Discord servers using your bot token. Perfect for announcements, scheduled posts, community updates, and marketing automation. Simple Messages, Rich Embeds, Multi-Channel, Mentions, Batch Messaging & Validation Mode