# Discord API

This Discord server API looks up public servers by invite link or keyword and returns them as JSON. It also browses the server directory and finds users by name.

Passing an invite code or URL inspects public server metadata without joining the community.

- Request: POST https://api.everyinfra.com/api/v1/social with `{"platform": "discord", "action": "<action>", "params": {...}}`
- Canonical page: [https://everyinfra.com/en/discord-api](https://everyinfra.com/en/discord-api?utm_medium=ai_doc&utm_campaign=page_md)
- Each capability uses the price recorded in the public catalog. The response includes the amount charged. Authentication failures, invalid parameters, failed calls, and empty results are not charged.

## Actions

### search — Search
Find Discord servers that match a keyword. Get description, member and online counts, Boost count, language, categories, verification level and NSFW flag. It does not search messages inside servers or open private communities.
- Sync delivery · Price: $1.39 per 1,000 requests (every 20 rows count as one call)
- Catalog values: defaultLimit=20, maxLimit=100. For some actions a limit controls pages or per-parent expansion, so it is not always the final row count.
- Parameters:
  - `keyword` (required): Specifies search terms for public Discord server discovery in search or public user matching by username and display name in search_users. Does not index channel messages or grant access to private servers.
- Returns fields: id, name, url, text, member_count, online_count, boost_count, vanity_url_code, language, categories, keywords, icon_url, banner_url, verification_level, is_nsfw, created_at, directory_url, platform
- Capability page: [https://everyinfra.com/en/discord-api/search](https://everyinfra.com/en/discord-api/search?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/discord-api/search.md)

### directory — Directory
Browse Discord's server directory, with an optional category. Each server has description, member and online counts, Boosts, language, tags and verification level. `category` accepts gaming, entertainment, education, music or science-and-tech. Unrecognized values are ignored.
- Sync delivery · Price: $1.39 per 1,000 requests (every 20 rows count as one call)
- Catalog values: defaultLimit=20, maxLimit=100. For some actions a limit controls pages or per-parent expansion, so it is not always the final row count.
- Parameters:
  - `category` (optional): Filters server discovery in directory using preset values: gaming, entertainment, education, music, or science-and-tech. Leaving this unassigned returns unfiltered directory results; unrecognized categories are ignored.
- Returns fields: id, name, url, text, member_count, online_count, boost_count, vanity_url_code, language, categories, keywords, icon_url, banner_url, verification_level, is_nsfw, created_at, directory_url, platform
- Capability page: [https://everyinfra.com/en/discord-api/directory](https://everyinfra.com/en/discord-api/directory?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/discord-api/directory.md)

### server — Server
Resolve a Discord invite code or link to its server's name, description, member and online counts, Boosts, verification level, channel, inviter and expiry. Reading an invite does not join the server, and a null `expires_at` means the invite never expires.
- Sync delivery · Price: $1.39 per 1,000 requests
- Parameters:
  - `invite` (required): Identifies a target server using a raw invite code or full URL format (discord.gg/<code> or discord.com/invite/<code>). The server action reads public metadata attached to the invite without joining the server; expired or invalid invites do not prove a server is non-existent.
  - `code` (optional): Accepts the invite code segment from an invite link as a compatibility alias for the invite parameter. The request must still pass the required invite parameter; this field does not accept verification codes, bot tokens, or server IDs.
  - `url` (optional): Provides a compatibility alias for the invite parameter that accepts a full Discord invite link. The request must still pass the required invite parameter; channel message links are not accepted as valid invites.
- Returns fields: id, name, url, text, member_count, online_count, boost_count, invite_code, vanity_url_code, icon_url, banner_url, verification_level, nsfw_level, channel_name, channel_type, inviter_username, inviter_name, expires_at, platform
- Capability page: [https://everyinfra.com/en/discord-api/server](https://everyinfra.com/en/discord-api/server?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/discord-api/server.md)

### search_users — User search
Look up Discord users by username or display name and get each account's ID, avatar, Clan tag, creation date, and server and invite counts. It is not a global member search and exposes no private relationships.
- Sync delivery · Price: $1.39 per 1,000 requests (every 20 rows count as one call)
- Catalog values: defaultLimit=20, maxLimit=100. For some actions a limit controls pages or per-parent expansion, so it is not always the final row count.
- Parameters:
  - `keyword` (required): Specifies search terms for public Discord server discovery in search or public user matching by username and display name in search_users. Does not index channel messages or grant access to private servers.
- Returns fields: id, username, name, avatar, clan_tag, server_count, invite_count, created_at, platform
- Capability page: [https://everyinfra.com/en/discord-api/search_users](https://everyinfra.com/en/discord-api/search_users?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/discord-api/search_users.md)

## Discord API questions

### What can I retrieve with the Discord API?

Set `platform` to `discord`. The current catalog lists search, directory, server, and user search. These action names identify different Discord objects or views; they are not interchangeable search modes.

### Which input starts the Discord `search` request?

Specifies search terms for public Discord server discovery in search or public user matching by username and display name in search_users. Does not index channel messages or grant access to private servers. Send it as `keyword` inside `params`.

### Which fields can Discord `search` return?

Its declared schema includes `name`, `text`, `member_count`, and `online_count`. A declared field can still be absent from an individual record, and every other action has its own field list.

### Does every Discord action return immediately?

Actions labeled asynchronous return a job ID you poll. Every other action can also run asynchronously: add `"mode": "async"` to the request body to receive a job ID immediately, useful for slow tasks or large limits. The current catalog contains sync delivery.

## Also

- Machine catalog (no key): https://everyinfra.com/openapi.json · GET /api/v1/social/catalog?platform=discord
- API guide for AI clients: https://everyinfra.com/llms.txt · agents guide: https://everyinfra.com/agents.md
