A Go implementation of Lichess's API
package main
import (
"fmt"
"github.com/chrisbarnes2000/lichess"
"log"
"net/http"
"net/url"
)
func main() {
baseURL, err := url.Parse("https://lichess.org")
if err != nil {
log.Fatal(err)
}
client := new(lichess.Client)
client.BaseURL = baseURL
client.APIKey = "<API Key>"
client.UserAgent = "Golang Client"
client.HttpClient = new(http.Client)
user, err := client.GetProfile()
if err != nil {
log.Fatal(err)
}
fmt.Println(user.ID)
}
- First, Create an API Token from here
- Second, fork this repo,
- Third, run these commands to clone it locally and get started
# Clone and CD into/Open this project
$ git clone [email protected]:YOUR_GITHUB_USERNAME/lichess.git && cd lichess
# Create a .env file to hold our secrets
$ touch .env > LICHESS_TOKEN=YOUR_API_TOKEN
# Download & Install the dependancies. Then Compile the program
$ go build
# Run the program locally
$ go run lichess.go
- Accounts
- GetProfile API Docs, location in our code
- GetEmail API Docs, location in our code
- GetPreferences API Docs, location in our code
- GetKidModeStatus API Docs, location in our code
- SetKidModeStatusAPI Docs, location in our code
- Unit Testing location in our code
- Users
- GetRLUsersStatus API Docs, location in our code
- GetTopPlayers API Docs, location in our code
- GetLeaderboard API Docs, location in our code
- GetUserPublicData API Docs, location in our code
- GetPlayerHistory API Docs, location in our code
- GetPlayerActivity API Docs, location in our code
- GetPlayerByID API Docs, location in our code
- GetTeamMembers API Docs, location in our code
- GetLiveStream API Docs, location in our code
- GetCrossTable API Docs, location in our code
- Unit Testing location in our code
- Relations
- GetFollowing API Docs, location in our code
- GetFollowers API Docs, location in our code
- Unit Testing location in our code
- Games
- ExportOneGame API Docs, location in our code
- ExportOngoingGame API Docs, location in our code
- ExportGames API Docs, location in our code
- ExportGameByID API Docs, location in our code
- StreamCurrentGames API Docs, location in our code
- GetOngoingGames API Docs, location in our code
- GetCurrentTvGames API Docs, location in our code
- StreamCurrentTvGame API Docs, location in our code
- StreamMovesFromGame API Docs, location in our code
- ImportOneGame API Docs, location in our code
- Unit Testing location in our code
- Puzzles
- GetDailyPuzzle API Docs, location in our code
- GetPuzzleActivity API Docs, location in our code
- GetPuzzleDashboard API Docs, location in our code
- GetStormDashboard API Docs, location in our code
- Unit Testing location in our code
- Teams
- GetTeamSwissTournaments API Docs, location in our code
- GetSingleTeam API Docs, location in our code
- GetPopularTeams API Docs, location in our code
- TeamsofPlayer API Docs, location in our code
- SearchTeams API Docs, location in our code
- GetMembersofTeam API Docs, location in our code
- GetTeamArenaTournaments API Docs, location in our code
- JoinTeam API Docs, location in our code
- LeaveTeam API Docs, location in our code
- KickFromTeam API Docs, location in our code
- MessageAllTeamMembers API Docs, location in our code
- Unit Testing location in our code
- Board
- StreamIncomingEvents API Docs, location in our code
- CreateSeek API Docs, location in our code
- StreamBaordGameState/GetBoardGameState API Docs, location in our code
- MakeBoardMove API Docs, location in our code
- WriteInChat API Docs, location in our code
- AbortGame API Docs, location in our code
- ResignGame API Docs, location in our code
- HandleDrawOffers API Docs, location in our code
- Unit Testing location in our code
- Chessbot
- StreamIncomingEvents API Docs, location in our code
- UpgradeToBotAccount API Docs, location in our code
- StreamBotGameState API Docs, location in our code
- MakeBotMove API Docs, location in our code
- BotWriteInChat API Docs, location in our code
- BotAbortGame API Docs, location in our code
- BotResginGame API Docs, location in our code
- Unit Testing location in our code
- Challenges
- CreateChallenge API Docs, location in our code
- AcceptChallenge API Docs, location in our code
- DeclineChallenge API Docs, location in our code
- CancelChallenge API Docs, location in our code
- ChallengeTheAI API Docs, location in our code
- OpenEndedChallenge API Docs, location in our code
- StartClocks API Docs, location in our code
- AddToOpponentClock API Docs, location in our code
- CreateAdminChallenge API Docs, location in our code
- Unit Testing location in our code
- Bulk Pairings
- ViewUpcomingBulkPairings API Docs, location in our code
- CreateBulkPairing API Docs, location in our code
- ManuallyStartClocks API Docs, location in our code
- CancelBulkPairing API Docs, location in our code
- Unit Testing location in our code
- Arena Tournaments
- GetCurrentArenaTournaments API Docs, location in our code
- CreateArenaTournament API Docs, location in our code
- GetArenaTournamentInfo API Docs, location in our code
- UpdateArenaTournament API Docs, location in our code
- JoinArenaTournament API Docs, location in our code
- TerminateArenaTournament API Docs, location in our code
- UpdateTeamBattle API Docs, location in our code
- ExportArenaTournamentGames API Docs, location in our code
- GetArenaTournamentResults API Docs, location in our code
- GetTeamStandingFromArenaTournament API Docs, location in our code
- GetArenaTournamentsCreatedByUser API Docs, location in our code
- GetTeamArenaTournaments API Docs, location in our code
- Unit Testing location in our code
- Swiss Tournaments
- CreateSwissTournament API Docs, location in our code
- TerminateSwissTournament API Docs, location in our code
- ExportTRFSwissTournament API Docs, location in our code
- ExportGameFromSwissTournament API Docs, location in our code
- GetSwissTournamentResults API Docs, location in our code
- GetTeamSwissTournaments API Docs, location in our code
- Unit Testing location in our code
- Simuls
- GetCurrentSimuls API Docs, location in our code
- Unit Testing location in our code
- Studies
- ExportOneStudyChapter API Docs, location in our code
- ExportAllChapters API Docs, location in our code
- ExportAllStudieFromUser API Docs, location in our code
- Unit Testing location in our code
- Messaging
- SendPrivateMessage API Docs, location in our code
- Unit Testing location in our code
- Broadcasts
- GetOfficialBroadcasts API Docs, location in our code
- CreateBroadcast API Docs, location in our code
- GetBroadcast API Docs, location in our code
- UpdateBroadcast API Docs, location in our code
- PushPNGToBroadcast API Docs, location in our code
- Unit Testing location in our code
- Analysis
- GetCloudEvaluation API Docs, location in our code
- Unit Testing location in our code
- Open Explorer
- MasterGames API Docs, location in our code
- LichessGames API Docs, location in our code
- OTBMasterGames API Docs, location in our code
- OpeningExplorerStats API Docs, location in our code
- Unit Testing location in our code
- Tablebase
- TablebaseLookup API Docs, location in our code
- TablebaseLookupForAtomicChess API Docs, location in our code
- TablebaseLookupForAntiChess API Docs, location in our code
- Unit Testing location in our code
- OAuth
- GetPuzzleActivity API Docs, location in our code
- GetPuzzleDashBoard API Docs, location in our code
- GetProfile API Docs, location in our code
- GetEmail API Docs, location in our code
- GetPreferences API Docs, location in our code
- GetKidModeStatus API Docs, location in our code
- SetKidModeStatus API Docs, location in our code
- ExportGames API Docs, location in our code
- GetOngoingGames API Docs, location in our code
- ImportOneGame API Docs, location in our code
- ExportAllStudieFromUser API Docs, location in our code
- CreateBroadcast API Docs, location in our code
- GetBroadcast API Docs, location in our code
- UpdateBroadcast API Docs, location in our code
- PushPNGToBroadcast API Docs, location in our code
- JoinTeam API Docs, location in our code
- LeaveTeam API Docs, location in our code
- KickFromTeam API Docs, location in our code
- MessageAllTeamMembers API Docs, location in our code
- Unit Testing location in our code
- Client
- newRequest API Docs, location in our code
- do API Docs, location in our code
- Unit Testing location in our code
Ideas For Tournament Main Code
Afetr setting things up for the Chess club at MakeSchool to compete and learn from eachother I have noticed these features are missing from the tournament sections of lichess.org and will be looking into how one mighth add these
- Ability to Kick/Pause Members
- Ability to Invite people you follow
- Ability to Pick who you compete against
- Ability to Change How Matches are paird up
- Ability to Link to Twitter/Twitch/Discord/Slack Group Channel for voice/disscussion
- Dispay Tournaments you've joined via quick button on mobile and desktop versions