> For the complete documentation index, see [llms.txt](https://developers.clashperk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.clashperk.com/rankings.md). Agents can also search and read this documentation through its [MCP server](https://developers.clashperk.com/~gitbook/mcp).

# Rankings

Top 200 players and clans by country and worldwide: live, and saved at the end of each season.

## GET /rankings/locations

> List ranking locations

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Rankings","description":"Top 200 players and clans by country and worldwide: live, and saved at the end of each season."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"RankingLocationsDto":{"type":"object","properties":{"items":{"description":"Global first, then countries by name.","type":"array","items":{"$ref":"#/components/schemas/RankingLocationDto"}}},"required":["items"]},"RankingLocationDto":{"type":"object","properties":{"countryCode":{"type":"string","description":"A country code such as `IN`, or `global` for worldwide."},"name":{"type":"string"}},"required":["countryCode","name"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/rankings/locations":{"get":{"operationId":"getRankingLocations","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RankingLocationsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"List ranking locations","tags":["Rankings"]}}}}
```

## GET /rankings/seasons

> List saved ranking seasons

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Rankings","description":"Top 200 players and clans by country and worldwide: live, and saved at the end of each season."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"RankingSeasonsDto":{"type":"object","properties":{"items":{"description":"Saved league seasons before the current one, newest first.","type":"array","items":{"type":"string"}}},"required":["items"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/rankings/seasons":{"get":{"operationId":"getRankingSeasons","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RankingSeasonsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"List saved ranking seasons","tags":["Rankings"]}}}}
```

## Get a clan's rankings and rank history

> Shows where the clan sits on the clan and capital boards in its country and worldwide, and its country rank over the last 6 saved seasons.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Rankings","description":"Top 200 players and clans by country and worldwide: live, and saved at the end of each season."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"ClanRankingsDto":{"type":"object","properties":{"location":{"description":"The clan's country; null when it hasn't set one.","anyOf":[{"$ref":"#/components/schemas/RankingLocationDto"},{"type":"null"}]},"boards":{"description":"Clans and capital boards, in its country (when set) and worldwide, this season.","type":"array","items":{"$ref":"#/components/schemas/ClanBoardStandingDto"}},"history":{"description":"Past seasons in its country, newest first, at most 6.","type":"array","items":{"$ref":"#/components/schemas/ClanRankingSeasonDto"}}},"required":["location","boards","history"]},"RankingLocationDto":{"type":"object","properties":{"countryCode":{"type":"string","description":"A country code such as `IN`, or `global` for worldwide."},"name":{"type":"string"}},"required":["countryCode","name"]},"ClanBoardStandingDto":{"type":"object","properties":{"board":{"type":"string","enum":["players","clans","capital","builder-base-players","builder-base-clans"]},"location":{"$ref":"#/components/schemas/RankingLocationDto"},"rank":{"type":["number","null"],"description":"Null when the clan isn't in this board's top 200."},"previousRank":{"type":["number","null"]},"cutoff":{"type":["number","null"],"description":"Points of the board's last place: what it takes to get on it."}},"required":["board","location","rank","previousRank","cutoff"]},"ClanRankingSeasonDto":{"type":"object","properties":{"season":{"type":"string"},"clans":{"type":["number","null"],"description":"Season-end rank in the clan's country; null when outside the top 200."},"capital":{"type":["number","null"]}},"required":["season","clans","capital"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/rankings/clans/{clanTag}":{"get":{"description":"Shows where the clan sits on the clan and capital boards in its country and worldwide, and its country rank over the last 6 saved seasons.","operationId":"getClanRankings","parameters":[{"name":"clanTag","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClanRankingsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Get a clan's rankings and rank history","tags":["Rankings"]}}}}
```

## List a player's past season-end ranks

> Only seasons where the player made a board, newest first. The current season isn't included.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Rankings","description":"Top 200 players and clans by country and worldwide: live, and saved at the end of each season."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"PlayerRankingsDto":{"type":"object","properties":{"items":{"description":"Every saved season and board the player finished on, newest first.","type":"array","items":{"$ref":"#/components/schemas/PlayerRankingSeasonDto"}}},"required":["items"]},"PlayerRankingSeasonDto":{"type":"object","properties":{"season":{"type":"string"},"location":{"$ref":"#/components/schemas/RankingLocationDto"},"rank":{"type":"number"},"trophies":{"type":"number"}},"required":["season","location","rank","trophies"]},"RankingLocationDto":{"type":"object","properties":{"countryCode":{"type":"string","description":"A country code such as `IN`, or `global` for worldwide."},"name":{"type":"string"}},"required":["countryCode","name"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/rankings/players/{playerTag}":{"get":{"description":"Only seasons where the player made a board, newest first. The current season isn't included.","operationId":"getPlayerRankings","parameters":[{"name":"playerTag","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlayerRankingsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"List a player's past season-end ranks","tags":["Rankings"]}}}}
```

## Get a ranking board

> Shows the live board, or pass \`season\` to see a saved one. Builder base boards are only available live.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Rankings","description":"Top 200 players and clans by country and worldwide: live, and saved at the end of each season."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"RankingBoardDto":{"type":"object","properties":{"location":{"$ref":"#/components/schemas/RankingLocationDto"},"board":{"type":"string","enum":["players","clans","capital","builder-base-players","builder-base-clans"]},"season":{"type":["string","null"],"description":"The saved season, or null for the live board."},"items":{"type":"array","items":{"$ref":"#/components/schemas/RankingEntryDto"}}},"required":["location","board","season","items"]},"RankingLocationDto":{"type":"object","properties":{"countryCode":{"type":"string","description":"A country code such as `IN`, or `global` for worldwide."},"name":{"type":"string"}},"required":["countryCode","name"]},"RankingEntryDto":{"type":"object","properties":{"rank":{"type":"number"},"previousRank":{"type":["number","null"],"description":"Rank at the end of the season before; null when it wasn't ranked then or isn't known."},"tag":{"type":"string"},"name":{"type":"string"},"score":{"type":"number","description":"Trophies for player boards, points for clan boards."},"badgeUrl":{"type":["string","null"],"description":"Live boards only."},"clan":{"type":"object","properties":{"tag":{"type":"string"},"name":{"type":"string"}},"required":["tag","name"]}},"required":["rank","previousRank","tag","name","score","badgeUrl","clan"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/rankings/{countryCode}/{board}":{"get":{"description":"Shows the live board, or pass `season` to see a saved one. Builder base boards are only available live.","operationId":"getRankingBoard","parameters":[{"name":"countryCode","required":true,"in":"path","schema":{"pattern":"^(global|[A-Z]{2})$","type":"string"}},{"name":"board","required":true,"in":"path","schema":{"type":"string","enum":["players","clans","capital","builder-base-players","builder-base-clans"]}},{"name":"season","required":false,"in":"query","description":"A saved league season (from `/rankings/seasons`); the live board when left out.","schema":{"pattern":"^\\d{4}-\\d{2}(-\\d{2})?$","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RankingBoardDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Get a ranking board","tags":["Rankings"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.clashperk.com/rankings.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
