Fixture-backed Clash of Clans mock API for local development, demos, and integration testing. It mirrors common Clash of Clans endpoints with deterministic responses and serves interactive docs from the app itself.
Public instance: api.clashapi.dev
- FastAPI app with interactive Scalar docs at
/ - OpenAPI schema at
/openapi.json - Stable JSON fixtures for clan, player, league, location, label, and gold pass endpoints
- Variant-based mock responses using
#2PPand additional trailingPs where supported - Pagination support on list endpoints via
limit,after, andbefore
Requirements:
- Python
3.13.7+ uv
Install dependencies and run the API:
uv sync
uv run python main.pyThe app starts on http://localhost:3000.
Interactive docs:
- Local: http://localhost:3000
- Hosted: https://api.clashapi.dev
Example requests:
curl https://api.clashapi.dev/players/%232PP
curl "https://api.clashapi.dev/clans?name=mock&limit=5"
curl https://api.clashapi.dev/openapi.jsonMock tags are deterministic:
#2PPreturns the primary fixture- Appending
Ps selects alternate variants when an endpoint supports them - Tags outside the
#2PP...pattern return a mock bad request response
Example:
curl https://api.clashapi.dev/players/%232PP
curl https://api.clashapi.dev/players/%232PPPclansplayersleagueslocationsandrankingslabelsgoldpass
Apache 2.0. See LICENSE.