Discord Message Scraper
2 hours trial then $18.00/month - No credit card required now
Discord Message Scraper
2 hours trial then $18.00/month - No credit card required now
Effortlessly extract and analyze complete message histories from channels and DMs. Gain insights into community engagement, track communication patterns, and export valuable content—all in a clean, structured JSON format. Unlock the full potential of your Discord data with our advanced scraper!
Extract and analyze Discord channel and direct message history with ease. This scraper / API will return a comprehensive list of messages from your Discord conversations, including text content, attachments, and participant information.
✨ Features
- Complete Message History: Extract detailed message data including:
- Message content
- Sender information
- Timestamps
- Attachments and embeds
- Reactions
- Channel & DM Support: Get messages from both servers and private conversations
- Clean JSON Output: Results in easily parseable JSON format
💡 Use Cases
- Community Analysis: Track engagement and activity in Discord servers
- Data Analysis: Analyze communication patterns and chat history
- Message Search: Find specific messages across channels and DMs
- Chat Statistics: Generate insights about messaging habits
- Content Export: Save important information shared in servers
📊 Output Format
The scraper provides detailed message data in JSON format with the following fields:
id
- Unique message identifiercontent
- The message text contentstype
- Message type (0 for normal messages)channel_id
- ID of the channel where the message was sentauthor
- Detailed information about the message sender:id
- User's Discord IDusername
- User's display nameglobal_name
- User's global display namediscriminator
- User's discriminatoravatar
- Avatar hash
timestamp
- When the message was sent (ISO 8601 format)edited_timestamp
- When the message was last edited (null if never edited)attachments
- Array of attached filesembeds
- Array of rich embeds in the messagementions
- Array of mentioned usersmention_roles
- Array of mentioned rolespinned
- Whether the message is pinnedmention_everyone
- Whether the message mentions @everyone/@hereflags
- Message flags (e.g., crossposted, urgent, etc.)components
- Message components (buttons, select menus, etc.)
Example output:
1{ 2 "type": 0, 3 "content": "Hello @here 👋 \n\nWelcome to the channel dedicated for intros and chat between community members. For support go to the relevant support section.\n\nI will start with an introduction 😄\n\nI am Saurav Jain from Delhi, India. 🇮🇳 \n\nI am the Developer Community Manager at Apify. You will see my replying to everybody in the community, helping members using our products, hosting events, and much more.\n\nFeel free to tag me in your messages, would love to interact with everyone. ❤️", 4 "mentions": [], 5 "mention_roles": [], 6 "attachments": [], 7 "embeds": [], 8 "timestamp": "2024-02-12T12:32:13.826000+00:00", 9 "edited_timestamp": null, 10 "flags": 0, 11 "components": [], 12 "id": "1206578509569593364", 13 "channel_id": "1206131794261315594", 14 "author": { 15 "id": "636370983460274219", 16 "username": "sauain", 17 "avatar": "6a6cb07c7deaace0278061593f8979c0", 18 "discriminator": "0", 19 "public_flags": 64, 20 "flags": 64, 21 "banner": null, 22 "accent_color": null, 23 "global_name": "Saurav Jain", 24 "avatar_decoration_data": null, 25 "banner_color": null, 26 "clan": null, 27 "primary_guild": null 28 }, 29 "pinned": false, 30 "mention_everyone": true, 31 "tts": false 32}
🛠️ Configuration Options
Parameter | Type | Description |
---|---|---|
channelUrls | Array | Array of Discord channel URLs to scrape. Must be in format: https://discord.com/channels/SERVER_ID/CHANNEL_ID for server channels or https://discord.com/channels/@me/CHANNEL_ID for DMs |
authToken | String | Your Discord authorization token (required) |
maxMessagesPerChannel | Integer | Maximum number of messages to scrape per channel (optional, empty means unlimited) |
The scraper automatically handles:
- Rate limiting (50 requests per second)
- Pagination (fetches all messages in batches of 100)
- Retries on failure (up to 3 retries per request)
🔑 Obtaining Your Discord Authentication Token
In order for the scraper to work, you need to obtain your Discord authentication token. There are three possible ways to get it: through the Network section of the browser's Developer Tools, by pasting some JavaScript code in the browser console or through a browser extension. All three methods are described below.
The token looks something like this:
MTk4NjI0MzY5ODc1NDMyOTYw.HjKL9_.QWxZcVBnTmFsUHFaWXhDdkJyTnE2RHNqS3M0-8
Javascript Browser Console
- Go to Discord and make sure you are logged in: https://discord.com/channels/@me
- Open Developer Tools by one of these three methods:
- Press 'F12' on your keyboard
- Press 'Ctrl + Shift + I' on your keyboard (Cmd + Shift + I on Mac)
- Press '...' in the top right corner of the browser and select 'More tools' -> 'Developer tools'
- Go to the 'Console' tab
- Paste the following code:
webpackChunkdiscord_app.push([[Symbol()],{},e=>{t=Object.values(e.c).find(x=>x?.exports?.default?.getToken)?.exports?.default?.getToken();console.log(t);copy(t);}]);
- Press 'Enter'
- The token will be automatically copied to your clipboard and also printed in the console
Browser Extension Method
These are third party extensions that will get you the token. We are not affiliated with them.
Developer Tools: Network Tab
- Go to Discord and make sure you are logged in: https://discord.com/channels/@me
- Open Developer Tools by one of these three methods:
- Press 'F12' on your keyboard
- Press 'Ctrl + Shift + I' on your keyboard (Cmd + Shift + I on Mac)
- Press '...' in the top right corner of the browser and select 'More tools' -> 'Developer tools'
- Go to the 'Network' tab
- Click on the 'Fetch/XHR' tab
- Refresh the page
- Look for a request with the name '@me'
- Find the 'Authorization' header in the 'Request Headers' section
- Copy the token value associated with 'Authorization'
🚀 Getting Started
- Obtain your Discord authentication token
- Gather the channel URLs you want to scrape
- Run the actor and receive your data in JSON or CSV format
📈 Benefits
- Efficiently extract message history from multiple channels
- Get structured, analyzable conversation data
- Track community engagement and growth
- Generate insights from server activity
⚙️ Workings
The scraper uses Discord's API with your authentication token to access specified channels and DMs. It fetches message history in batches of 100 messages at a time, automatically handling pagination to retrieve the complete history. The scraper respects Discord's rate limits (50 requests per second) and includes automatic retries for failed requests. All data is processed and returned in a clean, structured JSON format that preserves the complete message context including attachments, embeds, and user information.
🔒 Privacy & Compliance
- The scraped data is only accessible to you
- Only accesses channels and DMs you have permission to view
- Requires valid Discord authentication
- Respects Discord's rate limits and terms of service
💪 Why Choose This Scraper?
- Reliable: Built on Apify's robust infrastructure
- Comprehensive: Captures all message details and metadata
- Flexible: Configurable parameters for specific needs
- Up-to-date: Maintained and updated regularly
- Support: Backed by Apify's excellent customer service
Ready to extract your Discord chat history? Start scraping now! 🚀
Actor Metrics
1 monthly user
-
1 star
Created in Jan 2025
Modified 17 hours ago