DonutAPI API reference Console

DonutAPI reference

Live player stats and online status from DonutSMP, as JSON.

Behind the API, real Minecraft accounts stay logged in on DonutSMP. Your request goes to a free account. It runs the command in game, reads the answer, and you get JSON back, usually in under a second.

Base URL: https://your-server

Quickstart

01Get a keyAsk the owner of this server for an API key. It starts with dnt_.
02Make a requestSend the key in the Authorization header.
03Read the resultresult.money, result.playtime (seconds) and more.
curl -H "Authorization: dnt_YOUR_KEY" \
  https://your-server/v1/stats/Notch

Authentication

Every request to /v1/… needs a key. Any of these headers works:

Authorization: dnt_YOUR_KEY
Authorization: Bearer dnt_YOUR_KEY
X-API-Key: dnt_YOUR_KEY

A missing, wrong or switched-off key gets 401 unauthorized. The API allows calls from any website (CORS), but never put your key in a public web page: anyone can read it there. Call the API from your server or bot.

Java & Bedrock names

PlayerWrite it asExample
Javathe name/v1/stats/Notch
Bedrocka dot, then the gamertag/v1/stats/.SomeGamertag

Names are 1–16 letters, digits or _ (plus the leading dot for Bedrock). Anything else gets 400 bad_request. The response says which kind it was in platform.

Player stats

GET/v1/stats/:username

Runs /stats <username> in game, reads the stats menu and returns the numbers.

QueryEffect
fresh=1Skip the cache and always ask the game. Slower, and it uses up the server's capacity: use it only when you really need the newest numbers.
raw=1Also return result.fields: every item in the menu, for debugging.

Response · 200

{
  "status": 200,
  "result": {
    "username": "Notch",
    "platform": "java",
    "money": 1200000000,
    "shards": 157,
    "kills": 58,
    "deaths": 35,
    "playtime": 201600,
    "placed_blocks": 11400,
    "broken_blocks": 60700,
    "mobs_killed": 149,
    "display": { "money": "1.2B", "shards": "157", "playtime": "2d 8h" }
  },
  "cached": false,
  "worker": "w_3f9a1c07be",
  "took_ms": 412,
  "fetched_at": "2026-11-06T10:41:07.512Z",
  "stale": false,
  "missing": []
}

Fields of result

FieldTypeUnitWhenNotes
usernamestringalwaysas you asked for it
platformstringalways"java" or "bedrock" (from the dot)
moneyinteger$alwaysexact balance
shardsintegeralways
kills, deathsintegeralways
playtimeintegersecondsalways201600 = 2 days 8 hours
placed_blocks, broken_blocksintegeralways
mobs_killedintegeralways
money_spent_on_shopinteger$optionalonly when the game shows it
money_made_from_sellinteger$optionalonly when the game shows it
kdrnumberoptionalkills per death, only when the game shows it
displayobjectalwaysthe same values as text, exactly as shown in game ("1.2B", "2d 8h")
fieldsarraywith raw=1every item in the menu, for debugging

A name that never played on DonutSMP gets 404 not_found.

Partial answers. Now and then the game shows the stats menu before every number is in. Then missing lists the stats that are not in result (for example ["shards"]). Such an answer is never cached, so asking again usually gets the full one. missing is an empty list for a complete answer.

Is a player online?

GET/v1/activity/:username

How the check works depends on the owner's setting. With the player list (the default), the account reads the server's list of online players, so the player never notices. With whisper, the account sends the player a tiny /msg and reads the reply. The owner can also switch the check off; then every call gets 503 activity_disabled.

{
  "status": 200,
  "result": {
    "username": "Notch",
    "platform": "java",
    "online": true,
    "status": "online",
    "reason": "in the player list",
    "detail": "Notch"
  },
  "cached": false,
  "worker": "w_8d02e4a1f6",
  "took_ms": 12,
  "fetched_at": "2026-11-06T10:41:09.020Z",
  "stale": false
}
FieldTypeNotes
onlineboolean or nulltrue = online. false = offline (whisper mode only). null = could not tell: with the player list, a player who is not listed may still be online on another DonutSMP server, or hidden. Rely on this field.
statusstringonline, offline, not_found (never joined; whisper mode) or unknown (not in the player list)
reasonstringa short text for people
detailstringthe server's own line, or the listed name. Always included.
chatarrayonly with raw=1: the chat lines the account saw

Answers that could not tell (online: null) are never cached.

Health

GET/health

No key needed. Use it for uptime monitors.

{ "ok": true, "workers_online": 12, "workers_total": 25, "queued": 1 }

Every response

FieldTypeNotes
statusintegerthe HTTP status again
resultobjectthe answer (see each endpoint)
cachedbooleantrue = answered from memory, not from the game just now
workerstringa short id of the account that answered, like w_3f9a1c07be. The same account always has the same id; it is not the account's name.
took_msintegerhow long the lookup took, in milliseconds. 0 when cached.
fetched_atstring (ISO 8601 time, UTC)when this answer was read from the game. Older than now when it came from the cache or is stale.
stalebooleantrue when a fresh lookup failed (timeout, every account busy or at its limit…) and you got the last good answer instead, up to about 10 minutes old by default. Check fetched_at to see how old it is.
missingarray of stringsstats only: the stats the game did not show this time (see partial answers). Empty for a complete answer.

Errors

Every error looks like this. Code against error; the message is for people and may change.

{ "status": 429, "error": "rate_limited", "message": "rate limit of 60/min exceeded" }
HTTPerrorMeaningWhat your code should do
400bad_requestThe name is not a Java name or a .Bedrock name.Don't retry. Fix the name.
401unauthorizedThe key is missing, wrong, or switched off.Don't retry. Check the key.
404not_foundNo such player (stats), or a wrong URL.Don't retry. A "no such player" answer is cached for a short while.
405bad_requestNot a GET request.Use GET.
429rate_limitedYour key went over its limit per minute, or has too many lookups open at once.Wait the seconds in the Retry-After header, then go on. Send fewer requests in parallel.
502unparsedThe stats menu opened but could not be read.Retry once, later.
502worker_offline, worker_busy, worker_disconnected, internalThe account answering had a problem. The server already retried on another one.Retry once after a second.
503no_workersNo account is online right now.Back off: retry after 30 s or more.
503queue_timeoutEvery account stayed busy too long.Back off a few seconds, then send fewer requests at once.
503capacityEvery account has used its lookups for now (the owner limits how often each account may look things up).Wait the seconds in Retry-After. Cached answers still work.
503worker_warmingThe accounts just joined and are not ready yet.Retry after Retry-After, or in about a minute.
503overloadedToo many lookups are already waiting.Back off for Retry-After seconds, then send fewer at once.
503shutting_downThe server is restarting.Retry after Retry-After seconds.
503activity_disabledThe online check is switched off on this server.Don't retry. Ask the owner.
504timeoutThe game did not answer in time.Retry once.

Every 429 and 503 carries a Retry-After header (seconds); the body then also has retry_after_s with the same number. Many failed lookups are answered with a stale result instead of an error (see stale).

Rate limits

Each key has a limit per minute (the owner sets it per key; keys without their own limit use the server's default, 120 a minute unless changed) and a cap on lookups open at the same time. Over either, you get 429 rate_limited and a Retry-After header in seconds. Separately, the owner limits how fast each game account works, like a real player would. Very large bursts wait in a queue, and can end in 503 queue_timeout or 503 capacity (also with Retry-After).

Caching

WhatReused for
Stats60 s by default
"Player not found"30 s by default
Online check5 s by default

The owner can change these. Identical requests already in progress share one answer. cached: true tells you an answer came from memory; ?fresh=1 skips it.

Retrying the right way

Retry only what can succeed later (429, 502, 503, 504), honour Retry-After, and give up after a few tries.

async function donut(path, key, tries = 3) {
  for (let i = 0; i < tries; i++) {
    const res = await fetch("https://your-server" + path, { headers: { Authorization: key } });
    const body = await res.json();
    if (res.ok) return body.result;
    if (![429, 502, 503, 504].includes(res.status)) throw new Error(body.error);
    const wait = Number(res.headers.get("Retry-After")) || 2 ** i;
    await new Promise((r) => setTimeout(r, wait * 1000));
  }
  throw new Error("gave up");
}

CORS and other URLs

Responses carry Access-Control-Allow-Origin: *, allow the Authorization and X-API-Key headers and let scripts read Retry-After, so browsers may call the API (keep the key out of public pages anyway). The same endpoints also answer at /api/stats/:username, /api/activity/:username, /stats/:username and /activity/:username. Only GET (and the browser's OPTIONS) are allowed.

Try it

Questions or a key: ask the owner of this server.