canonical: https://jentic.com/apis/lichess.org/lichess

# Lichess API

The Lichess API reads and controls activity on the free, open-source Lichess chess server. It covers account and preferences, game archives and live streams, the Board and Bot play interfaces, puzzles, studies and broadcasts, arena and Swiss tournaments, teams, the opening explorer, and the endgame tablebase.

## For AI agents

Read Lichess accounts, games, puzzles, studies, and tournaments, and play moves through the Board and Bot interfaces.

## Scope

Does not process payments, host video, or provide chess engine hosting for third parties. Use for reading and controlling activity on the Lichess chess server only.

## Capabilities

- Read a player's account, preferences, and activity
- Stream and export games from the Lichess archive
- Play moves through the Board and Bot interfaces
- Read puzzles, studies, and broadcast data
- Query the opening explorer and endgame tablebase

## Use cases

### Agent-driven game analysis through Jentic

An AI agent coaching a player can export their recent games and look up the openings they reached in the explorer. Through Jentic the agent discovers each operation by intent and loads its schema, so it can gather the material for analysis without hand-wiring the Lichess endpoints.

Example prompt: Search Jentic for 'export a player's games', pull a user's recent games, and look up the resulting openings in the explorer.

### Bot play through the Bot interface

Run a chess bot that accepts challenges and plays moves through the Bot interface. Lichess exposes dedicated Board and Bot play interfaces with OAuth2 scopes, so a bot account can stream game state and respond move by move.

Example prompt: Stream an ongoing game's state and submit the bot's next move through the Bot interface.

### Opening and endgame reference lookups

Look up positions in the opening explorer and query the endgame tablebase for exact results with few pieces on the board. Both are read surfaces that need no account, so an agent can reference them freely while analysing.

Example prompt: Query the opening explorer for a position, then check the endgame tablebase for the best move in a simplified position.

## Key resources

- **Games** — Archived and live games, exportable and streamable
- **Play interfaces** — Board and Bot interfaces for playing moves
- **Reference** — Opening explorer and endgame tablebase lookups

## Why Jentic

- **Setup:** Wiring Lichess by hand means completing its OAuth2 flow, choosing the right scopes, and handling streamed game responses yourself. Through Jentic you install once, import Lichess from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Lichess issues OAuth2 tokens with granular scopes, and a Jentic rule limits which operations your agent may call on top of them. You choose the operations it may call, such as reading games and querying the explorer, so posting messages is not included unless you add it.
- **Credential handling:** Your Lichess OAuth2 token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'export a player's games' or 'query the opening explorer', and Jentic returns the matching Lichess operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Riot Games API** — Player and match data for Riot's competitive games
- **IGDB** — Games database with titles, genres, and metadata
- **FreeToGame** — Catalogue of free-to-play games

## FAQ

### What authentication does the Lichess API use?

The Lichess API uses OAuth2 per its OpenAPI spec, with granular scopes such as board play and study read that limit what a token can do. Public data can be read without a token. Through Jentic the token is stored encrypted by your own Jentic One instance and injected at request time.

### Is there a Lichess API MCP server?

You don't need an MCP server to give your agent the Lichess API. Jentic connects it directly from the API Directory: import it, store your credential once, and your agent calls it on demand without loading another server's tool definitions into its context.

### Can I play moves with the Lichess API?

Yes. The Board and Bot interfaces let an account stream a game's state and submit moves as the game progresses, with the Bot interface reserved for accounts upgraded to bot status.

### What are the rate limits for the Lichess API?

The OpenAPI spec does not state numeric rate limits, and Lichess asks clients to pace requests and back off on error responses. Check the Lichess documentation at https://lichess.org/api for current guidance.

### Can I limit what my agent is allowed to do with the Lichess API?

Yes. Lichess issues OAuth2 tokens with granular scopes, and a Jentic rule further limits which operations your agent may call. Allow only the read operations it needs, such as exporting games and querying the explorer, so it cannot post messages or manage teams unless you add those operations.

### How do I export a player's games with the Lichess API through Jentic?

Search Jentic for 'export a player's games', load the game-export operation, and pass the username and filters. Jentic streams the games back to your agent. To run it on your own infrastructure, install Jentic One from its GitHub repo.
