← back to the ladder
RulesAPI

The web API

Reads are open. Writes need Authorization: Bearer <api-token>; the dashboard shows your token while you are signed in. Sign-in is a browser flow at /login, with GitHub. Times are unix seconds. Errors are {"error":"why"} with status 400, or 401 when the token is missing or bad.

GET /api/state

Everything the dashboard shows.

200: answers a State.

GET /api/game

One game, replayable.

ParamType
filestringA history row's file plus ".moves"
nintegerGame index within the file, from 0

200: answers a Game.

Refused with 400.

POST /api/submit

Submit an entry. Needs your token.

ParamType
namestringYour entry's ladder name. Yours once accepted.
kindtarball

Body (application/gzip): The entry source as .tar.gz: git archive HEAD:entries/example --format=tar.gz

200: Queued; poll /api/job, or watch your entries in /api/state.

FieldType
jobinteger
queuedboolean

Refused with 400, 401.

GET /api/job

One submitted build.

ParamType
idintegerFrom /api/submit's answer

200: answers a Job.

Refused with 400.

POST /api/token

Rotate your API token. The old token stops working immediately. Needs your token.

200: The fresh token.

FieldType
tokenstring

Refused with 401.

POST /api/logout

End the browser session.

302: Session cookie cleared, redirect to /.

GET /results/{file}

Raw match records.

ParamType
filestringA .txt, .pgn or .moves filename that history names

200: The file.

Refused with 404.

GET /api/engine

One engine's aggregate record.

ParamType
namestring

200: answers a EngineStats.

Refused with 400.

GET /api/play

One casual move against an engine. Replays moves from the start position and answers with the engine's reply. Rate-limited per address; positions are only reachable by playing to them. Never rated.

ParamType
enginestring
movesstringComma-separated UCI moves from the start position

200: answers a PlayReply.

Refused with 400, 429.

Objects

State

FieldType
bookBook
leaderboardLeaderboard
history[MatchRow]
entries[Submission]Your entries and in-flight submissions, newest first; empty signed out
userstring?
tokenstring?
github_loginbooleanWhether GitHub sign-in is configured

Book

FieldType
checksumstring
openingsinteger

Leaderboard

FieldType
rows[Standing]
excluded[string]Result sets left out of the fit, with the reason
pairingsinteger
anchorstring?The entry rated 0

Standing

FieldType
namestring
elonumber
errnumberHalf-width of the 95% interval; negative when it cannot be estimated
gamesinteger
opponentsinteger
groupinteger0 is the main group; other groups are not comparable with it
ownerstring?The submitter: a GitHub login, a ~guest, or null for house engines
submittedinteger?When the standing build was accepted; resubmission resets it

MatchRow

FieldType
filestring
astring
bstring
gamesinteger
cycles_ainteger
cycles_binteger
scorenumberPoints percentage for a
elonumber?Null when every game went one way
errnumberNegative when it cannot be estimated
bookstring
wheninteger
pgnstring?Filename for /results/

Job

FieldType
idinteger
statequeued | running | done | failed
logstringLive while running, final afterwards

Submission

FieldType
namestring
statequeued | building | accepted | rejected
wheninteger
bytesinteger?The standing accepted build's size, when one exists
logstring?The build log's tail: live while building, the reason when rejected

Game

FieldType
result1-0 | 0-1 | 1/2-1/2 | *
countintegerGames in the file
frames[Frame]One per ply; frame 0 is the opening position
cycles[integer]Spent per ply; empty for old records
budgetintegerCycles allowed per move
whitestring?Who has the white pieces; null for records the database no longer names
blackstring?
endedstring?Why it ended: checkmate, a draw's reason, or the forfeit's; null for unfinished games

Frame

FieldType
fenstring
sanstringEmpty on frame 0
fromintegerSquare index, 0 = a1, 63 = h8; absent on frame 0
tointegerAbsent on frame 0

EngineStats

FieldType
namestring
ownerstring?The submitter: a GitHub login, a ~guest, or null for house engines
submittedinteger?When the standing build was accepted; resubmission resets it
ratingobject?Null while unrated
rankinteger?Within the main group
ofintegerRated engines in the main group
gamesinteger
winsinteger
drawsinteger
lossesinteger
avg_pliesnumber
head_to_head[HeadToHead]
recent[RecentMatch]Newest first, at most 20

HeadToHead

FieldType
opponentstring
gamesinteger
scorenumberThis engine's share of the points, 0 to 1

RecentMatch

FieldType
opponentstring
gamesinteger
scorenumberPercent, for this engine
wheninteger
filestringTag; append ".moves" for /api/game

PlayReply

FieldType
engine_movestring?UCI; absent when the game was already over
sanstring?
cyclesinteger?What the move cost the engine
fenstring
resultstring?Null while the game is ongoing
notestring?Why the engine forfeited, when it did
checkbooleanWhether the side to move stands in check

This page is rendered from openapi.json.