Skip to content

REST API

Base URL: https://api.spawnle.com (or SPAWNLE_API).

  • Requests and responses are JSON (Content-Type: application/json).
  • Authenticate with the player’s ticket: Authorization: Bearer gt_…. Only /v1/sdk/verify uses your game’s secret instead.
  • Times are Unix seconds. Fields use snake_case.
  • Errors answer { "code": "…", "message": "…" } with an HTTP status — see Errors and limits.
  • The SDK routes allow cross-origin requests from any origin (CORS).
{
"handle": "sofi_moth",
"display_name": "Sofi",
"avatar_color": 10193919,
"avatar_url": "https://api.spawnle.com/v1/images/…",
"level": 7,
"studio": { "studio": "moth-studio", "name": "Moth Studio", "color": 13172557, "logo": null, "title": "Art" },
"game": "neon-moth"
}

display_name is empty when the player has none (show handle). Colours are 24-bit RGB integers (0xRRGGBB).

[{ "slot": "slot1", "size": 1834, "updated_at": 1795733892 }]
{ "slot": "slot1", "data": "{\"level\":3}", "updated_at": 1795733892 }

404 not_found when the slot is empty.

{ "data": "{\"level\":3}" }

Answers the slot’s metadata. 413 too_large over 256 KB; 409 conflict when the player already uses all 16 slots and this is a new one.

204 No Content.

[
{
"key": "first-win",
"name": "First win",
"description": "Win your first round",
"xp": 10,
"hidden": false,
"unlocked_at": 1795733892,
"percent": 42.5
}
]

Hidden, locked achievements have an empty name and description.

No body. Unlocks it (once) and answers:

{ "achievement": { "key": "first-win", "…": "…" }, "newly": true }

GET /v1/sdk/leaderboards/{key}?scope=global&limit=10

Section titled “GET /v1/sdk/leaderboards/{key}?scope=global&limit=10”
{
"key": "speedrun",
"name": "Speedrun",
"lower_is_better": true,
"format": "time",
"scope": "global",
"entries": [
{ "rank": 1, "handle": "sofi_moth", "display_name": "Sofi", "avatar_color": 10193919, "avatar_url": null, "score": 83250 }
],
"me": { "rank": 1, "…": "…" },
"total": 128
}

scope: global or friends. limit: 1–100, default 10.

{ "score": 83250 }
{ "best": 83250, "rank": 1, "improved": true }
{ "details": "Level 3 · 2 lives" }

Up to 80 characters, one line; "" clears it. 204 No Content.

For your server, with the game’s secret instead of a ticket. See Server verification.

X-Spawnle-Game-Secret: gs_…
{ "ticket": "gt_…" }
{ "handle": "sofi_moth", "display_name": "Sofi", "game": "neon-moth", "expires_at": 1795820291 }