{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "entry": {
      "description": "One player's standing on the leaderboard.",
      "properties": {
        "avatar": {
          "description": "URL of the player's avatar image, if they have one.",
          "format": "uri",
          "type": "string"
        },
        "did": {
          "description": "The player's atproto DID.",
          "format": "did",
          "type": "string"
        },
        "handle": {
          "description": "The player's atproto handle, if resolvable.",
          "format": "handle",
          "type": "string"
        },
        "nb": {
          "description": "Number of rated puzzle attempts.",
          "type": "integer"
        },
        "rating": {
          "description": "The player's Glicko-2 rating, rounded.",
          "type": "integer"
        },
        "ratingDeviation": {
          "description": "The player's Glicko-2 rating deviation, rounded.",
          "type": "integer"
        }
      },
      "required": [
        "did",
        "rating",
        "ratingDeviation",
        "nb"
      ],
      "type": "object"
    },
    "main": {
      "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.",
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "entries": {
              "description": "Leaderboard entries ordered by rating, best first.",
              "items": {
                "ref": "org.lichess.puzzle.getLeaderboard#entry",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "entries"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "limit": {
            "default": 50,
            "description": "Maximum number of entries to return.",
            "maximum": 200,
            "minimum": 1,
            "type": "integer"
          }
        },
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "org.lichess.puzzle.getLeaderboard",
  "lexicon": 1
}
