OrbTop

Discord Message Scraper

AUTOMATIONOTHER

Discord Message Scraper

Extract message history and channel data from Discord servers. Returns full message content, author info, timestamps, attachments, and embeds — from a single channel or every text channel in a guild. Supports cursor-based pagination and automatic resume between runs.


Discord Message Scraper Features

  • Scrape messages from any channel your token has access to, with configurable limits
  • Bulk-scrape all text channels in a guild in a single run
  • List all channels in a guild with metadata (type, name, permissions, position)
  • Resume where you left off — cursors are saved automatically between runs, so scheduled jobs only fetch new messages
  • Paginate forward or backward through message history using before or after cursors
  • Pure API scraping — no browser, no proxies, 128MB memory default. Runs are cheap.
  • Clear error messages for invalid tokens, inaccessible channels, and rate limits — no cryptic stack traces

What Can You Do With Discord Data?

  • Community analysts — Track conversation volume, active users, and engagement patterns across channels
  • Compliance teams — Archive message history for audit trails or regulatory requirements
  • Researchers — Collect discussion data for sentiment analysis, topic modeling, or discourse studies
  • Server admins — Back up important channels before restructuring or archiving a server
  • Lead gen teams — Monitor niche Discord communities for market signals and prospect identification
  • AI/ML engineers — Build training datasets from public Discord conversations

How Discord Message Scraper Works

  1. Provide a channel ID, your Discord token, and pick an action (scrape messages, list channels, or bulk-scrape a guild).
  2. The scraper hits Discord's API directly, paginates through results, and saves a cursor so your next run picks up where this one stopped.
  3. Output lands in the Apify dataset as structured JSON — one object per message or channel.

Input

Scrape messages from a channel

{
  "action": "Scrape Messages",
  "channelId": "1206131794261315594",
  "token": "YOUR_DISCORD_TOKEN",
  "limit": 1000,
  "cursorType": "after"
}

List all channels in a guild

{
  "action": "Scrape Channel List for Guild",
  "channelId": "1206131794261315594",
  "token": "YOUR_DISCORD_TOKEN"
}

Bulk-scrape all text channels in a guild

{
  "action": "Scrape Messages for Guild",
  "channelId": "1206131794261315594",
  "token": "YOUR_DISCORD_TOKEN",
  "limit": 500
}

Scrape every thread inside a forum channel

Forum channels (Discord channel type 15) hold posts as threads, not regular messages. Point this action at the forum channel ID; the scraper lists active + archived public threads, then pulls messages from each one.

{
  "action": "Scrape Forum Channel",
  "channelId": "1206131794261315594",
  "token": "YOUR_DISCORD_TOKEN",
  "limit": 100,
  "maxThreadsPerForum": 25
}

Each output message is decorated with thread_id, thread_name, and parent_forum_id so you can group results by post or by forum without a second API call.

Field Type Required Default Description
action string Yes "Scrape Messages", "Scrape Channel List for Guild", "Scrape Messages for Guild", or "Scrape Forum Channel"
channelId string Yes Numeric Discord channel ID. Not a URL — find it in Discord's developer mode settings.
token string Yes Discord user or bot token. Stored securely, never logged.
limit integer No 100 Maximum messages to fetch (per channel/thread).
cursorType string No "after" Pagination direction: "before" (older messages) or "after" (newer messages).
cursor string No null Message ID to start from. Usually handled automatically via saved cursors.
maxThreadsPerForum integer No 25 Only used by "Scrape Forum Channel". Cap on threads pulled from the forum. 0 = unlimited.

Discord Message Scraper Output Fields

Scrape Messages

Each message is a full Discord message object with all metadata intact.

{
  "id": "1168007238766559311",
  "type": 0,
  "content": "Give me a fun picture",
  "channel_id": "1143396487057899611",
  "timestamp": "2023-10-29T02:03:46.247000+00:00",
  "edited_timestamp": null,
  "author": {
    "id": "936929561302675456",
    "username": "Midjourney Bot",
    "global_name": null,
    "bot": true
  },
  "attachments": [],
  "embeds": [],
  "mentions": [],
  "mention_roles": [],
  "pinned": false,
  "tts": false,
  "flags": 0
}
Field Type Description
id string Unique message snowflake ID
content string Message text content
channel_id string Channel the message belongs to
timestamp string ISO 8601 timestamp
edited_timestamp string|null When the message was last edited, if ever
author object Author with id, username, global_name, bot flag
attachments array Files attached to the message (images, documents, etc.)
embeds array Rich embeds (links, media previews)
mentions array Users mentioned in the message
mention_roles array Roles mentioned
pinned boolean Whether the message is pinned
tts boolean Text-to-speech flag
flags integer Discord message flags bitmask

Scrape Channel List for Guild

{
  "id": "1143396487057899613",
  "type": 0,
  "name": "general",
  "guild_id": "1143396486411984942",
  "parent_id": "1143396487057899611",
  "position": 0,
  "nsfw": false,
  "rate_limit_per_user": 0,
  "permission_overwrites": []
}
Field Type Description
id string Channel snowflake ID
type integer Channel type (0 = text, 2 = voice, 4 = category, etc.)
name string Channel name
guild_id string Parent guild ID
parent_id string|null Parent category channel ID
position integer Display position in the channel list
nsfw boolean Whether the channel is marked NSFW
permission_overwrites array Permission override objects

FAQ

How do I scrape Discord messages?

Discord Message Scraper takes a channel ID and your Discord token, then fetches messages via Discord's API. Set the action to "Scrape Messages", provide the channel ID (the numeric one — right-click the channel in Discord with developer mode on), and set a limit. The scraper handles pagination automatically.

How much does Discord Message Scraper cost?

Discord Message Scraper charges $0.0003 per message scraped and $0.0003 per channel scraped. A run that fetches 1,000 messages costs about $0.30. There is no monthly fee — you pay only for what you scrape.

Can I scrape an entire Discord server?

Discord Message Scraper supports guild-wide scraping. Set the action to "Scrape Messages for Guild" and provide any channel ID from that server. The scraper discovers all text channels in the guild and fetches messages from each one, up to your configured limit per channel. Each output record is a single message (with its channel_id field intact) — flat output makes downstream processing identical to the single-channel scrape.

Can I scrape Discord forum channels?

Yes. Set the action to "Scrape Forum Channel" and pass the forum channel ID. The scraper lists every active and archived public thread under that forum, then pulls messages from each thread up to your configured limit. Use maxThreadsPerForum to cap how many posts get scraped (defaults to 25). Each output message is tagged with thread_id, thread_name, and parent_forum_id.

Does Discord Message Scraper handle pagination automatically?

Discord Message Scraper saves a cursor after every run. On the next run with the same channel ID and token, it picks up from where it left off — no manual cursor management needed. This makes it straightforward to set up scheduled runs that only fetch new messages.

What happens if my token is invalid or I don't have channel access?

Discord Message Scraper validates your input and returns clear error messages. An expired token gets "Invalid or expired Discord token." A channel you can't access gets "Access denied to channel [id]." These appear in your dataset output instead of a cryptic crash, which is more than most scrapers offer.


Need More Features?

Need date filtering, attachment downloads, or DM scraping? File an issue or get in touch.

Why Use Discord Message Scraper?

  • Pay per message — No monthly subscription. 1,000 messages cost $0.30. Scale up or down without commitment.
  • Automatic resume — Cursor management is built in. Scheduled runs fetch only new messages, which means you're not paying to re-scrape the same data.
  • Clean errors — Bad tokens and inaccessible channels return human-readable messages in your dataset, not stack traces and FAILED status codes.

Which Discord actor do I need?

  • Want to scrape messages from a channel, forum, or whole guild? You're in the right place — keep reading.
  • Want to scrape the member list of a Discord server? Use Discord Member Scraper — extracts usernames, roles, join dates, and nicknames with optional role and join-date filters.
  • Want to find Discord servers in a niche (no token needed)? Use Discord Server Directory Scraper — pulls public server listings from discord.com/servers, discord.me, and top.gg.