Games

Import one game

Import a game from PGN. See https://lichess.org/paste. Rate limiting: 200 games per hour for OAuth requests, 100 games per hour for anonymous requests. To broadcast ongoing games, consider pushing to a broadcast instead. To analyse a position or a line, just construct an analysis board URL (most standard tags supported if URL-encoded): https://lichess.org/analysis/pgn/e4_e5_Nf3_Nc6_Bc4_Bc5_Bxf7+

post/api/import

Request

  • Base URL
    https://lichess.org
  • URL
    https://lichess.org/api/import
  • Auth
    OAuth 2
    Authorization code: https://lichess.org/oauth
    Token URL: https://lichess.org/api/token

Request body application/x-www-form-urlencoded

pgnstring

The PGN. It can contain only one game. Most standard tags are supported.

Response

The game was successfully imported.

idstring

The game ID

urlstring uri

The game URL

Changes

No recorded changes to this operation across all 16 revisions of this API.