v1.0

API Reference

Build tournaments, leaderboards, and Discord bots using the Apna Ludo REST API. Fast, reliable, and completely free for community use.

RESTful & JSON

Standardized JSON responses with predictable HTTP status codes.

No API Keys Required

Completely open for community use. Fair-use rate limits apply automatically.

99.9% Uptime

Powered by serverless infrastructure for zero downtime and low latency.

Retrieve a Room

Fetches the current status, statistics, and final results of a specific match. This is typically used to update external tournament brackets or Discord leaderboards once a match finishes.

Endpoint

GET/api/room/{code}

Parameters

NameTypeDescription
code
Required
pathThe 6-character unique room code.
password
Required
queryThe room passcode (if one was set by the host).
Example Request
curl -X GET \
"https://apnaludo.co.in/api/room/A7X9PL?password=secret"
Response (200 OK)application/json
{
  "success": true,
  "data": {
    "roomCode": "A7X9PL",
    "roomType": 4,
    "status": "finished",
    "winner": "Player_1",
    "players": [
      {
        "name": "Player_1",
        "color": "red",
        "joinedAt": "2026-10-03T08:15:00.000Z",
        "stats": {
          "tokensCut": 12,
          "gamesPlayed": 5,
          "gamesWon": 3,
          "winRatio": "0.60"
        }
      }
    ]
  }
}

Create a Room

Programmatically generate a new matchmaking lobby. Returns the generated room code and a direct join URL you can send to users.

Endpoint

POST/api/room/create

Body Parameters

NameTypeDescription
hostName
Required
stringDisplay name for the creator.
roomType
Required
integerMust be 2, 3, or 4.
passwordstringOptional passcode to secure the room.
Example Request
curl -X POST "https://apnaludo.co.in/api/room/create" \-H "Content-Type: application/json" \-d '{"hostName": "BotPlayer", "password": "optional_secret", "roomType": 4}'
Response (200 OK)application/json
{
  "success": true,
  "message": "Room created successfully",
  "data": {
    "roomCode": "X9P2LM",
    "roomType": 4,
    "hostUrl": "https://apnaludo.co.in/room/X9P2LM?name=BotPlayer&pwd=optional_secret"
  }
}