# org.lichess.puzzle.getLeaderboard

> Published by [pds.dad](https://lexicon.garden/identity/did:plc:rnpkyqnmsw4ipey6eotbdnnf)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:rnpkyqnmsw4ipey6eotbdnnf/org.lichess.puzzle.getLeaderboard)
- [Documentation](https://lexicon.garden/lexicon/did:plc:rnpkyqnmsw4ipey6eotbdnnf/org.lichess.puzzle.getLeaderboard/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:rnpkyqnmsw4ipey6eotbdnnf/org.lichess.puzzle.getLeaderboard/examples)

## Definitions

### `org.lichess.puzzle.getLeaderboard`

**Type**: `query`

The ranked leaderboard, best rating first. Only established players appear: provisional ratings (high deviation), players with too few rated attempts, and players currently limited from ranked play are excluded.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `limit` | `integer` | No | Maximum number of entries to return. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `entries` | `array` | Yes | Leaderboard entries ordered by rating, best first. |

### `org.lichess.puzzle.getLeaderboard#entry`

**Type**: `object`

One player's standing on the leaderboard.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `nb` | `integer` | Yes | Number of rated puzzle attempts. |
| `did` | `string` (did) | Yes | The player's atproto DID. |
| `avatar` | `string` (uri) | No | URL of the player's avatar image, if they have one. |
| `handle` | `string` (handle) | No | The player's atproto handle, if resolvable. |
| `rating` | `integer` | Yes | The player's Glicko-2 rating, rounded. |
| `ratingDeviation` | `integer` | Yes | The player's Glicko-2 rating deviation, rounded. |

## Raw Schema

```json
{
  "id": "org.lichess.puzzle.getLeaderboard",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "entries"
          ],
          "properties": {
            "entries": {
              "type": "array",
              "items": {
                "ref": "org.lichess.puzzle.getLeaderboard#entry",
                "type": "ref"
              },
              "description": "Leaderboard entries ordered by rating, best first."
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {
          "limit": {
            "type": "integer",
            "default": 50,
            "maximum": 200,
            "minimum": 1,
            "description": "Maximum number of entries to return."
          }
        }
      },
      "description": "The ranked leaderboard, best rating first. Only established players appear: provisional ratings (high deviation), players with too few rated attempts, and players currently limited from ranked play are excluded."
    },
    "entry": {
      "type": "object",
      "required": [
        "did",
        "rating",
        "ratingDeviation",
        "nb"
      ],
      "properties": {
        "nb": {
          "type": "integer",
          "description": "Number of rated puzzle attempts."
        },
        "did": {
          "type": "string",
          "format": "did",
          "description": "The player's atproto DID."
        },
        "avatar": {
          "type": "string",
          "format": "uri",
          "description": "URL of the player's avatar image, if they have one."
        },
        "handle": {
          "type": "string",
          "format": "handle",
          "description": "The player's atproto handle, if resolvable."
        },
        "rating": {
          "type": "integer",
          "description": "The player's Glicko-2 rating, rounded."
        },
        "ratingDeviation": {
          "type": "integer",
          "description": "The player's Glicko-2 rating deviation, rounded."
        }
      },
      "description": "One player's standing on the leaderboard."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
