# Discord 服务器资料 API (discord.server)

- Canonical page: [https://everyinfra.com/discord-api/server](https://everyinfra.com/discord-api/server?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "discord", "action": "server", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- 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=server

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| invite | not declared | yes | not declared | 服务器邀请定位，可传裸邀请码、discord.gg/<code> 或 discord.com/invite/<code> 完整邀请链接。server 读取邀请对应的公开信息，不会替你加入服务器；失效邀请不能视作服务器不存在。 |
| code | not declared | no | not declared | invite 的兼容输入，值为邀请链接末段的邀请码；公开请求仍需包含必填 invite。不是验证码、机器人 token 或服务器 ID。 |
| url | not declared | no | not declared | invite 的兼容输入，用于放完整 Discord 邀请链接；公开请求仍需包含必填 invite，不接受频道消息链接作为邀请。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| member_count | 服务器总成员数。 |
| online_count | 当前在线数。**在线/总数比值比总数更能反映社区活跃度**。 |
| boost_count | 服务器 Boost 数（成员付费加成）。 |
| invite_code | 邀请码（discord.gg/ 后面那段）。 |
| vanity_url_code | 自定义邀请短链。有它说明服务器达到过 Boost 等级门槛。 |
| icon_url | 服务器图标。 |
| banner_url | 横幅图。 |
| verification_level | 验证等级（进入门槛）。 |
| nsfw_level | NSFW 分级。 |
| channel_name | 频道名。 |
| channel_type | 频道类型（文字/语音/论坛）。 |
| inviter_username | 邀请人用户名。 |
| inviter_name | 邀请人昵称。 |
| expires_at | 邀请链接过期时间。null = 永久有效。 |
| 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": "server",
  "params": {
    "invite": "discord.gg/limewire"
  }
}'
```

```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": "server",
        "params": {
            "invite": "discord.gg/limewire",
        },
    },
    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. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "discord",
  "action": "server",
  "results": {
    "id": "•••",
    "name": "LimeWire",
    "url": "https://discord.gg/limewire",
    "text": "The new LimeWire",
    "member_count": 1957101,
    "online_count": 28267,
    "boost_count": 8,
    "invite_code": "limewire",
    "vanity_url_code": "limewire",
    "icon_url": "https://cdn.discordapp.com/icons/1046979304547954728/bbe5d6097255431300cfc18dd629b876.png",
    "banner_url": "https://cdn.discordapp.com/banners/1046979304547954728/d16ea54ee56246388b498ee9256de5ed.png",
    "verification_level": "LOW",
    "nsfw_level": "DEFAULT",
    "channel_name": "📢︱updates",
    "channel_type": "ANNOUNCEMENT",
    "platform": "discord"
  },
  "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
