← 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: /login (GitHub) or an invite's /welcome link. 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.

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

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

Frame

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

This page is rendered from openapi.json.