Discord Message Scraper

Discord Message Scraper

by louisdeconinck

Effortlessly extract and analyze complete message histories from channels and DMs. Gain insights into community engagement, track communication patter...

21,611 runs
125 users
Try This Actor

Opens on Apify.com

About Discord Message Scraper

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!

What does this actor do?

Discord Message Scraper is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.

Key Features

  • Cloud-based execution - no local setup required
  • Scalable infrastructure for large-scale operations
  • API access for integration with your applications
  • Built-in proxy rotation and anti-blocking measures
  • Scheduled runs and webhooks for automation

How to Use

  1. Click "Try This Actor" to open it on Apify
  2. Create a free Apify account if you don't have one
  3. Configure the input parameters as needed
  4. Run the actor and download your results

Documentation

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 identifier - content - The message text contents - type - Message type (0 for normal messages) - channel_id - ID of the channel where the message was sent - author - Detailed information about the message sender: - id - User's Discord ID - username - User's display name - global_name - User's global display name - discriminator - User's discriminator - avatar - 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 files - embeds - Array of rich embeds in the message - mentions - Array of mentioned users - mention_roles - Array of mentioned roles - pinned - Whether the message is pinned - mention_everyone - Whether the message mentions @everyone/@here - flags - Message flags (e.g., crossposted, urgent, etc.) - components - Message components (buttons, select menus, etc.) Example output: json { "type": 0, "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. โค๏ธ", "mentions": [], "mention_roles": [], "attachments": [], "embeds": [], "timestamp": "2024-02-12T12:32:13.826000+00:00", "edited_timestamp": null, "flags": 0, "components": [], "id": "1206578509569593364", "channel_id": "1206131794261315594", "author": { "id": "636370983460274219", "username": "sauain", "avatar": "6a6cb07c7deaace0278061593f8979c0", "discriminator": "0", "public_flags": 64, "flags": 64, "banner": null, "accent_color": null, "global_name": "Saurav Jain", "avatar_decoration_data": null, "banner_color": null, "clan": null, "primary_guild": null }, "pinned": false, "mention_everyone": true, "tts": false } ## ๐Ÿ› ๏ธ 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 1. Go to Discord and make sure you are logged in: https://discord.com/channels/@me 2. 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' 3. Go to the 'Console' tab 4. Paste the following code: javascript webpackChunkdiscord_app.push([[Symbol()],{},e=>{t=Object.values(e.c).find(x=>x?.exports?.default?.getToken)?.exports?.default?.getToken();console.log(t);copy(t);}]); 5. Press 'Enter' 6. 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. - Discord Get User Token - Discord Token Copier - Discord Copy Token #### Developer Tools: Network Tab 1. Go to Discord and make sure you are logged in: https://discord.com/channels/@me 2. 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' 3. Go to the 'Network' tab 4. Click on the 'Fetch/XHR' tab 5. Refresh the page 6. Look for a request with the name '@me' 7. Find the 'Authorization' header in the 'Request Headers' section 8. Copy the token value associated with 'Authorization' ## ๐Ÿš€ Getting Started 1. Obtain your Discord authentication token 2. Gather the channel URLs you want to scrape 3. 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! ๐Ÿš€

Common Use Cases

Market Research

Gather competitive intelligence and market data

Lead Generation

Extract contact information for sales outreach

Price Monitoring

Track competitor pricing and product changes

Content Aggregation

Collect and organize content from multiple sources

Ready to Get Started?

Try Discord Message Scraper now on Apify. Free tier available with no credit card required.

Start Free Trial

Actor Information

Developer
louisdeconinck
Pricing
Paid
Total Runs
21,611
Active Users
125
Apify Platform

Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.

Learn more about Apify

Need Professional Help?

Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.

Find a Specialist

Trusted by millions | Money-back guarantee | 24/7 Support