# Discord Member Scraper (`louisdeconinck/discord-member-scraper`) Actor

Get a list of all members in a Discord server, with detailed profile information such as social media profiles, name, bio & avatar. Perfect for analytics, lead generation, and community insights. Efficient, reliable, and up-to-date.

- **URL**: https://apify.com/louisdeconinck/discord-member-scraper.md
- **Developed by:** [Louis Deconinck](https://apify.com/louisdeconinck) (community)
- **Categories:** Lead generation, Social media
- **Security:** Full permissions
- **Stats:** 459 total users, 2 monthly users, 93.8% runs succeeded, 12 bookmarks
- **User rating**: 4.37 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

Get a list of all members in a Discord server, including detailed user profile information. This is the most complete & easiest way to get a list of all members in a server.

### ✨ Features

- **Complete Member Data**: Extract detailed member information including:
  - User profiles and IDs
  - Role assignments
  - Connected (social media) accounts
  - Premium status
  - User avatars and banners
- **Multiple Collection Methods**: Uses three different approaches to maximize member discovery:
  - Member list collection
  - Role-based collection
  - Message history analysis
- **Clean JSON Output**: Results in easily parseable JSON format

### 💡 Use Cases

- **Lead Generation**: Get a list of all members in a server with social media handles
- **Server Analytics**: Track member composition and roles
- **Community Insights**: Analyze member profiles and engagement
- **Role Distribution**: Understand how roles are assigned across members
- **Member Discovery**: Comprehensive member list extraction
- **Profile Analysis**: Get detailed member profile information

### 📊 Output Format

The scraper provides detailed member data in JSON format with the following fields:

- `user`: Discord user profile information
  - `id`: User ID
  - `username`: Username handle
  - `global_name`: Global name, display name
  - `avatar`: Avatar URL segement, complete image URL: `https://cdn.discordapp.com/avatars/{user.id}/{user.avatar}`
  - `avatar_decoration_data`: Avatar decoration data
  - `discriminator`: Discriminator
  - `public_flags`: Public flags
  - `primary_guild`: Primary guild
  - `clan`: Clan
  - `flags`: Flags
  - `banner`: Banner URL
  - `banner_color`: Banner color
  - `accent_color`: Accent color
  - `bio`: Bio
- `connected_accounts`: Connected (social media) accounts
- `premium_since`: Premium status
- `premium_type`: Premium type
- `premium_guild_since`: Premium server since
- `profile_themes_experiment_bucket`: Profile themes experiment bucket
- `user_profile`: User profile information
- `badges`: Badges
- `guild_badges`: Server badges
- `mutual_guilds`: Mutual servers
- `legacy_username`: Legacy username

```json
{
  "user": {
    "id": "636370983460274219",
    "username": "sauain",
    "global_name": "Saurav Jain",
    "avatar": "6a6cb07c7deaace0278061593f8979c0",
    "avatar_decoration_data": null,
    "discriminator": "0",
    "public_flags": 64,
    "primary_guild": null,
    "clan": null,
    "flags": 64,
    "banner": null,
    "banner_color": null,
    "accent_color": null,
    "bio": "23 yo, Male, Indian \n\nDeveloper Community Manager"
  },
  "connected_accounts": [
    {
      "type": "spotify",
      "id": "31mqywy6cbgugrspa4oskq75an2u",
      "name": "Saurav Jain",
      "verified": true
    },
    {
      "type": "twitter",
      "id": "1401210504354304000",
      "name": "Sauain",
      "verified": true
    },
    {
      "type": "youtube",
      "id": "UCSHZW0jTfvy9uKiFZgPa3XA",
      "name": "Saurav Jain",
      "verified": true
    }
  ],
  "premium_since": null,
  "premium_type": 0,
  "premium_guild_since": null,
  "profile_themes_experiment_bucket": 4,
  "user_profile": {
    "bio": "23 yo, Male, Indian \n\nDeveloper Community Manager",
    "accent_color": null,
    "pronouns": "he/him"
  },
  "badges": [
    {
      "id": "hypesquad_house_1",
      "description": "HypeSquad Bravery",
      "icon": "8a88d63823d8a71cd5e390baa45efa02",
      "link": "https://discord.com/settings/hypesquad-online"
    },
    {
      "id": "legacy_username",
      "description": "Originally known as sauain#0354",
      "icon": "6de6d34650760ba5551a79732e98ed60"
    }
  ],
  "guild_badges": [],
  "mutual_guilds": [
    {
      "id": "801163717915574323",
      "nick": null
    }
  ],
  "legacy_username": "sauain#0354"
}
```

### 🛠️ Configuration Options

| Parameter | Type | Description |
|-----------|------|-------------|
| serverIds | Array | Array of Discord server IDs to scrape |
| authToken | String | Your Discord authorization token (required) |
| maxMessagesPerChannel | Integer | Optional limit on messages to scan per channel for member discovery |

The scraper automatically handles:

- Rate limiting
- Multiple collection methods
- Permission checking
- Retries on failure

#### 🔑 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](https://chromewebstore.google.com/detail/discord-get-user-token/accgjfooejbpdchkfpngkjjdekkcbnfd)
- [Discord Token Copier](https://chromewebstore.google.com/detail/discord-token-copier/cjgcelbbplccacdaebbppahalhfmmheb)
- [Discord Copy Token](https://chromewebstore.google.com/detail/Discord%20Copy%20Token/cnfnhlmddjhmomcgilpblcdhbgjkadjd)

##### 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 member information from large servers
- Get structured, analyzable member data
- Track server growth and composition
- Generate insights about your community

### ⚙️ Workings

As there is no way to get a list of all members in a server. We use a combination of methods to get as a complete list of members as possible. All other scrapers rely at most on one of these methods and are thus a lot less complete.

1. **Member List Connection**: Uses Discord's Web Socket Gateway to extract an extensive initial list of members.
2. **Role-Based Collection**: We go through each role in the server and extract up to a 100 members from eachrole.
3. **Message Analysis**: Scans message history on all public text channels to find authors and users mentioned in the messages.

The scraper respects Discord's rate limits and includes automatic retries for failed requests. All data is processed and returned in a clean, structured JSON format that preserves complete member information including profiles, roles, and connected accounts.

### 🔒 Privacy & Compliance

- Only accesses servers you have permission to view
- Requires valid Discord authentication
- Respects Discord's rate limits
- Collected data is only accessible to you

### 💪 Why Choose This Scraper?

- **Comprehensive**: Uses multiple methods to maximize member discovery
- **Efficient**: Optimized to handle large servers
- **Detailed**: Captures complete member profiles and metadata
- **Reliable**: Built on Apify's robust infrastructure
- **Up-to-date**: Maintained and updated regularly

Ready to analyze your Discord server members? Start scraping now! 🚀

# Actor input Schema

## `serverIds` (type: `array`):

Discord server IDs. It's the first part of the URL: `https://discord.com/channels/801163717915574323/1206131794261315594` in this case the server ID is `801163717915574323`. You can also extract it from the invite link: `https://discord.gg/crawlee-apify-801163717915574323`.

## `authToken` (type: `string`):

Your Discord authorization token. Paste this JavaScript code in the browser console when logged into Discord to get it: `webpackChunkdiscord_app.push([[Symbol()],{},e=>{t=Object.values(e.c).find(x=>x?.exports?.default?.getToken)?.exports?.default?.getToken();console.log(t);copy(t);}]);`

## `maxMessagesPerChannel` (type: `integer`):

Maximum number of messages to scrape per channel

## Actor input object example

```json
{}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("louisdeconinck/discord-member-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("louisdeconinck/discord-member-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call louisdeconinck/discord-member-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,louisdeconinck/discord-member-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/5YzWRjSw4GQjUeaUX/builds/T7F8tJuiwx97kVcAp/openapi.json
