REST API v1 · Entwickler · API-Referenz

Server-API-Referenz

Alle 4 Server-Endpunkte der BotGG-REST-API v1: Scopes, Parameter, Felder, Fehler und sofort ausführbare Beispiele in curl, JavaScript und Python.

Entwicklerdokumentation
Auf dieser Seite

Endpunkte

Pfade sind relativ zu https://console.botgg.app/api/v1. Sende deinen API-Schlüssel als Authorization: Bearer botgg_…; IDs sind Strings.

Server-Endpunkte
EndpunktScopeBeschreibung
GET/guilds/{guildId}guild:readGet the server
GET/guilds/{guildId}/rolesguild:readList roles
GET/guilds/{guildId}/channelsguild:readList channels
GET/guilds/{guildId}/members/{userId}guild:readGet a member

Neben den unten genannten eigenen Fehlern kann jeder Endpunkt diese allgemeinen zurückgeben:

Get the server

GET/guilds/{guildId}

Scope: guild:read

Name, icon, approximate member count, the bot’s language and the enabled BotGG features.

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)

Antwort

Antwortfelder · 200
FeldTypErforderlichBeschreibung
idstringJa
namestringJa
iconstring | nullJa
iconUrlstring | nullJa
memberCountinteger | nullJaApproximate; null when Discord is unreachable
localestringJaThe bot’s language on this server (en, ru, he, zh-TW, de)
enabledFeaturesarray of stringJa
Antwort · 200
{
  "id": "example",
  "name": "Example",
  "icon": "example",
  "iconUrl": "https://example.com",
  "memberCount": 10,
  "locale": "example",
  "enabledFeatures": [
    "example"
  ]
}

Beispiele

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678" \
  -H "Authorization: Bearer $BOTGG_API_KEY"
JavaScript (fetch)
// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);
Python (requests)
import os
import requests

res = requests.get(
    "https://console.botgg.app/api/v1/guilds/123456789012345678",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Fehler

Nur die allgemeinen Fehler, die unter „Endpunkte“ aufgeführt sind.

List roles

GET/guilds/{guildId}/roles

Scope: guild:read

Highest first (Discord order), without @everyone.

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)

Antwort

Antwortfelder · 200
FeldTypErforderlichBeschreibung
itemsarray of objectJa
items[].idstringJa
items[].namestringJa
items[].colorstring | nullJa
items[].positionintegerJa
items[].managedbooleanJa
items[].hoistbooleanJa
items[].mentionablebooleanJa
Antwort · 200
{
  "items": [
    {
      "id": "example",
      "name": "Example",
      "color": "#18d7ff",
      "position": 10,
      "managed": true,
      "hoist": true,
      "mentionable": true
    }
  ]
}

Beispiele

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/roles" \
  -H "Authorization: Bearer $BOTGG_API_KEY"
JavaScript (fetch)
// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/roles', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);
Python (requests)
import os
import requests

res = requests.get(
    "https://console.botgg.app/api/v1/guilds/123456789012345678/roles",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Fehler

Fehler
HTTPCodes
503SERVICE_UNAVAILABLE

List channels

GET/guilds/{guildId}/channels

Scope: guild:read

In Discord’s sidebar order (categories followed by their channels); threads are not included.

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)

Antwort

Antwortfelder · 200
FeldTypErforderlichBeschreibung
itemsarray of objectJa
items[].idstringJa
items[].namestringJa
items[].typestringJaEines von text, voice, category, announcement, stage, forum, media, other
items[].parentIdstring | nullJa
items[].positionintegerJa
Antwort · 200
{
  "items": [
    {
      "id": "example",
      "name": "Example",
      "type": "text",
      "parentId": "234567890123456789",
      "position": 10
    }
  ]
}

Beispiele

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/channels" \
  -H "Authorization: Bearer $BOTGG_API_KEY"
JavaScript (fetch)
// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/channels', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);
Python (requests)
import os
import requests

res = requests.get(
    "https://console.botgg.app/api/v1/guilds/123456789012345678/channels",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Fehler

Fehler
HTTPCodes
503SERVICE_UNAVAILABLE

Get a member

GET/guilds/{guildId}/members/{userId}

Scope: guild:read

Basic member info: names, avatar, role ids and join date. Cached for up to 5 minutes.

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)
userIdPfadstringJaDie Discord-Nutzer-ID des Mitglieds · Discord-ID (String)

Antwort

Antwortfelder · 200
FeldTypErforderlichBeschreibung
userIdstringJa
usernamestring | nullJa
globalNamestring | nullJa
nicknamestring | nullJa
displayNamestring | nullJa
avatarUrlstring | nullJa
botbooleanJa
rolesarray of stringJaRole ids
joinedAtstring | nullJa
Antwort · 200
{
  "userId": "876543210987654321",
  "username": "example",
  "globalName": "example",
  "nickname": "example",
  "displayName": "example",
  "avatarUrl": "https://example.com",
  "bot": false,
  "roles": [
    "example"
  ],
  "joinedAt": "2026-10-07T12:00:00.000Z"
}

Beispiele

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/members/876543210987654321" \
  -H "Authorization: Bearer $BOTGG_API_KEY"
JavaScript (fetch)
// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/members/876543210987654321', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);
Python (requests)
import os
import requests

res = requests.get(
    "https://console.botgg.app/api/v1/guilds/123456789012345678/members/876543210987654321",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Fehler

Bereit, deinen Server aufs nächste Level zu bringen?

Füge BotGG kostenlos hinzu und aktiviere die Features dann in der Web-Konsole.