Discord Message Scraper
by harvestedge
Scrape Discord messages effortlessly with this Apify actor. Extract channel data, attachments, and embeds with customizable settings. Try now!
Opens on Apify.com
About Discord Message Scraper
Scrape Discord messages effortlessly with this Apify actor. Extract channel data, attachments, and embeds with customizable settings. Try now!
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
- Click "Try This Actor" to open it on Apify
- Create a free Apify account if you don't have one
- Configure the input parameters as needed
- Run the actor and download your results
Documentation
π½π½π½π½π½π½π½π½π½π½π½π½π½π½π½π π½π½π½π½π½π½π½π½π½π½π½π½π½π½π½π½ # Harvest Edge / Discord Message Scraper π±π±π±π±π±π±π±π±π±π±π±π±π±π±π±π± π½π½π½π½ππ½π½π½π½ππ±π±π±π±π±π± Harvest Edge makes business information available to everyone! ## Overview Easily scrape Discord messages with the Discord Message Scraper, a powerful Apify actor designed for developers and data analysts. This actor extracts messages, attachments, embeds, reactions, and mentions from any Discord channel or guild, using the Discord API. With support for scraping in both βnewerβ and βolderβ directions and a customizable 60-second timeout, it ensures reliable data collection for analytics, research, or archiving. Feel free to contact us via Apify for feature requests or bug reports. ## How to Get Your Token - Open developer tools on your browser, by pressing F12, and go to discord.com/channels/@me - Click the 'Network' tab in the developer tools, and find the file named @me. You can filter for Fetch/XHR requests to help find it. Refresh the page if you do not see it. - Be sure you are looking at the 'Headers' of this file and scroll down to 'Request Headers' - Your token is the code that is listed as 'Authorization' ## Features - Fetches up to 10,000 messages per run from a specified Discord channel. - Supports scraping in batches, with the option of going either direction from a starting message. - Outputs detailed message data (content, author, timestamp, attachments, embeds, etc.) to an Apify dataset. - Configurable batch delay to manage Discord API rate limits. - Robust error handling with clear logs for troubleshooting. ## Performance - Execution Time: Fetching 1000 messages takes ~10 seconds (with default 1.0-second batch delay). Fetching the maximum 10,000 messages takes ~100 seconds (~1.7 minutes). - Resource Usage: Optimized for low compute unit consumption, with a maximum limit of 10,000 messages to prevent excessive resource use. ## Input The Actor accepts the following input parameters via the Apify platform: | Key | Type | Description | Default | Required | |-------------------------|--------|------------------------------------------------------------------------------------------------------------------------------|-----------------------------|----------| | guild_id | String | The ID of the Discord guild (server) containing the channel. | - | Yes | | channel_id | String | The ID of the Discord channel to fetch messages from. | - | Yes | | token | String | Your Discord user account token for authentication. Ensure compliance with Discord's Terms of Service. | - | Yes | | max_messages | Integer| Limit the number of messages to fetch (1 to 10,000). Use 100 for quick tests or up to 10,000 for large channels. | 1000 | No | | start_message_id | String | Message ID to start scraping from. For "newer", scrapes messages before this ID; for "older", scrapes messages after this ID.| - | No | | scrape_direction | String | Direction to scrape: "newer" (towards past) or "older" (towards future). | Newer | No | | batch_delay_seconds | String | Delay between batches of 100 messages (non-negative number, in seconds). Increase to 2.0 if rate limit errors occur. | 1.0 | No | ## Output The Actor outputs a dataset in JSON format with the following fields for each product: | Field | Description | |--------------------|----------------------------------------------------| | guild_id | Unique ID of the message. | | channel_id | ID of the channel. | | author | Object with author details (ID, username, discriminator, avatar, public flags). | | content | Message text content. | | timestamp | Creation timestamp (YYYY-MM-DD HH:MM:SS). | | edited_timestamp | Edit timestamp, if edited (YYYY-MM-DD HH:MM:SS). | | type | Message type (e.g., default, reply). | | attachments | Array of attachment objects (ID, filename, size, URL, etc.). | | embeds | Array of embed objects (type, URL, title, description, etc.). | | pinned | Boolean indicating if the message is pinned. | | mention_everyone | Boolean indicating if the message mentions everyone. | | tts | Boolean indicating if the message is text-to-speech. | | flags | Message flags (integer). | | components | Array of message components (e.g., buttons). | | reactions | Array of reaction objects (emoji, count, etc.). | | mentions | Array of mentioned user objects (ID, username, discriminator). | | message_reference| Object with reply details (message ID, channel ID, guild ID), if a reply. | Example Output: json { "message_id": "123456789012345678", "channel_id": "987654321098765432", "author": { "id": "111222333444555666", "username": "user", "discriminator": "1234", "avatar": "https://cdn.discordapp.com/avatars/...", "public_flags": 0 }, "content": "Hello, world!", "timestamp": "2025-10-08 14:30:00", "edited_timestamp": null, "type": 0, "attachments": [], "embeds": [], "pinned": false, "mention_everyone": false, "tts": false, "flags": 0, "components": [], "reactions": [], "mentions": [], "message_reference": null } ## Troubleshooting - Invalid Token: Ensure the token is correct and not expired. Obtain a new token if needed. - Message ID Not Found: Verify the start_message_id exists in the specified channel and is accessible. - Rate Limit Errors: Increase batch_delay_seconds to 2.0 or higher if you see HTTPException errors. - Timeout Errors: If the Actor times out after 60 seconds while fetching the starting message, check the start_message_id and network connection, or contact support for assistance. - No Messages Fetched: Ensure the channel has messages and the token has permission to read the channelβs history.
Categories
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 TrialActor Information
- Developer
- harvestedge
- Pricing
- Paid
- Total Runs
- 9
- Active Users
- 4
Related Actors
π― Tweet Scraper V2 - X / Twitter Scraper
by apidojo
Instagram Scraper
by apify
TikTok Scraper
by clockworks
Instagram Profile Scraper
by apify
Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.
Learn more about ApifyNeed Professional Help?
Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.
Trusted by millions | Money-back guarantee | 24/7 Support