> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mindcase.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Discord Servers API

> Get Discord servers with name, invite url, vanity code, members, online, tags, by search keywords.

`POST /v1/data/discord/servers/run`

**Pricing:** $0.01 per server ($10.00 per 1,000). Plus a flat \$0.25 search fee per run, charged even when nothing is found.

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**queries** `string[]` *required*

One or more search keywords. One request reads them all.

**maxResults** `integer` (default: 100)

How many servers to return in total. Defaults to 100; use 0 for all.

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/discord/servers/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "queries": [
      "minecraft",
      "python",
      "midjourney"
    ],
    "maxResults": 10
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/discord/servers/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "queries": [
        "minecraft",
        "python",
        "midjourney"
    ],
    "maxResults": 10
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/discord/servers/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "queries": [
    "minecraft",
    "python",
    "midjourney"
  ],
  "maxResults": 10
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one server, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `serverId` | Server ID | text |
| `name` | Name | text |
| `inviteUrl` | Invite URL | text |
| `vanityCode` | Vanity Code | text |
| `members` | Members | integer |
| `online` | Online | integer |
| `tags` | Tags | array |
| `serverTag` | Server Tag | text |
| `serverTagBadgeUrl` | Server Tag Badge URL | text |
| `serverTagUsers` | Server Tag Users | integer |
| `boosts` | Boosts | integer |
| `iconUrl` | Icon URL | text |
| `createdDate` | Created Date | date |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "discord/servers",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "iconUrl": "https://cdn.discordapp.com/icons/302094807046684672/ce9ca6ab18e2568e50af5a34dc361aa6.webp?size=32",
      "serverTag": "MC",
      "name": "MINECRAFT",
      "online": 437142,
      "members": 4195184,
      "serverId": "302094807046684672",
      "createdDate": "2017-04-13",
      "vanityCode": "minecraft",
      "tags": [],
      "serverTagUsers": 2116,
      "boosts": 521,
      "serverTagBadgeUrl": "https://cdn.discordapp.com/clan-badges/302094807046684672/ec60c5e6d1f14d3bbff586e2e0b9e54e.png",
      "inviteUrl": "https://discord.gg/minecraft"
    }
  ]
}
```

## Related APIs

To check if a username is free use [`discord/username-check`](https://docs.mindcase.co/apis/discord/username-check).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.