CallMeQan / chess-com-pubapi-java-wrapper

Java wrapper for Chess.com's public data API (PubAPI)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chess.com PubAPI Wrapper for Java

javadoc Maven Central

A Java wrapper for Chess.com's public data API (PubAPI)

Quick Start

Follow these directions to get up-and-running with the Chess.com API wrapper.

Add dependencies to Maven/Gradle

To get started, add chesscom-pubapi-wrapper to your project's dependencies.

Sorry but mine is just a fork from main repo, which only has .jar file

Create a new client

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());
    }
}

About

Java wrapper for Chess.com's public data API (PubAPI)

License:Apache License 2.0


Languages

Language:Java 100.0%