Chess Opening Statistics API
Opening statistics for any chess position (FEN) from the Lichess masters database: each candidate move with games played, white wins, draws, black wins, win percentages, average player rating and the opening name.
$0.50 per 1,000 records
You pay only for the records you get. Zero records cost zero. 10,000 free records of this API to start (5,000 at the base price of $1 per 1,000), no card.
Data from explorer.lichess.ovh/masters
Get this data
Try it here with a few records, download the sample, fill a Google Sheet, or call it from your own code.
Try it
Run it on this page, or call it from your code with the endpoint in the developer section. A free key covers 10,000 records of this API, no card. Create a free key
For developers: the API and MCPThe endpoint, code in curl, JavaScript and Python, every input, and files for your tools
- Small runs answer in the same request; longer ones answer
202with a run to poll. fieldsreturns only the fields you name. The examples send the ones picked on this page.Idempotency-Keyis optional. A retry with it is never charged twice.- You pay for records returned. Zero records cost zero.
curl -X POST "https://pullrow.dev/v1/apis/lichess-opening-explorer/run" \
-H "Authorization: Bearer $PULLROW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"positions": [
"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1"
]
},
"max_items": 50
}'Inputs
Send them as input in the request body. Leave one out to use its default.
What's in each record
14 fields.
Basics
- Fen
The position asked about, as given.
Example rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1
- Move uci
The move in coordinate form, such as c7c5.
Example c7c5
- Move san
The move in standard notation, such as c5.
Example c5
- Games
Games in which this move was played.
Example 627,286
- White wins
Games White won after this move.
Example 194,269
- Draws
Games drawn after this move.
Example 273,851
- Black wins
Games Black won after this move.
Example 159,166
- White (%)
Percent of games White won.
Example 31%
- Draw (%)
Percent of games drawn.
Example 43.7%
- Black (%)
Percent of games Black won.
Example 25.4%
- Average rating
Average rating of the players who played the move.
Example 2,396
- Position games
Total games that reached the position.
Example 1,368,125
- Opening eco
ECO code of the opening after the move, such as B20.
Example B20
- Opening name
Name of the opening after the move, such as Sicilian Defense.
Example Sicilian Defense
Technical detailsField names and types for developers
Field names and types
The names your code reads in each record. "Filled" counts how many of the 3 sample records carry the field.
| Field name | Type | Shown on this page as | Filled |
|---|---|---|---|
fen | text | Fen | 3 of 3 |
move_uci | text | Move uci | 3 of 3 |
move_san | text | Move san | 3 of 3 |
games | number | Games | 3 of 3 |
white_wins | number | White wins | 3 of 3 |
draws | number | Draws | 3 of 3 |
black_wins | number | Black wins | 3 of 3 |
white_pct | number | White (%) | 3 of 3 |
draw_pct | number | Draw (%) | 3 of 3 |
black_pct | number | Black (%) | 3 of 3 |
average_rating | number | Average rating | 3 of 3 |
position_games | number | Position games | 3 of 3 |
opening_eco | text | Opening eco | 3 of 3 |
opening_name | text | Opening name | 3 of 3 |
How it reads the site
Runs on a reader we built and maintain by hand for this site.
Save as pipeline
A pipeline remembers this API, your inputs and the fields you picked. It can run on a schedule and email you the results.
Sample records
| Record | Fen | Move uci | Move san | Games | White wins | Draws | Black wins | White (%) | Draw (%) | Black (%) | Average rating | Position games | Opening eco | Opening name |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1 | c7c5 | c5 | 627,286 | 194,269 | 273,851 | 159,166 | 31% | 43.7% | 25.4% | 2,396 | 1,368,125 | B20 | Sicilian Defense |
| 2 | rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1 | e7e5 | e5 | 332,635 | 94,478 | 172,904 | 65,253 | 28.4% | 52% | 19.6% | 2,405 | 1,368,125 | C20 | King's Pawn Game |
| 3 | rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1 | e7e6 | e6 | 158,336 | 55,138 | 65,586 | 37,612 | 34.8% | 41.4% | 23.8% | 2,384 | 1,368,125 | C00 | French Defense |
Sample records from the example output this API publishes. Email addresses and phone numbers in them are masked. Hover over a column name to see the field name your code reads.
Reliability
Counted from real runs. Our own health checks are left out. A run succeeded when it finished and the site neither blocked it nor broke it.
Incidents and repairs
How it is kept working What a repair can't do
A ready-made API, maintained by us. It is not part of the daily check or the automatic rebuild yet.
- You pay only for records returned. A run that returns none costs nothing.
- Covers the masters database only: over-the-board games of strong players, so rare positions may have no moves at all.
- At most 50 candidate moves per position, most played first; positions that never occurred return no records.
- One request per position, sent one at a time and spaced out; large lists of positions take a while. If the source asks to slow down, the run stops early with the records saved so far.
- Game data is released under CC0 by Lichess; no credit is required but it is appreciated.
- The opening name is the one for the position after the move; it is empty when the position is outside known openings.
Version history
A run uses the live version unless the request names another one with version.
Manage this API
Only your workspace sees this part.
Automatic repair
Off: a rebuilt version is stored and waits for you in the version history.
Delete this API
Removes the API, its versions and the saved records of its runs. Calls to its address then answer 404. Records already charged stay charged. This cannot be undone.