lichess-api
An asynchronous client library for the current lichess.org API with all endpoints supported.
Quick start
Add the dependencies:
[]
= "1.0"
= { = "1", = ["full"] }
Example request:
use LichessApi;
async
Authentication
Most endpoints require a bearer token but some don't. E.g. the daily puzzle, etc.
- Acting as yourself: generate a personal API
token and pass it to
LichessApi::newas above. - Acting on behalf of another user: Ensure the oauth feature is enabled and use the OAuth2 authorization code flow
with PKCE, via
AuthorizationUrlandPendingAuthorization.
Features
| Feature | Default | Description |
|---|---|---|
oauth |
yes | OAuth2 authorization code flow with PKCE, for acting on behalf of other users. |
CLI
--api-token/-a: for endpoints that require authentication.--json: pretty-printed JSON instead of Rust debug format.--verbose/-v: enable debug logging.
Run lichess --help or lichess <category> --help for the full list of categories and commands.
Contributing
If you have any ideas, bug reports, feature requests, or fixes, please make an issue or submit a pull request.
Thanks.