Public API

These endpoints require no authentication. Safe to call from client-side code.

GET /api/admin/items — all items

Response

[
  {
    "id":           "uuid",
    "name":         "Dragon Claw",
    "image_url":    "https://...",
    "rarity":       "Legendary",
    "likelihood":   2.5,
    "market_price": 49.99,
    "rap":          45.00
  }
]
GET /api/rolls?limit=50 — recent rolls

Returns the most recent rolls. limit is respected (1–200, default 30).

Response

[
  {
    "id":         "uuid",
    "created_at": "2025-01-01T00:00:00Z",
    "username":   "player1",
    "item_name":  "Dragon Claw",
    "image_url":  "https://...",
    "rarity":     "Legendary",
    "rap":        45.00
  }
]
GET /api/leaderboard — top players by RAP

Response

[
  {
    "username":  "topplayer",
    "plus":      true,
    "rap":       1234.56,
    "itemCount": 42
  }
]
GET /api/users?username=x — user profile

Look up a single user by exact username (case-insensitive). Also supports ?id=uuid.

Response

{
  "id":          "uuid",
  "username":    "player1",
  "balance":     12.50,
  "plus":        false,
  "cases":       100
}
GET /api/inventory/{userId} — user inventory

Response

[
  {
    "id":   "uuid",
    "item": { "name": "Dragon Claw", "rarity": "Omega", "rap": 99.99 }
  }
]
GET /api/listings — marketplace listings

Paginated active listings. Supports filtering, sorting, and search.

Query params

page=0          // page number (default 0)
limit=24        // results per page (default 24, max 1000)
sortBy=price    // "price" or "created_at"
sortDir=asc     // "asc" or "desc"
minPrice=1.00   // minimum price filter
maxPrice=50.00  // maximum price filter
search=dragon   // filter by item name
rarity=Rare     // filter by rarity (comma-separated: "Rare,Legendary")

Response

{
  "listings": [
    {
      "id":       "uuid",
      "price":    12.50,
      "status":   "active",
      "items":    { "name": "Dragon Claw", "rarity": "Legendary", "rap": 45.00 },
      "users":    { "username": "seller1" }
    }
  ],
  "total":    142,
  "page":     0,
  "pageSize": 24
}
Live
No rolls yet