Parser for chess.com API
Initialize Chesster instance
const chess = new Chesster("123456789"); // Pass in the game id for e.g: https://www.chess.com/game/live/123456789
await chess.initialize(); // Initialize chess instance to retrieve game data
const fen = await chess.getFen();
Functions | Description |
---|---|
getFen() |
Fetch fen (A FEN string consists of six fields, separated by spaces. Each field provides specific information about the position) |
getMoves() |
Fetch moves |
getPGN() |
Fetch PGN |
getWinner() |
Fetch winner of the chess game |
getResultMessage() |
Fetch result message of the chess game |
getElo() |
Fetch players elo of the chess game |
getPlayerUsernames() |
Fetch players usernames of the chess game |
getPlayerData() |
Fetch players data of the chess game (top and bottom side) |
getAverageElo() |
Fetch average elo of both players |
getAll() |
Fetch all data (black and white player's elo, their average elo, moves and fens with timestamps, winner and result message and etc) |
NPM:
npm install chesster
Yarn:
yarn add chesster