Skip to main content

Clash of Clans API – Basics Part 1 | API Tutorial

I am sure you love Clash of Clans because you are reading this post and wish to know more about COC API. Few years back Supercell launched Clash of Clans API for public use. Clash of Clans API gives so much information about Clans and Clan Wars however in the next version we can expect individual clasher details too. After which Clash of Clans API will become truly helpful in getting insight into Clan data.

Clash of Clans API tutorial part 1

Target Audience

Non-technical Clash of Clans clashers who want to use API to get insight into their Clan using available historical data.

Technology Used in API

  1. WordPress as platform

  2. PHP as programming language

  3. MySQL as Database

What is Clash of Clans API?

COC API can be considered as a medium to access clash of clans data in secure manner.

What all information is available in Clash of Clans API?

In VERSION v1, following information is available:

  • Clans: Search for Clans using Clan Tag, Name, Clan Level, Clan Points, Clan Members etc. You can also search for any specific Clan War Log which will show last 50 War details if not set hidden by Clan Leader.

  • Locations: Search for Clans using location, Location based Top Clans and Top Players etc.

  • Leagues: Search for Clans in different Leagues.

How to access Clash of Clans API ?

Create Account: First visit Clash of Clans developer website and Register on the website.

Once you have username/password login into the developer portal.

Now go to My Account.

You need authorization key in order to fetch data via API. So create a new key.

Now give some Name and Description to identify Key. Next mention at least 1 IP Address from which you will access API. How to find your ip ? If you want to find your local desktop public ip address then click here. If you wish to check IP of your shared host then create a simple PHP file with just one echo command in it.
<?php echo file_get_contents(“”); ?>

Put the file at webhost root location and call the php page in browser ( This will echo your shared host outbound IP address. Use this IP address to generate TOKEN.
Once you create key your settings are complete on coc api development portal. Next step is to use the TOKEN created in key to be used in web page in order to access data via api. Keep the token secure and do not share it with anyone. To enhance the security the Token will work only with the IP address you have mentioned during key creation. If you do not have static ip then you have to create new key every time the IP address changes.
  1. Register & Login into COC API portal

  2. Create new key and mention the IP Address

  3. Keep the generated TOKEN handy for future use
In the Clash Of Clans Api Basics part-2 tutorial we will see how to fetch data via API. We will be using WordPress as platform so PHP will be the language. You can use other programming language too however in the examples we will use PHP.

Popular posts from this blog

Drag attack strategy for th8 ultimate guide

Clash of clans community discovered thousands of interesting and effective attack strategies including drag attack strategy. Drag attack normally starts at th7 and lasts till th9(I saw to use them even in th10).
The combination of each townhall would be different. Here we are experimenting with a th8 base. It's not to say it's as popular as effective in th8.
Troops for a successful drag attack
Dragons-10/9(Player differ)Balloon-0/4 Max or lvl 6 loons in castleLightning spell-2Rage spell-1Eq spell-1Poison/haste-1 in castle
If you are taking 9 drags. Make sure to take 4 loons. How many drags you have to choose depend on the base you're going to attack.First Step:
You don't have to clear clan castle troops in drag attack. However be careful to drop the poison. Anyhow drop 2 lightning spell and 1 eq spell on any air defence and it will destroy the air defence.
Second Step:
Now release all drags on a line from the closest side of air defence. Once they are ready to taking da…

Th9 witch bowler combo attack strategy

This attack strategy is basically useful in the bases with centralised air defences. If the air defence is in outside compartments then the strategy might not as effective with is attacking strategy.
Begain with witch with bowler Here the strategy goes in such way : Golem, Bowlers and Heroes along with wizards are the kill squad. These troops will break major defences like x-bows and air defence with few other structures and make the base easy for the the witches who are healed continuously by the healer. Minimum troops & spells levels requirements to get success in this th9 attack strategyWitch lev 2Jump spell lev 2Golem lev 3Poison spell lev 2Wizard lev 6Healing spell lev 5Rage spell lev 5Archer lev 5Barbarian King and Archer Queen must be more than lev 12 In this th9 war attack strategy player need troops combo of
10 Witch1 Golem3 Wizard4 Healer2 Archer And spells combo of
2 Jump spells-1Healing spell-1Rage spell1 PoisonIn Clan castle- 6 Bowlers(Max level) and 1 Poison spell