# Discord on Onekey > 2 endpoints for Discord (2 stable, 0 beta), 1 credit each. Category: Messaging & communities. One key, one JSON shape. Base URL: https://api.onekey.dev Auth: header `x-api-key: `. Call shape: `GET /v1/{platform}/{endpoint}?{params}`. Every response is `{success, data, metadata, error}`; check `success` first. Cost is in `metadata.credits_charged`. Free when served from cache (0.2 credit for a cached response over 100 KB). Failed and not-found calls are refunded. Status: stable = verified against the live source; beta = not yet verified, fields may be missing. Page: https://onekey.dev/platforms/discord Reference (Markdown): https://onekey.dev/docs/api/discord.md All docs: https://onekey.dev/llms.txt ## Canonical fields returned Unified-schema fields (same names on every platform), with how many of the 2 mapped Discord endpoints return each: - `entity.id` (string): 2 - `entity.name` (string): 2 - `entity.description` (string): 1 - `entity.stats.members` (integer): 1 - `entity.url` (URL): 1 - plus 6 platform-specific fields under `ext.` ## Endpoints ### discord.invite Public Discord invite lookup: server name and member counts. - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/discord/invite?code=python` with header `x-api-key: YOUR_API_KEY` - Parameters: - `code` (string, required): Invite code or vanity, e.g. python - Fields returned: `entity.id`, `entity.name`, `entity.description`, `entity.stats.members`, `ext.code`, `ext.online`, `ext.boosts`, `ext.verificationLevel`, `ext.channel`, `ext.expiresAt` - Reference: https://onekey.dev/docs/api/discord/invite.md ### discord.widget Public Discord server widget (name, online count, invite) for servers that enable it. - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/discord/widget?id=336642139381301249` with header `x-api-key: YOUR_API_KEY` - Parameters: - `id` (string, required): Server (guild) id - Fields returned: `entity.id`, `entity.name`, `entity.url`, `ext.online` - Reference: https://onekey.dev/docs/api/discord/widget.md ## Sample request ```bash curl "https://api.onekey.dev/v1/discord/invite?code=python" \ -H "x-api-key: YOUR_API_KEY" ```