# Discord 目录与社区发现 API (discord.directory)

- Canonical page: [https://everyinfra.com/discord-api/directory](https://everyinfra.com/discord-api/directory?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "discord", "action": "directory", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 100 per call
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=discord&action=directory

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| category | not declared | no | not declared | directory 的服务器分类：gaming 游戏、entertainment 娱乐、education 教育、music 音乐、science-and-tech 科学技术。不传则不限定分类；未列出的分类会被忽略，不支持按任意标签筛选。 |
| limit | integer (1–100) | no | 20 | 这次调用最多返回的条数，整数，1–100；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| member_count | 服务器总成员数。 |
| online_count | 当前在线数。**在线/总数比值比总数更能反映社区活跃度**。 |
| boost_count | 服务器 Boost 数（成员付费加成）。 |
| vanity_url_code | 自定义邀请短链。有它说明服务器达到过 Boost 等级门槛。 |
| language | 内容语言代码（如 zh、en），由平台判定，可能不准。 |
| categories | 服务器分类。 |
| keywords | 关键词标签。 |
| icon_url | 服务器图标。 |
| banner_url | 横幅图。 |
| verification_level | 验证等级（进入门槛）。 |
| is_nsfw | 是否为 NSFW 服务器。 |
| created_at | 创建时间，格式同 posted_at。 |
| directory_url | 服务器目录页链接。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "discord",
  "action": "directory",
  "params": {}
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "discord",
        "action": "directory",
        "params": {},
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "discord",
  "action": "directory",
  "results": [
    {
      "id": "•••",
      "name": "Midjourney",
      "url": "https://discord.gg/midjourney",
      "text": "The official server for Midjourney, a text-to-image AI where your imagination is the only limit.",
      "member_count": 18557200,
      "online_count": 735634,
      "boost_count": 250,
      "language": "en-US",
      "categories": [
        "Entertainment"
      ],
      "keywords": [
        "AI",
        "artificial intelligence",
        "art"
      ],
      "icon_url": "https://cdn.discordapp.com/icons/662267976984297473/39128f6c9fc33f4c95a27d4c601ad7db.png?size=256.webp?size=256",
      "banner_url": "https://cdn.discordapp.com/banners/662267976984297473/63249e6867f276efc07d32793b7b3b5a.webp?size=480",
      "verification_level": "COMMUNITY, DISCOVERABLE, VERIFIED",
      "directory_url": "https://discord.com/servers/midjourney-662267976984297473",
      "platform": "discord"
    },
    {
      "id": "•••",
      "name": "Steal a Brainrot",
      "url": "https://discord.gg/brainrots",
      "text": "Welcome to the official Steal a Brainrot server! 🧠",
      "member_count": 7752624,
      "online_count": 292420,
      "boost_count": 536,
      "language": "en-US",
      "categories": [
        "Memes",
        "Gaming"
      ],
      "keywords": [
        "brainrot",
        "roblox"
      ],
      "icon_url": "https://cdn.discordapp.com/icons/1376018788041887795/f9f69ceda1bb918075ee1b2fd4cb5fcc.png?size=256.webp?size=256",
      "banner_url": "https://cdn.discordapp.com/banners/1376018788041887795/a8e25be1082189e0a535f86e5d601126.webp?size=480",
      "verification_level": "COMMUNITY, DISCOVERABLE",
      "directory_url": "https://discord.com/servers/steal-a-brainrot-1376018788041887795",
      "platform": "discord"
    }
  ],
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=discord
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
