# Discord Server Discovery & Invite Scraper - Members & Links (`scrapesage/discord-public-scraper`) Actor

Scrape Discord's public server directory by keyword and category (name, description, member and online counts, badge, invite link), resolve invite links to server data (id, name, counts, boost tier, verification), read server widgets and check username availability. No token, no login.

- **URL**: https://apify.com/scrapesage/discord-public-scraper.md
- **Developed by:** [Scrape Sage](https://apify.com/scrapesage) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.65 / 1,000 server records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Discord Server Discovery & Invite Scraper - Members, Links & Usernames

Get structured data from **Discord's public surfaces without a bot token or a login**: search the **public server directory** by keyword and category (server name, description, member and online counts, Partnered / Verified badge, invite link), **resolve any invite link** to its server (id, name, description, member and online counts, boost tier, verification level, vanity URL, features), read a server's **public widget** (online members, voice channels, presence count) and **check username availability** - as JSON, CSV or Excel.

> **Why this actor exists (demand):** the Discord niche on Apify draws **~280 monthly users**, split across username checkers and server scrapers that require you to paste your own user token (against Discord's terms). This actor covers the public, keyless surfaces only - discovery, invites, widgets and usernames - so it needs no credentials and puts no account at risk.

### What you can scrape

| Section | Input | Record | What you get |
|---|---|---|---|
| **Server discovery** | keywords + optional category | `server` (`source: discovery`) | name, description, member and online counts, badge (Partnered / Verified), server id, directory URL, splash image; optionally the invite link, long "About" text and category from each server's page |
| **Invite resolver** | invite links or codes (pasted, or imported from a file) | `server` (`source: invite`) | server id, name, description, member and online counts, boost count and tier, verification and NSFW levels, vanity URL, features (VERIFIED, PARTNERED, DISCOVERABLE...), icon / banner / splash URLs, the invite's channel, inviter and expiry |
| **Server widget** | numeric server ids | `widget` | online member list (username, status, current game, avatar, voice channel), voice channels, presence count, instant-invite link - for servers that enabled the widget |
| **Username availability** | usernames | `username` | whether the username is available or taken |

Members lists, messages and anything behind a login are **deliberately out of scope**: they require a user token, which Discord's terms prohibit automating.

### Input

```json
{
  "searchQueries": ["music production", "crypto"],
  "category": "all",
  "maxServersPerQuery": 48,
  "includeServerDetails": true,
  "inviteLinks": ["https://discord.gg/python", "discord-developers"],
  "guildIdsForWidget": ["81384788765712384"],
  "usernamesToCheck": ["coolname", "another_one"],
  "maxResults": 300
}
```

Use any one section or all four in one run. Leave everything empty and the run returns a small free sample (the first 24 "music" servers in the directory).

### Example output (`server`, from an invite)

```json
{
  "type": "server",
  "source": "invite",
  "inviteCode": "python",
  "inviteUrl": "https://discord.gg/python",
  "inviteStatus": "ok",
  "id": "267624335836053506",
  "name": "Python",
  "description": "The official Python community server...",
  "memberCount": 59000,
  "onlineCount": 8400,
  "verificationLevel": 2,
  "boostCount": 40,
  "boostTier": 3,
  "vanityUrlCode": "python",
  "features": ["COMMUNITY", "DISCOVERABLE", "VERIFIED", "VANITY_URL"],
  "verified": true,
  "partnered": false,
  "discoverable": true,
  "iconUrl": "https://cdn.discordapp.com/icons/267624335836053506/....png?size=512",
  "channelName": "welcome",
  "scrapedAt": "2026-09-02T06:00:00.000Z"
}
```

### Use cases

- **Community research** - find the biggest and most active servers on a topic with real member and online counts.
- **Lead lists for community marketing** - servers with invite links, badges and sizes for partnership or sponsorship outreach.
- **Invite monitoring** - resolve and re-check invite links to track member growth, boost tier and whether an invite is still valid.
- **Live activity snapshots** - widget reads give the online members and voice channels of servers you run or partner with.
- **Brand and handle checks** - test username availability in bulk before a launch.

### Use with AI assistants (MCP)

This actor is available through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp), so assistants like Claude can call it as a tool - "find the 20 largest Discord servers about indie games" - and get structured data back.

### Agent-ready: autonomous payments (x402 & Skyfire)

This actor is **agent-ready** - AI agents can discover it, run it, and **pay for it autonomously**, with no Apify account and no human in the loop. It uses [pay-per-event](https://docs.apify.com/platform/actors/publishing/monetize/pay-per-event) pricing and [limited permissions](https://docs.apify.com/platform/actors/development/permissions), so it qualifies for Apify's agentic-payment standards:

- **[x402](https://docs.apify.com/platform/integrations/x402)** - an open, HTTP-native payment protocol. Agents pay per run in USDC on the Base network directly through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) - no account, no API key.
- **[Skyfire](https://docs.apify.com/platform/integrations/skyfire)** - agent-to-service payments for fully autonomous AI-agent workflows.

Building an AI agent, MCP tool, or autonomous data pipeline? This scraper is ready to plug in and pay as it goes.

### Pricing

Pay-per-event, tiered by volume: server records from **$0.003** (down to **$0.00165** on the Gold tier and above), widget reads from **$0.004** (down to **$0.0022**), username checks from **$0.001** (down to **$0.00055**). Invalid or expired invites, disabled widgets and blocked requests are **never charged**.

### FAQ

**Do I need a Discord token?** No. Everything here is public and keyless. The actor never logs in and never uses a user or bot token.

**Why is my server not in the directory results?** The directory lists only servers that enabled Server Discovery. Use the invite resolver for any other public server.

**Why does a widget read say "disabled"?** The server owner has not enabled the Server Widget in Server Settings; only enabled widgets are public.

**Can I scrape messages or the full member list?** No - that requires a user token, which Discord's terms prohibit automating. This actor stays on the public surfaces.

Every run finishes with a clear status message; empty runs never crash and never bill.

***

*Discord is a trademark of Discord Inc. This actor is an independent tool that reads publicly available data and is not affiliated with or endorsed by Discord.*

# Actor input Schema

## `searchQueries` (type: `array`):

Keywords to search in Discord's public server directory (discord.com/servers), e.g. <code>music</code>, <code>anime</code>, <code>crypto</code>, <code>study</code>. Each keyword is searched separately, 12 servers per page.

## `category` (type: `string`):

Restrict discovery results to one of Discord's directory categories.

## `maxServersPerQuery` (type: `integer`):

How many directory results to collect per keyword (12 per page).

## `includeServerDetails` (type: `boolean`):

Fetch every discovered server's own directory page to add the invite link, the long 'About' text, the category and precise member / online counts. One extra request per server.

## `inviteLinks` (type: `array`):

Discord invite links or bare codes, e.g. <code>https://discord.gg/python</code>, <code>discord.com/invite/discord-developers</code> or just <code>python</code>. Each is resolved to its server (id, name, description, member and online counts, boost tier, verification level, vanity URL, channel) without joining.

## `urlsFromFile` (type: `string`):

Bulk-load invite links. Either <b>paste the whole list</b> (one per line), or give <b>a single link</b> to a public <code>.txt</code>/<code>.csv</code>, a Google Sheet or Drive share link, or an Apify key-value-store record. A file that cannot be read says so and charges nothing.

## `guildIdsForWidget` (type: `array`):

Numeric server (guild) ids whose public widget you want: online member list (names, status, game), voice channels and presence count. Works only for servers that enabled 'Server Widget'; others are reported as disabled and not charged.

## `usernamesToCheck` (type: `array`):

Discord usernames to test for availability (2-32 chars, letters, digits, underscore, period).

## `maxResults` (type: `integer`):

Cap on the total number of records this run emits across all sections.

## `proxyConfiguration` (type: `object`):

Discord's public endpoints answer Apify datacenter proxies; the default is enough. Requests are paced to respect Discord's rate limits.

## Actor input object example

```json
{
  "searchQueries": [
    "music"
  ],
  "category": "all",
  "maxServersPerQuery": 48,
  "includeServerDetails": false,
  "inviteLinks": [],
  "guildIdsForWidget": [],
  "usernamesToCheck": [],
  "maxResults": 200,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped Discord records as JSON items in the default dataset.

# 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 = {
    "searchQueries": [
        "music"
    ],
    "category": "all",
    "maxServersPerQuery": 48,
    "inviteLinks": [],
    "urlsFromFile": "",
    "guildIdsForWidget": [],
    "usernamesToCheck": [],
    "maxResults": 200,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapesage/discord-public-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 = {
    "searchQueries": ["music"],
    "category": "all",
    "maxServersPerQuery": 48,
    "inviteLinks": [],
    "urlsFromFile": "",
    "guildIdsForWidget": [],
    "usernamesToCheck": [],
    "maxResults": 200,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapesage/discord-public-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 '{
  "searchQueries": [
    "music"
  ],
  "category": "all",
  "maxServersPerQuery": 48,
  "inviteLinks": [],
  "urlsFromFile": "",
  "guildIdsForWidget": [],
  "usernamesToCheck": [],
  "maxResults": 200,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call scrapesage/discord-public-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapesage/discord-public-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/FNgAREWYceRIbdCDc/builds/hH2WCX5Qu41a3Y0pc/openapi.json
