API Client Configuration¶
DefaultApiClient is used to perform the actual HTTP requests. It also manages rate-limiting and retries.
If you need more functionality, you can subclass it. To use a custom client, set
default_client or use the
client parameter in each API method wrapper.
The base class for API exceptions.
ApiHttpError(http_status, url, response_text)¶
The class for API exceptions caused by an HTTP error code.
The default API client, with immediate HTTP calls and basic rate-limiting functionality.
The base lichess API URL.
This does not include the /api/ prefix, since some APIs don’t use it.
The maximum number of retries after rate-limiting before an exception is raised. -1 for infinite retries.
call(path, params=None, post_data=None, auth=None, format=<lichess.format._Json object>, object_type='public_api')¶
Makes an API call, prepending
base_urlto the provided path. HTTP GET is used unless
Consecutive calls use a 1s delay. If HTTP 429 is received, retries after a 1min delay.