# Discord Server Metadata Lookup (`devilscrapes/discord-server-scraper`) Actor

Bulk-resolve Discord server metadata — name, description, icon, verification level, member and presence counts — from invite codes or URLs via Discord's public invite-lookup API. Metadata only: no message history, no member lists, no authenticated access.

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

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />

## Discord Server Metadata Lookup

**💰 $5.20 / 1 000 results**  ·  pay only for results  ·  no credit card to try

*We do the dirty work so your dataset stays clean.* 😈

Bulk-resolve Discord server metadata — name, description, icon, verification level, member and presence counts — from invite codes or URLs via Discord's public invite-lookup API. Metadata only: no message history, no member lists, no authenticated access.

</div>

***

### 🎯 What this scrapes

Discord's public invite-resolution endpoint answers one invite code at a time with real guild metadata — name, description, icon, verification level, approximate member/presence counts — but there's no bulk form and no batch tooling around it. This Actor takes a list of invite codes or URLs (bare code or full discord.gg/discord.com/invite link), resolves each one against Discord's own keyless API, and returns one clean row per input item in order. It's a metadata lookup, not a crawl: no message history, no member rosters, no authenticated Discord API calls of any kind.

### 🔥 What we handle for you

- 🔍 **Local format validation, free** — every invite code or URL is normalized and validated before any network call, so a malformed entry never costs you a billed row.
- 🔁 **Retries with exponential backoff** on 408 / 429 / 5xx — up to 5 attempts, Discord's own retry\_after and the Retry-After header both honoured.
- 🫠 **One bad invite never fails the run** — an expired, invalid, or unreachable invite is logged and rowed as not\_found/transport\_error; the rest of your list still ships.
- 🧊 **Clean, typed dataset rows** — Pydantic-validated, stable fields, JSON / CSV / Excel export straight from the Apify Console.
- 💰 **Pay-Per-Event pricing** — you only pay for invite codes that resolve to a real server. Invalid, not-found, and failed lookups are free.

### 💡 Use cases

- Track a competitor's Discord community size and growth over time from a list of invite links.
- Enrich a server directory or Web3/gaming project database with live member/presence counts and verification level.
- Screen a list of partner or sponsor Discord servers for legitimacy signals before outreach.
- Feed a growth-marketing dashboard with server metadata pulled from links shared across social channels.

### ⚙️ How to use it

1. Click **Try for free** at the top of the page.
2. Fill in the input form — most fields have sensible defaults.
3. Click **Start**. Output streams into the run's dataset.
4. Export from **Storage → Dataset** as JSON, CSV, or Excel — or fetch via the API.

### 📥 Input

| Field | Type | Required | Default | Notes |
|---|---|:--:|---|---|
| `invite_codes_or_urls` | `array` | **yes** | \['python', 'discord-developers', 'reactiflux'] | Discord invite codes or URLs to resolve, 1-500 per run — bare code (python) or full URL (https://discord.gg/python,… |
| `proxyConfiguration` | `object` | no | {'useApifyProxy': False} | Discord's public invite-resolution endpoint is a keyless API with no anti-bot surface observed. Leave this off unless… |

#### Example input

```json
{
  "invite_codes_or_urls": [
    "python",
    "discord-developers",
    "reactiflux"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

### 📤 Output

Every row is one dataset item.

| Field | Type | Notes |
|---|---|---|
| `input_value` | `string` | Raw input list item, verbatim. |
| `invite_code` | `string` | Locally normalized code (extracted from a URL, or the trimmed bare code). |
| `is_valid_input` | `boolean` | Local code-format validation result. |
| `lookup_status` | `string` | Outcome of this row. |
| `error_reason` | `string` | Human-readable reason when lookup\_status is not 'resolved'; null on success. |
| `guild_id` | `string` | Discord guild (server) id. |
| `guild_name` | `string` | Discord guild (server) name. |
| `guild_description` | `string` | Guild's own description text, when set. |
| `guild_icon_hash` | `string` | Raw guild icon hash from Discord's API. |
| `guild_icon_url` | `string` | Constructed CDN icon URL — .gif when the hash is 'a\_'-prefixed, else .png; null when the guild has no icon. |
| `verification_level` | `integer` | Guild's verification level, as returned by Discord. |
| `vanity_url_code` | `string` | Guild's vanity invite code, when the server has one. |
| `approximate_member_count` | `integer` | Approximate total member count. |
| `approximate_presence_count` | `integer` | Approximate currently-online member count. |
| `invite_expires_at` | `string` | Invite expiry timestamp, when Discord includes one. |
| `inviter_username` | `string` | Username of the invite's creator, when Discord includes an inviter (many invites omit it). |
| `channel_id` | `string` | Id of the channel the invite lands in. |
| `channel_name` | `string` | Name of the channel the invite lands in. |
| `channel_type` | `integer` | Discord channel-type code for the invite's target channel. |
| `looked_up_at` | `string` | ISO-8601 timestamp when this row was resolved. |

#### Example output

```json
{
  "input_value": "https://discord.gg/python",
  "invite_code": "python",
  "is_valid_input": true,
  "lookup_status": "resolved",
  "error_reason": null,
  "guild_id": "192485424653418496",
  "guild_name": "Python Discord",
  "guild_description": "The number one place on Discord for Python programmers.",
  "guild_icon_hash": "5cf0526...",
  "guild_icon_url": "https://cdn.discordapp.com/icons/192485424653418496/5cf0526....png",
  "verification_level": 3,
  "vanity_url_code": "python",
  "approximate_member_count": 431208,
  "approximate_presence_count": 76485,
  "invite_expires_at": null,
  "inviter_username": null,
  "channel_id": "267624335836053506",
  "channel_name": "welcome",
  "channel_type": 0,
  "looked_up_at": "2026-09-15T00:00:00Z"
}
```

### 💰 Pricing

Pay-Per-Event — you pay only when these events fire:

| Event | USD | What it is |
|---|---:|---|
| `actor-start` | $0.2 | One-off warm-up charge per run |
| `result-row` | $0.005 | Per unique dataset item |

Example: 1 000 results at the rates above ≈ **$5.20**. No subscription, no minimum, no card to start — Apify gives every new account $5 of free credit.

### 🚧 Limitations

- Up to 500 invite codes/URLs per run, one lookup per item — there's no batch form on Discord's own endpoint.
- Only servers reachable through a live, unexpired invite code can be looked up — there's no server-directory search or discovery of codes you don't already have.
- Member-level data (rosters, roles, permissions) and channel contents (messages, threads, pins) are never returned — Discord's invite endpoint doesn't expose them.
- inviter\_username is frequently null — many servers configure invites without an exposed creator.

### ❓ FAQ

**Do I need a bot token or Discord login?**

No. This Actor uses only Discord's public, keyless invite-resolution endpoint — no OAuth, no bot token, no login.

**Does this scrape messages or member lists?**

No. It returns aggregate server metadata only — name, description, icon, verification level, approximate member/presence counts. Discord's invite endpoint never exposes message history or a member roster, and this Actor doesn't use any authenticated API that would.

**What if an invite code is expired or invalid?**

It comes back as a normal row with lookup\_status set to not\_found or invalid\_input and a short error\_reason — the run still succeeds, and that row is never billed.

**Can I pass a full discord.gg link instead of just the code?**

Yes. Both discord.gg/<code> and discord.com/invite/<code> links are parsed locally into the bare code before any network call — paste whichever form you have.

### 💬 Your feedback

Spotted a bug, hit a weird edge case, or need a new field? Open an
issue on the Actor's **Issues** tab on Apify Console — we ship
fixes weekly and we read every report.

***

<div align="center">

Built by **[Devil Scrapes](https://apify.com/DevilScrapes)** 😈 — a small fleet of
opinionated public-data Actors. Honest pricing, real engineering, zero fine print.

</div>

# Actor input Schema

## `invite_codes_or_urls` (type: `array`):

Discord invite codes or URLs to resolve, 1-500 per run — bare code (python) or full URL (https://discord.gg/python, https://discord.com/invite/python, with or without trailing slash/query string). Parsed locally before any network call; a malformed entry never touches the network and is never billed.

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

Discord's public invite-resolution endpoint is a keyless API with no anti-bot surface observed. Leave this off unless your account requires egress through Apify Proxy.

## Actor input object example

```json
{
  "invite_codes_or_urls": [
    "python",
    "discord-developers",
    "reactiflux"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# 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 = {
    "invite_codes_or_urls": [
        "python",
        "discord-developers",
        "reactiflux"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/discord-server-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 = {
    "invite_codes_or_urls": [
        "python",
        "discord-developers",
        "reactiflux",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("devilscrapes/discord-server-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 '{
  "invite_codes_or_urls": [
    "python",
    "discord-developers",
    "reactiflux"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call devilscrapes/discord-server-scraper --silent --output-dataset

```

## MCP server setup

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