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.

Try it
Ready-made, maintained by usRecords, 14 fieldsv1.0

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

Positions
Board positions as FEN text, such as the position after 1.e4. Up to 50 per run. One per line, or separated by commas.
Example: rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1
Maximum movesoptional
The most candidate moves to return for each position, from 1 to 50.
Example: 12

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
Endpoint
POSThttps://pullrow.dev/v1/apis/lichess-opening-explorer/run
  • Small runs answer in the same request; longer ones answer 202 with a run to poll.
  • fields returns only the fields you name. The examples send the ones picked on this page.
  • Idempotency-Key is optional. A retry with it is never charged twice.
  • You pay for records returned. Zero records cost zero.

Every run option, explained

Calling it needs a key
10,000 free records of this API to start. No card.
curl
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.

positionslistrequired
Board positions as FEN text, such as the position after 1.e4. Up to 50 per run.
example: rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1
max_movesnumber
The most candidate moves to return for each position, from 1 to 50.
example: 12

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 nameTypeShown on this page asFilled
fentextFen3 of 3
move_ucitextMove uci3 of 3
move_santextMove san3 of 3
gamesnumberGames3 of 3
white_winsnumberWhite wins3 of 3
drawsnumberDraws3 of 3
black_winsnumberBlack wins3 of 3
white_pctnumberWhite (%)3 of 3
draw_pctnumberDraw (%)3 of 3
black_pctnumberBlack (%)3 of 3
average_ratingnumberAverage rating3 of 3
position_gamesnumberPosition games3 of 3
opening_ecotextOpening eco3 of 3
opening_nametextOpening name3 of 3

How it reads the site

Runs on a reader we built and maintain by hand for this site.

Sample records

Sample records
RecordFenMove uciMove sanGamesWhite winsDrawsBlack winsWhite (%)Draw (%)Black (%)Average ratingPosition gamesOpening ecoOpening name
1rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1c7c5c5627,286194,269273,851159,16631%43.7%25.4%2,3961,368,125B20Sicilian Defense
2rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1e7e5e5332,63594,478172,90465,25328.4%52%19.6%2,4051,368,125C20King's Pawn Game
3rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1e7e6e6158,33655,13865,58637,61234.8%41.4%23.8%2,3841,368,125C00French 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.
Known limits
  • 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.