Skip to content

Connect an app.

Fixed base address: https://mayhemstats.lol/api. Download an example upload.json (made-up test values)

Connection and key

HTTPS base: https://mayhemstats.lol/api. JSON; at most 65,536 UTF-8 bytes per write request. Examples are for PowerShell 7 with curl.exe. upload.json holds real AramEntry values from blank.; the example file contains only made-up test values and must not be uploaded as a real game. On the first upload the app can send a cryptographically random key with 64 hex characters, stored safely beforehand, as Bearer. Without a key the server creates one and returns playerToken once. All further uploads of the same player.puuid and DELETE must send this key. No global key belongs in browser code or a published EXE. This first registration does not prove a Riot identity. Error messages of the API are in German.

$API = "https://mayhemstats.lol/api"
$PUUID = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
$TOKEN = "PERSONAL_KEY"

POST /api/games

Body: entries and player. A group field (formerly for groups) is still accepted and ignored. Entries may contain the friends read from the client; player identifies the uploader. Result per entry; rank is a RankResult, or null when the game does not count. MP are calculated only with standings()/rankResult(). The first key in the response must be stored safely in the desktop app.

curl.exe -X POST "$API/games" -H "Content-Type: application/json" -H "Origin: http://tauri.localhost" --data-binary "@upload.json"
# After that:
curl.exe -X POST "$API/games" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" --data-binary "@upload.json"

Example response:

{
  "results": [
    {
      "gameId": 8000000000,
      "puuid": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
      "stored": true,
      "rank": {
        "mark": 2.8,
        "gain": null,
        "before": null,
        "after": null,
        "change": null,
        "games": 1
      }
    }
  ],
  "playerToken": "ONLY_ON_FIRST_UPLOAD",
  "season": {
    "id": "v1",
    "start": 1577836800000,
    "ratingVersion": 1
  }
}

GET /api/leaderboard?season=<id>

season is optional; default season v1. Season v1 starts on January 1, 2020, so existing app histories can be taken over. Sorting is exactly that of standings(). It counts all players from uploaded and archived games (the Collector's raw data archive), one entry per player and game; players without their own profile appear under a public number (`puuid: "a123"`), never with their PUUID, hidden players not at all. Example response for a still empty global data set.

curl.exe "$API/leaderboard?season=v1"

Example response:

{
  "season": {
    "id": "v1",
    "start": 1577836800000,
    "ratingVersion": 1
  },
  "since": 1577836800000,
  "ratingVersion": 1,
  "players": []
}

GET /api/players/<Riot ID, puuid or a123>

Rank, season history and the five best games by grade, including archived games. Instead of the PUUID you can use the Riot ID like on op.gg (/api/players/Name-TAG) or the public number of a player without a profile (/api/players/a123). Optional season as for the leaderboard. history contains the unchanged Step objects with entry, mark, gain, before, after and change; bestGames has the same shape. Example for a player without rated games.

curl.exe "$API/players/$PUUID"
curl.exe "$API/players/${PUUID}?season=v1"

Example response:

{
  "puuid": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "name": "Example#EUW",
  "icon": 1,
  "lastSeen": 1790812800000,
  "season": {
    "id": "v1",
    "start": 1577836800000,
    "ratingVersion": 1
  },
  "rank": null,
  "games": 0,
  "history": [],
  "bestGames": []
}

GET /api/games?since=<ms>

All undisputed AramEntry records from since. disputed contains the affected keys; the app must remove games with these keys that it already has locally from the rating. To pick up quality improvements, load older games again too: since refers to the game start, not to receivedAt.

curl.exe "$API/games?since=0"
curl.exe "$API/games?since=1790812800000"

Example response:

{
  "entries": [],
  "disputed": [],
  "since": 0
}

DELETE /api/players/<puuid>

Deletes the profile, own games, upload records, memberships and personal references in the with fields of other players' games. Contradictions are then evaluated again. All website views are updated through reset. Copies already downloaded and platform backups are not recalled.

curl.exe -X DELETE "$API/players/$PUUID" -H "Authorization: Bearer $TOKEN"

Example response:

{
  "deleted": true
}

GET /api/live

Server-Sent Events. game contains entry, rank and disputed. ready confirms the connection; reset asks for a full reload; heartbeat keeps it open. The server checks the persistent event log every 2 seconds, so there is no guaranteed instant push. The stream reconnects after about 45 seconds with Last-Event-ID. Event references are kept for 24 hours; after longer outages, sync completely. On connection errors the website automatically falls back to 5-second polling. WebSocket is not implemented here.

curl.exe -N "$API/live"
# Resume:
curl.exe -N "$API/live" -H "Last-Event-ID: 42"

Example response:

id: 43
event: game
data: {"entry": {"...":"full AramEntry"}, "rank": null, "disputed": true}

event: reset
data: {}

GET /api/export

Extra endpoint: the whole public data set as JSON, with games (entry, quality, receivedAt, sourceHash, disputed), players and seasons. No authorization keys, rate limit data or IP addresses. The export is meant for archiving and migrating; there is intentionally no public import endpoint.

curl.exe "$API/export" -o blank-mayhem-export.json

Example response:

{
  "exportedAt": 1790812800000,
  "ratingVersion": 1,
  "seasons": [
    {
      "id": "v1",
      "start": 1577836800000,
      "ratingVersion": 1
    }
  ],
  "players": [],
  "games": []
}

CORS and errors

http://tauri.localhost and the website itself are allowed. Native HTTP calls from Rust without Origin work too. OPTIONS does not count toward the rate limit. 400: invalid JSON or entry with reasons; 401: wrong/missing key; 403: foreign Origin; 404: player/season missing; 409: version or registration conflict; 413: more than 64 KB; 429: more than 30 write requests (POST, DELETE) per minute/IP (Retry-After: 60); read requests (GET) are not limited; 503: storage/service temporarily unavailable. On 400 the upload is discarded before any game changes. Error messages are in German.

curl.exe -i -X OPTIONS "$API/games" -H "Origin: http://tauri.localhost" -H "Access-Control-Request-Method: POST" -H "Access-Control-Request-Headers: content-type,authorization"

Example response:

HTTP 204
Access-Control-Allow-Origin: http://tauri.localhost
Access-Control-Allow-Methods: GET,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type,Authorization,Last-Event-ID

Rating, conflicts and limits

The three original files are taken unchanged from Git commit 7c875fd592502ed016420607a846cf0743f0e0cd. RATING_VERSION=1. The AramEntry format has no queue ID: blank. must check queue 2400 before uploading. No server can confirm client values as genuine through range checks alone. When matching lobbies, you and the order are ignored; all other lobby values are compared. Differing reports from different uploaders exclude the whole game until their better versions agree or a report is dropped with the player's deletion. Equivalent versions replace nothing. As in the original, incomplete or provisional entries only count as far as markGame accepts them. For security reasons a non-empty lobby needs exactly one you. The original Rust limit for gameId is strictly less than 10^13.

Operation, costs and changes

As of October 1, 2026: Sites is included in eligible ChatGPT plans during the public beta. The official Sites documentation lists 10 GB of D1 per site; hosting usage limits apply per plan across all sites. A reliable number of API requests per day and binding deadlines when a plan ends are not published there. No unlimited use or continued operation after cancellation is promised. When limits are reached, public availability in particular can be restricted. The API's own limit is 30 requests per calendar minute and IP. Rank calculation and export read the relevant games in full; very large data sets can hit runtime/storage limits before reaching 10 GB. Change pages here in the chat or via Sites > this website > Edit; stored data is kept with normal code updates. A new rating version needs a new season with matching original code. Source code and the JSON export allow a later move. Sources: https://learn.chatgpt.com/docs/sites and https://learn.chatgpt.com/docs/pricing.