BestBook APIv1
Get a keybestbook.app

Errors and close codes

Connecting

Statuserror
400this API's sockets must be compressed: offer permessage-deflate (Sec-WebSocket-Extensions: permessage-deflate)
401an API key is required: ... / this API key is not recognised or is no longer active
429this key has all its sockets open: close one first
429this key is connecting too often: wait before the next connect, then keep the socket open (updates are pushed to it), with retry_after and a Retry-After header

Error messages

The socket stays open.

json

{"type":"error","sub":"game","message":"no such event"}
message
not JSON
op must be subscribe, unsubscribe or ping
id is required
id is longer than 64 characters
unknown field "..."
give a league or an event, not both
league: no such value "..."
types must be a list of strings
league must be a string
no such event
too many subscriptions on this connection
this key's plan does not include that league

Close codes

CodeReasonWhat to do
1001the server is restarting: reconnectConnect again straight away.
1002not a valid WebSocket frameFix the client.
1003text messages onlySend JSON as text.
1007the compressed message could not be readFix the client's compression.
1008this key is no longer activeUse your current key.
1009a message can be at most 64 kBSend smaller messages.
1013this connection fell too far behind: read faster or subscribe to lessRead faster, or subscribe to less.

A client that stops reading for 30 seconds is disconnected.