Chess Gallery Game Reference API

API for getting game details for millions of chess games.

API End Points

The end point for connecting : If you subscribe directly from us use this endpoint.
	http://chess.rest/gameref
	

Ratelimiting

Our Chess Gallery Game Reference API is private. To maintain our service level we ratelimit the number of API calls. For paid plans this limit is increased according to the service level described in the plan.

Authentication

For public calls you don't need to pass any API key. Just invoke the endpoint (see examples below). For paid subscriptions you need to pass the API key.

Currently we support API Key based authentication. Please set a request header 'X-Chess-Api-Secret' with value of your API key. Alternatively you can also pass api_key= as a request parameter, though we strongly discourage this mode of passing the key.

This page just serves as a high level reference doc. For full upto date API documentation visit http://chess.rest/gameref/

Get the Game details for the given game id private ratelimited

POST/game

Get the game details for the given game id.

Parameters
Parameter NameParameter TypeDescription
idstringGame id string
output
The result is json response with the details.

Here is an example of getting the game details using CURL
 
        curl -v  -i -X POST  -H 'X-Chess-Api-Secret: <api_key>'  -d id=__bxTnllmGC3Xo2nNsop5QeF http://chess.rest/gameref/game.json
      
The above call will produce a response like this.
{
    "success": {
        "total": "1"
    },
    "contents": {
        "game": {
            "id": "__bxTnllmGC3Xo2nNsop5QeF",
            "event": "?",
            "site": "?",
            "game_date": "1999-00-00",
            "game_year": "1999",
            "round": null,
            "player_white": "Krahl, Wolfgang",
            "player_black": "Gerwert, Thomas",
            "result": "0-1",
            "player_whiteelo": null,
            "player_blackelo": null,
            "player_whiteuscf": null,
            "player_blackuscf": null,
            "player_whitena": null,
            "player_blackna": null,
            "player_whitetype": null,
            "player_blacktype": null,
            "event_date": "1999-00-00",
            "event_sponsor": null,
            "event_section": null,
            "event_stage": null,
            "event_board": null,
            "open_opening": null,
            "open_varation": null,
            "open_subvariation": null,
            "open_eco": "A20",
            "open_nic": null,
            "time_time": null,
            "time_utctime": null,
            "time_utcdate": null,
            "time_timecontrol": null,
            "startpos_setup": null,
            "startpos_fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
            "end_termination": null,
            "annotator": null,
            "mode": null,
            "plycount": "42"
        }
    }
}
      

Get the PGN test for a given game private ratelimited

POST/pgn

Get the PGN (Portable Game Notation) for the given game id.

Parameters
Parameter NameParameter TypeDescription
idstringGame id string
output
The result is json response with the details.

Here is an example of getting the game pgn using CURL
 
        curl -v  -i -X POST  -H 'X-Chess-Api-Secret: <api_key>'  -d id=__bxTnllmGC3Xo2nNsop5QeF http://chess.rest/gameref/pgn.json
      

Sample json response

{
    "success": {
        "total": "1"
    },
    "contents": {
        "pgn": "[Event \"?\"]\r\n[Site \"?\"]\r\n[Date \"1999.??.??\"]\r\n[Round \"?\"]\r\n[White \"Krahl, Wolfgang\"]\r\n[Black \"Gerwert, Thomas\"]\r\n[Result \"0-1\"]\r\n[ECO \"A20\"]\r\n[EventDate \"1999.??.??\"]\r\n[PlyCount \"42\"]\r\n\r\n1.c4 e5 2.a3 a5 3.Nc3 Nc6 4.Qa4 d6 5.Nd5 Bd7 6.e4 Nd4 7.Qd1 c6 8.Nc3 Nf6 \r\n9.d3 b5 10.Bg5 bxc4 11.dxc4 Be7 12.g3 Rb8 13.Rb1 h6 14.Bxf6 Bxf6 15.f4 \r\nexf4 16.gxf4 Bh4+ 17.Kd2 Qb6 18.Na4 Nb3+ 19.Kc2 Qe3 20.Qxd6 Nd4+ 21.Kd1 \r\nQe1# 0-1"
    }
}
      

Get a random chess game private ratelimited

POST/random

Get random game from the chess.gallery database.

Parameters
Parameter NameParameter TypeDescription
output
The result is json response with the details.

Here is an example of getting a random game using CURL
 
        curl -v  -i -X POST  -H 'X-Chess-Api-Secret: <api_key>'   http://chess.rest/gameref/random.json
      

Sample response

{
    "success": {
        "total": 1
    },
    "contents": {
        "games": [
            {
                "id": "R1eI25TEQStkTdnJytXJEgeF",
                "player_white": "Kristiansson, Olafur",
                "player_black": "Amos Bruce M",
                "result": "1/2-1/2"
            }
        ]
    }
}
      

Search for Player names private ratelimited

POST/player/search

Search player names.

Parameters
Parameter NameParameter TypeDescription
namestringName of the player. Full Name is not required.
output
The result is json response with the details.

Here is an example of searching player names using CURL
 
curl -v -i -X POST  -H 'X-Chess-Api-Secret: <ap_key>'   -d name=Kristi http://chess.rest/gameref/player/search.json 
      

Sample response

{
    "success": {
        "total": "253",
        "start": 0,
        "limit": 5
    },
    "contents": {
        "players": [
            {
                "id": "ZoUPHHicbDbuBdvHgBnyvweF",
                "name": "Aandal, Kristian"
            },
            {
                "id": "zaHIO3vAtaAv_urNLguDBweF",
                "name": "Adondaki, Kristina"
            },
            {
                "id": "vZZpbjC_M3_qRU5cxKkvfweF",
                "name": "Ahonen, Kristian"
            },
            {
                "id": "BCQ1jQdZ2wo8puIcXlmH6geF",
                "name": "Apanaviciute, Kristina"
            },
            {
                "id": "K47hrLX_1y6iJk3Fr2TL_AeF",
                "name": "Apulcheva, Kristina"
            }
        ]
    }
}
      

Subscribe

Chess Game Reference API Basic

$9.99/mo

No contracts. Anytime cancellation.
1 API Key
2000 API Calls / day
Best in class backend tools
Easy to use REST API
Immediate provisioning

Chess Game Reference API Premium

$24.99/mo

No contracts. Anytime cancellation.
1 API Key
5000 API Calls / day
Best in class backend tools
Easy to use REST API
Immediate provisioning

Chess Game Reference API Ultra

$49.99/mo

No contracts. Anytime cancellation.
1 API Key
15000 API Calls / day
Best in class backend tools
Easy to use REST API
Immediate provisioning