api_methods
api_methods
¶
All Clash of Clans API endpoint methods
ApiMethods
¶
Mixin class containing all COC API endpoint methods
clan_tag
¶
clan_tag(
tag: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get clan information
Source code in cocapi/api_methods.py
55 56 57 58 59 60 61 62 63 | |
clan_members
¶
clan_members(
clan_tag: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get clan members
Source code in cocapi/api_methods.py
65 66 67 68 69 70 71 72 73 74 75 | |
clan_current_war
¶
clan_current_war(
clan_tag: str,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get current clan war information
Source code in cocapi/api_methods.py
77 78 79 80 81 82 83 84 | |
clan_war_log
¶
clan_war_log(
clan_tag: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get clan war log
Source code in cocapi/api_methods.py
86 87 88 89 90 91 92 93 94 95 96 | |
clan_leaguegroup
¶
clan_leaguegroup(
clan_tag: str,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get clan's current clan war league group
Source code in cocapi/api_methods.py
98 99 100 101 102 103 104 105 | |
clan_capitalraidseasons
¶
clan_capitalraidseasons(
clan_tag: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get clan capital raid seasons
Source code in cocapi/api_methods.py
107 108 109 110 111 112 113 114 115 116 117 | |
players
¶
players(
player_tag: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get player information
Source code in cocapi/api_methods.py
119 120 121 122 123 124 125 126 127 128 129 | |
clan
¶
clan(
name: str = "",
limit: int = 10,
params: dict[str, Any] | None = None,
war_frequency: str | None = None,
location_id: int | None = None,
min_members: int | None = None,
max_members: int | None = None,
min_clan_points: int | None = None,
min_clan_level: int | None = None,
label_ids: str | None = None,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Search clans by name and/or filtering criteria
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Search clans by name (min 3 characters if used)
TYPE:
|
limit
|
Limit number of results
TYPE:
|
params
|
Optional pagination params (after, before)
TYPE:
|
war_frequency
|
Filter by war frequency
TYPE:
|
location_id
|
Filter by location identifier
TYPE:
|
min_members
|
Filter by minimum number of members
TYPE:
|
max_members
|
Filter by maximum number of members
TYPE:
|
min_clan_points
|
Filter by minimum clan points
TYPE:
|
min_clan_level
|
Filter by minimum clan level
TYPE:
|
label_ids
|
Comma separated list of label IDs to filter by
TYPE:
|
Source code in cocapi/api_methods.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
warleague
¶
warleague(
war_tag: str,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get information about a clan war league war
Source code in cocapi/api_methods.py
183 184 185 186 187 188 | |
location
¶
location(
params: dict[str, Any] | None = None,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get list of locations
Source code in cocapi/api_methods.py
190 191 192 193 194 195 196 | |
location_id
¶
location_id(
location_id: str,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get information about a location
Source code in cocapi/api_methods.py
198 199 200 201 202 | |
location_id_clan_rank
¶
location_id_clan_rank(
location_id: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get clan rankings for a location
Source code in cocapi/api_methods.py
204 205 206 207 208 209 210 211 212 | |
location_id_player_rank
¶
location_id_player_rank(
location_id: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get player rankings for a location
Source code in cocapi/api_methods.py
214 215 216 217 218 219 220 221 222 | |
location_clan_versus
¶
location_clan_versus(
location_id: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get clan versus rankings for a location (possibly deprecated)
Source code in cocapi/api_methods.py
224 225 226 227 228 229 230 231 232 233 234 | |
location_player_versus
¶
location_player_versus(
location_id: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get player versus rankings for a location (possibly deprecated)
Source code in cocapi/api_methods.py
236 237 238 239 240 241 242 243 244 245 246 | |
location_clans_builder_base
¶
location_clans_builder_base(
location_id: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get clan builder base rankings for a location
Source code in cocapi/api_methods.py
248 249 250 251 252 253 254 255 256 | |
location_players_builder_base
¶
location_players_builder_base(
location_id: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get player builder base rankings for a location
Source code in cocapi/api_methods.py
258 259 260 261 262 263 264 265 266 | |
league
¶
league(
params: dict[str, Any] | None = None,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get list of leagues
Source code in cocapi/api_methods.py
268 269 270 271 272 273 274 | |
league_id
¶
league_id(
league_id: str,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get league information
Source code in cocapi/api_methods.py
276 277 278 | |
league_season
¶
league_season(
id: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get league seasons (Legend League only)
Source code in cocapi/api_methods.py
280 281 282 283 284 285 286 | |
league_season_id
¶
league_season_id(
id: str, sid: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get league season rankings (Legend League only)
Source code in cocapi/api_methods.py
288 289 290 291 292 293 294 | |
warleagues
¶
warleagues() -> dict[str, Any] | Awaitable[dict[str, Any]]
Get list of clan war leagues
Source code in cocapi/api_methods.py
296 297 298 | |
warleagues_id
¶
warleagues_id(
league_id: str,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get information about a clan war league
Source code in cocapi/api_methods.py
300 301 302 303 304 | |
labels_clans
¶
labels_clans(
params: dict[str, Any] | None = None,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get labels for clans
Source code in cocapi/api_methods.py
306 307 308 309 310 311 312 | |
labels_players
¶
labels_players(
params: dict[str, Any] | None = None,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get labels for players
Source code in cocapi/api_methods.py
314 315 316 317 318 319 320 | |
capitalleagues
¶
capitalleagues(
params: dict[str, Any] | None = None,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get list of capital leagues
Source code in cocapi/api_methods.py
322 323 324 325 326 327 328 | |
capitalleagues_id
¶
capitalleagues_id(
league_id: str,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get information about a capital league
Source code in cocapi/api_methods.py
330 331 332 333 334 | |
builderbaseleagues
¶
builderbaseleagues(
params: dict[str, Any] | None = None,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get list of builder base leagues
Source code in cocapi/api_methods.py
336 337 338 339 340 341 342 | |
builderbaseleagues_id
¶
builderbaseleagues_id(
league_id: str,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get information about a builder base league
Source code in cocapi/api_methods.py
344 345 346 347 348 | |
goldpass
¶
goldpass(
params: dict[str, Any] | None = None,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get information about the current gold pass season
Source code in cocapi/api_methods.py
350 351 352 353 354 355 356 | |
verify_player_token
¶
verify_player_token(
player_tag: str, token: str
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Verify a player API token to confirm account ownership
| PARAMETER | DESCRIPTION |
|---|---|
player_tag
|
Tag of the player
TYPE:
|
token
|
API token found in the player's game settings
TYPE:
|
Source code in cocapi/api_methods.py
360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |
leaguetiers
¶
leaguetiers(
params: dict[str, Any] | None = None,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get list of league tiers
Source code in cocapi/api_methods.py
375 376 377 378 379 380 381 | |
leaguetiers_id
¶
leaguetiers_id(
league_tier_id: str,
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get information about a specific league tier
Source code in cocapi/api_methods.py
383 384 385 386 387 | |
location_capital_rankings
¶
location_capital_rankings(
location_id: str, params: dict[str, Any] | None = None
) -> dict[str, Any] | Awaitable[dict[str, Any]]
Get capital rankings for a location
Source code in cocapi/api_methods.py
389 390 391 392 393 394 395 396 397 | |