Skip to content
Python API Wrapper for Clash of Clans.
Branch: master
Clone or download


Easy to use asynchronous Clash of Clans API wrapper in Python.

Key Features

  • Asynchronous code
  • Entire coverage of the official Clash of Clans API
  • Email/password login removes the stress of managing tokens
  • Optimised for speed and performance
  • Completely customisable cache

Getting Started


Python 3.5 or higher is required

# Linux/OS X
python3 -m pip install -U

# Windows
py -3 -m pip install -U

# to install the development version:
python3 -m pip install -U git+ --upgrade

Quick Example

This is the basic usage of the library. This example will get a player with a certain tag, and search for 5 clans with a name.

import coc
import asyncio

client = coc.login('email', 'password')
loop = asyncio.get_event_loop()

player = loop.run_until_complete(client.get_player('tag'))

async def get_five_clans(name):
    players = await client.search_clans(name=name, limit=5)
    for n in players:
        print(n, n.tag)

if __name__ == '__main__':

Basic Events Example

This script will run forever, printing to the terminal whenever someone joins the clan.

import coc
import asyncio

client = coc.login('email', 'password', client=coc.EventsClient)

async def on_clan_member_join(player, clan):
    print('{} ({0.tag}) just joined {} ({1.tag})!')



For more examples see the examples directory



  • This content is not affiliated with, endorsed, sponsored, or specifically approved by Supercell and Supercell is not responsible for it. For more information see Supercell's Fan Content Policy:
You can’t perform that action at this time.