# Chess.com or lichess leaderboard API

Get Chess.com or Lichess leaderboards by performance category via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as limit, output, perf, and retrieve structured data including source category rank, source player username, source category rating, and selected performance category for chess reference, and record navigation.

Documentation: https://openany.si/chess/chess-com-or-lichess-leaderboard-api/1c6a4fd1-c3c8-4bcd-98eb-2d6d119c8d02/
API ID: 1c6a4fd1-c3c8-4bcd-98eb-2d6d119c8d02
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/chess/v1/leaderboard
Page update time: 2026-12-03T02:47:47.966Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:47:46.707Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Usage and limits
## Chess.com & Lichess Leaderboards API

Use site, perf and limit. Performance-category enums differ between sites; preserve site and perf with each rank and rating instead of merging rating pools.

## What You Can Build

- **Chess reference**: Keep source site and entity identity.
- **Record navigation**: Preserve the site-specific category and time-control scope.

## Returned Data

| Field | Meaning |
| --- | --- |
| `players[].rank` | Source category rank |
| `players[].username` | Source player username |
| `players[].rating` | Source category rating |
| `perf` | Selected performance category |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Chess.com or lichess leaderboard API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "site": {
          "type": "string",
          "description": "chesscom or lichess.",
          "enum": [
            "chesscom",
            "lichess"
          ]
        },
        "perf": {
          "type": "string",
          "description": "chess.com: bullet, blitz, rapid, daily, chess960, tactics, rush, battle. lichess: bullet, blitz, rapid, classical, ultraBullet, chess960, crazyhouse, antichess, atomic, horde, kingOfTheHill, racingKings, threeCheck."
        },
        "limit": {
          "type": "integer",
          "description": "Players (chess.com 1-50, lichess 1-200; default 50)."
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row."
        }
      }
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "cached": {
      "type": "boolean"
    },
    "count": {
      "type": "integer"
    },
    "credits_used": {
      "type": "integer"
    },
    "fetched_at": {
      "type": "string"
    },
    "perf": {
      "type": "string"
    },
    "players": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "avatar": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "draws": {
            "type": "integer"
          },
          "losses": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "rank": {
            "type": "integer"
          },
          "rating": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "trend": {
            "type": "integer"
          },
          "url": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "wins": {
            "type": "integer"
          }
        }
      }
    },
    "site": {
      "type": "string"
    }
  }
}
```

## Request example
Scenario: Official example · Live API.SH response · Minimal request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/chess/v1/leaderboard?limit=1&output=json&perf=blitz&raw=0' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "cached": false,
  "count": 1,
  "credits_used": 1,
  "fetched_at": "2026-11-19T12:20:21.253Z",
  "perf": "blitz",
  "players": [
    {
      "avatar": "https://images.chesscomfiles.com/uploads/v1/user/15448422.88c010c1.200x200o.3c5619f5441e.png",
      "country": "US",
      "draws": 4449,
      "losses": 5690,
      "name": "Hikaru Nakamura",
      "rank": 1,
      "rating": 3465,
      "title": "GM",
      "trend": 12,
      "url": "https://www.chess.com/member/Hikaru",
      "username": "Hikaru",
      "wins": 37844
    }
  ],
  "site": "chesscom"
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### How large can a leaderboard be?
limit is 1–50 for Chess.com or 1–200 for Lichess; default 50.

### Are perf choices identical?
No. Use the category documented for the selected site, preserving literal case where applicable.

### Are ratings directly comparable across sites?
Keep each source site and rating pool explicit; this endpoint does not normalise rating systems.

### Is rank a FIDE rating?
No. It is the source leaderboard position in the selected category.

### How do I bypass cached results?
Pass fresh=1. A cache bypass retrieves available source data; it does not make unpublished or restricted records available.

### Can I request CSV or NDJSON?
This OpenAny implementation serves JSON only. Omit output or set output=json.

## Available implementations
- apish: https://openany.si/chess/chess-com-or-lichess-leaderboard-api/1c6a4fd1-c3c8-4bcd-98eb-2d6d119c8d02/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
