A Java wrapper for Chess.com's public data API (PubAPI)
Follow these directions to get up-and-running with the Chess.com API wrapper.
To get started, add chesscom-pubapi-wrapper
to your project's dependencies.
The API wrapper consists of different clients, which correspond to different API endpoints within Chess.com's PubAPI:
- ClubClient
- CountryClient
- DailyPuzzleClient
- LeaderboardsClient
- PlayerClient
- StreamersClient
- TeamMatchClient
- TournamentClient
A complete description of these clients is available in the Javadocs.
For our example, let's create a new PlayerClient to retrieve information about a player:
import io.github.sornerol.chess.pubapi.client.PlayerClient;
import io.github.sornerol.chess.pubapi.domain.player.Player;
import io.github.sornerol.chess.pubapi.exception.ChessComPubApiException;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws ChessComPubApiException, IOException {
PlayerClient client = new PlayerClient();
Player player = client.getPlayerByUsername("erik");
System.out.println(player.toString());
}
}