# Lichess

> Look up Lichess players, their recent games and ratings, the daily puzzle, and the leaderboards. No account needed.

App · Gaming · 4 actions. Web page: https://docs.lodol.com/docs/integrations/lichess

## Actions

### Get a leaderboard

Fetch the top-rated Lichess players for one speed or variant.

**Inputs**

- Speed or variant (`perf_type`, text): Which leaderboard to read. Lichess doesn't rank correspondence or puzzles. One of: `ultraBullet`, `bullet`, `blitz`, `rapid`, `classical`, `chess960`, `crazyhouse`, `antichess`, `atomic`, `horde`, and 3 more. Default: `blitz`.
- How many players (`count`, number): How many players to return (1-100). From 1 to 100. Default: `10`.

**Outputs**

- `perf_type` (text): The speed or variant this leaderboard covers
- `players` (list): The top players, highest rated first

**Example output**

```json
{
  "perf_type": "blitz",
  "players": [
    {
      "rating": 2466,
      "title": "WFM",
      "username": "Lola"
    },
    {
      "rating": 2428,
      "title": "IM",
      "username": "Ana"
    }
  ]
}
```

### Get a player

Look up a Lichess player's public profile, ratings, and win/loss record.

**Inputs**

- Username (`username`, text, required): The Lichess username, for example 'DrNykterstein'.

**Outputs**

- `draws` (number): Games drawn
- `losses` (number): Games lost
- `ratings` (object): Current rating per speed and variant -- for example {'blitz': 1018, 'rapid': 1056}
- `title` (text): The player's chess title such as 'GM' or 'IM', or empty if they have none
- `total_games` (number): How many games the player has finished
- `url` (text): Link to the player's Lichess profile
- `user_id` (text): The player's Lichess ID (lowercased username)
- `username` (text): The player's username, as they capitalize it
- `wins` (number): Games won

**Example output**

```json
{
  "draws": 683,
  "losses": 4558,
  "ratings": {
    "blitz": 1018,
    "bullet": 1076,
    "rapid": 1056
  },
  "title": "",
  "total_games": 9824,
  "url": "https://lichess.org/@/Mary",
  "user_id": "mary",
  "username": "Mary",
  "wins": 4583
}
```

### Get the daily puzzle

Fetch today's Lichess puzzle and its solution.

**Inputs**: None.

**Outputs**

- `game_id` (text): ID of the game the puzzle was taken from
- `pgn` (text): Moves of the source game, in PGN notation
- `plays` (number): How many times the puzzle has been attempted
- `puzzle_id` (text): The puzzle's ID
- `rating` (number): The puzzle's difficulty rating
- `solution` (list): The winning line, as moves in UCI notation such as 'c4d3'
- `themes` (list): Tactical themes, for example 'endgame' or 'crushing'
- `url` (text): Link to solve the puzzle on Lichess

**Example output**

```json
{
  "game_id": "bcZBqQrZ",
  "pgn": "g3 e5 Bg2 d5 d3 Nc6 c4 Be6 Nc3 Nf6",
  "plays": 42035,
  "puzzle_id": "IFy4T",
  "rating": 1869,
  "solution": [
    "c4d3",
    "e4d3",
    "e1e5"
  ],
  "themes": [
    "endgame",
    "crushing",
    "short"
  ],
  "url": "https://lichess.org/training/IFy4T"
}
```

### List a player's games

List a Lichess player's most recent games, newest first. Unlike the other Lichess actions, this one requires a personal API access token: see the connection's setup instructions.

**Inputs**

- Username (`username`, text, required): The Lichess username, for example 'DrNykterstein'.
- How many games (`count`, number): How many games to return (1-100). From 1 to 100. Default: `10`.
- Rated games only (`rated_only`, true/false): Leave out casual games. Off by default. Default: `false`.

**Outputs**

- `games` (list): The player's recent games, newest first

**Example output**

```json
{
  "games": [
    {
      "black": "Lola",
      "created_at": 1782934233712,
      "game_id": "q7ZvsdUF",
      "opening": "Sicilian Defense: Najdorf Variation",
      "outcome": "mate",
      "rated": true,
      "speed": "blitz",
      "url": "https://lichess.org/q7ZvsdUF",
      "white": "Mary",
      "winner": "white"
    }
  ]
}
```
