# Lixiangqi HTTP API

Lixiangqi exposes the Lila HTTP API surface adapted to native Xiangqi games. Public endpoints can be read without an account; private actions require an OAuth access token with the appropriate scope.

## Start here

* `GET /api/status` checks service availability.
* `GET /api/player` lists online or selected players.
* `GET /api/tournament` lists current tournaments.
* `GET /api/broadcast` lists broadcasts.
* `GET /api/user/{username}` returns a public user profile as JSON.
* `GET /api/games/user/{username}` streams exported games.

Send an `Accept` header for the representation you need and identify automated clients with a useful user agent. Streaming endpoints should be consumed incrementally rather than buffered indefinitely.

## Authentication and limits

Use `Authorization: Bearer YOUR_TOKEN` for OAuth requests. Keep tokens secret, request only the scopes you need, and revoke credentials that may have leaked. Clients must respect response status codes, back off after rate limits, and avoid parallel polling that can be replaced by a stream.

Lixiangqi follows Lila's endpoint shapes where they make sense, but chess-specific assumptions do not override Xiangqi rules, positions, notation, or game results. Test integrations against this server before production use.

The implementation and route definitions are available in the [Lixiangqi source repository](https://github.com/travis-mallett/lixiangqi).
