# Lichess API

> Returns Lichess player ratings, top players, tournaments, daily and specific puzzles and live streamers.

Category: Sports & Gaming. Region: global. 14 endpoints at `https://api.hoshime.com/v1/lichess/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/lichess
## GET /v1/lichess/user

A Lichess player: title, games played and the rating in each speed and variant.

Scope: `social:read` · Units: 1 · Cached: 30 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Lichess username. (e.g. DrNykterstein) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `createdAt` (string), `games` (integer (int64)), `id` (string), `perfs` (map), `seenAt` (string), `title` (string), `url` (string), `username` (string)

```bash
curl "https://api.hoshime.com/v1/lichess/user?username=DrNykterstein" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lichess/topPlayers

The highest rated players of one speed or variant.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `perf` | string | no | Speed or variant. Defaults to blitz. (one of bullet, blitz, rapid, classical, ultraBullet, chess960, kingOfTheHill, threeCheck, antichess, atomic, horde, racingKings, crazyhouse; default blitz; e.g. blitz) |
| `limit` | integer | no | Items per page, 1 to 200. (default 10; e.g. 3) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `avatarUrl` (string), `bio` (string), `createdAt` (string), `followerCount` (integer (int64)), `followingCount` (integer (int64)), `id` (string), `name` (string), `postCount` (integer (int64)), `progress` (integer (int64)), `rating` (integer (int64)), `title` (string), `url` (string), `username` (string), `verified` (boolean)

```bash
curl "https://api.hoshime.com/v1/lichess/topPlayers?perf=blitz&limit=3" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lichess/tournaments

Current Lichess tournaments: created, started and recently finished.

Scope: `social:read` · Units: 1 · Cached: 1 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `finishesAt` (string), `id` (string), `minutes` (integer (int64)), `name` (string), `perf` (string), `players` (integer (int64)), `rated` (boolean), `startsAt` (string), `status` (string), `variant` (string)

```bash
curl "https://api.hoshime.com/v1/lichess/tournaments" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lichess/puzzleDaily

The puzzle of the day: its position, solution moves, themes and the game it comes from.

Scope: `social:read` · Units: 1 · Cached: 30 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `fen` (string), `id` (string), `initialPly` (integer (int64)), `pgn` (string), `plays` (integer (int64)), `rating` (integer (int64)), `solution` (string[]), `themes` (string[])

```bash
curl "https://api.hoshime.com/v1/lichess/puzzleDaily" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lichess/puzzle

One Lichess puzzle by its five-character id: its position, solution moves and themes.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Lichess puzzle id, such as u52YY. (e.g. u52YY) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `fen` (string), `id` (string), `initialPly` (integer (int64)), `pgn` (string), `plays` (integer (int64)), `rating` (integer (int64)), `solution` (string[]), `themes` (string[])

```bash
curl "https://api.hoshime.com/v1/lichess/puzzle?id=u52YY" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lichess/liveStreamers

Lichess streamers who are live now, with the service they stream on and the stream language.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `headline` (string), `language` (string), `name` (string), `service` (string), `status` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/lichess/liveStreamers" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lichess/ratingHistory

A player's rating history in every speed and variant, one point per day the rating changed.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Lichess username. (e.g. DrNykterstein) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `perf` (string), `points` (RatingPoint[]), `points[].date` (string), `points[].rating` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/lichess/ratingHistory?username=DrNykterstein" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lichess/activity

A player's recent activity, interval by interval: follows gained and given.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Lichess username. (e.g. DrNykterstein) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `end` (string), `followedBy` (integer (int64)), `following` (integer (int64)), `start` (string)

```bash
curl "https://api.hoshime.com/v1/lichess/activity?username=DrNykterstein" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lichess/usersStatus

Up to 50 Lichess users by username in one call: title, patron status and online state.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `ids` | string | yes | Comma-separated Lichess usernames, 50 at most. (e.g. DrNykterstein,nihalsarin2004) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `name` (string), `patron` (boolean), `title` (string)

```bash
curl "https://api.hoshime.com/v1/lichess/usersStatus?ids=DrNykterstein%2Cnihalsarin2004" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lichess/team

A Lichess team by its id: its name, description, member count and leader.

Scope: `social:read` · Units: 1 · Cached: 360 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Lichess team id, such as lichess-swiss. (e.g. lichess-swiss) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `description` (string), `id` (string), `leader` (string), `members` (integer (int64)), `name` (string)

```bash
curl "https://api.hoshime.com/v1/lichess/team?id=lichess-swiss" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lichess/crosstable

The head-to-head score of two Lichess players and the number of games they played.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `user1` | string | yes | First Lichess username. (e.g. DrNykterstein) |
| `user2` | string | yes | Second Lichess username. (e.g. nihalsarin2004) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `gamesCount` (integer (int64)), `score1` (number (double)), `score2` (number (double)), `user1` (string), `user2` (string)

```bash
curl "https://api.hoshime.com/v1/lichess/crosstable?user1=DrNykterstein&user2=nihalsarin2004" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lichess/userGames

The most recent games of a Lichess player, newest first: players, ratings, result, opening and time control.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Lichess username. (e.g. DrNykterstein) |
| `limit` | integer | no | Items per page, 1 to 100. (default 10; e.g. 3) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `black` (GamePlayer), `black.name` (string), `black.rating` (integer (int64)), `black.ratingDiff` (integer (int64)), `createdAt` (string), `eco` (string), `id` (string), `incrementSeconds` (integer (int64)), `initialSeconds` (integer (int64)), `opening` (string), `rated` (boolean), `speed` (string), `status` (string), `url` (string), `variant` (string), `white` (GamePlayer), `white.name` (string), `white.rating` (integer (int64)), `white.ratingDiff` (integer (int64)), `winner` (string)

```bash
curl "https://api.hoshime.com/v1/lichess/userGames?username=DrNykterstein&limit=3" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lichess/cloudEval

Stockfish evaluation of a chess position from the Lichess cache: the best lines with their score and depth. Only positions someone already analysed are cached.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `fen` | string | yes | Chess position in FEN, such as rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1. (e.g. rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1) |
| `multiPv` | integer | no | Number of lines, from 1 to 5. (default 1) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `depth` (integer (int64)), `fen` (string), `knodes` (integer (int64)), `lines` (EvalLine[]), `lines[].centipawns` (integer (int64)), `lines[].mate` (integer (int64)), `lines[].moves` (string)

```bash
curl "https://api.hoshime.com/v1/lichess/cloudEval?fen=rnbqkbnr%2Fpppppppp%2F8%2F8%2F4P3%2F8%2FPPPP1PPP%2FRNBQKBNR+b+KQkq+e3+0+1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lichess/broadcasts

Chess broadcasts being played on Lichess now: the tournament, the round in progress and its link.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 50. (default 10; e.g. 3) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `round` (string), `startsAt` (string), `tournament` (string), `tournamentId` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/lichess/broadcasts?limit=3" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
