Getting started with Clash of Clans API
Go to https://developer.clashofclans.com/. Register and set up your token.
Demo 01 : Getting data from Clash of Clans API source in action
  1. Replace <CLANTAG> with your clan tag. Find this in game on your clan screen.
  2. Replace <APITOKEN> with with your API token.
  3. $url can be any of the urls specified by API documentation.
  4. More reading on: curl_init, curl_setopt, curl_exec, json_decode
Demo 02 : Displaying the data source in action
  1. Remove php header function as we are now using HTML to set the charset
  2. Remove var_dump function as we are now using HTML to display the results
  3. Add a way to display any error with fetching data from API
  4. Add the clan name to the <title> tag
  5. Add the clan data (as defined in $data variable) to a set <table>
  6. Loop through the member list (as defined by $members) and add to <tr> tag within a <table> for members of the clan
  7. More reading on: php arrays, isset, echo, foreach, HTML5
Demo 03 : Fixing the display source in action
...
Clan level : 21
PATNA PiRaTeS
PATNA PiRaTeS#YYVG92JU Welcome to Patna Pirates🇮🇳 Insta:patnapirates_official .. Youtube: Gaku clash of clans . Twitter:@patnapiratescoc .No more hbd.
Total points57909
Wars won432
War win streak0
Wars drawn7
Wars lost304
Members50/50
TypeinviteOnly
Required trophies5500
War frequencyalways
Clan locationIndia
1(0) Legend League 214 ☆★☆★☆★
coLeader
Donated:
0
Received:
0
6284
2(0) Legend League 203 ☆★☆★☆★☆★☆
coLeader
Donated:
45
Received:
0
6273
3(0) Legend League 201 ☆★☆★☆★☆★
admin
Donated:
0
Received:
0
6236
4(0) Legend League 230 STARs
admin
Donated:
0
Received:
0
6179
5(0) Legend League 232 Lv.99 ☆GAKU☆
coLeader
Donated:
0
Received:
0
6090
6(0) Legend League 209 ☆★☆★☆★☆★☆★
admin
Donated:
0
Received:
0
6057
7(0) Legend League 224 コマkun
coLeader
Donated:
0
Received:
0
5957
8(0) Legend League 223 Rit
admin
Donated:
0
Received:
47
5755
9(0) Legend League 238 PP✨Sumit™✨
admin
Donated:
0
Received:
47
5741
10(0) Legend League 246 komakun
admin
Donated:
0
Received:
0
5738
11(15) Legend League 230 Rit
admin
Donated:
11377
Received:
9449
5737
12(0) Legend League 220 Orcinus Koma
admin
Donated:
0
Received:
0
5722
13(0) Legend League 231 abhishek
admin
Donated:
0
Received:
0
5712
14(0) Legend League 229 PP✨Sumit™✨
coLeader
Donated:
0
Received:
342
5696
15(0) Legend League 230 harsh
coLeader
Donated:
0
Received:
0
5666
16(31) Legend League 226 ♠️AMANSINGH♠️
admin
Donated:
9314
Received:
3226
5592
17(24) Legend League 221 sudarshan
coLeader
Donated:
4687
Received:
10914
5584
18(0) Legend League 245 PP✨Vaibhav✨
admin
Donated:
0
Received:
0
5572
19(29) Legend League 238 basharat
admin
Donated:
2662
Received:
3792
5571
20(14) Legend League 232 Amal
admin
Donated:
828
Received:
945
5557
21(20) Legend League 246 MAYANK
coLeader
Donated:
2276
Received:
799
5549
22(23) Legend League 217 Yashu
admin
Donated:
860
Received:
987
5544
23(0) Legend League 232 Ad!tya
coLeader
Donated:
99
Received:
808
5542
24(12) Legend League 230 Kamal Yadav
admin
Donated:
9557
Received:
10384
5529
25(43) Legend League 226 Snip The Tip™️
admin
Donated:
2518
Received:
3610
5527
26(26) Legend League 226 Bunty
admin
Donated:
8202
Received:
5209
5512
27(30) Legend League 224 D3ADLY
admin
Donated:
5117
Received:
3723
5510
28(28) Legend League 227 KARAN SINGH
admin
Donated:
4150
Received:
2421
5509
29(18) Legend League 244 jack
coLeader
Donated:
3907
Received:
2726
5488
30(0) Legend League 247 Rit
admin
Donated:
35
Received:
278
5488
31(0) Legend League 227 Lionel Messi
member
Donated:
0
Received:
295
5485
32(19) Legend League 227 PP✨Tarique✨
admin
Donated:
1977
Received:
3631
5475
33(0) Legend League 231 irfan lala
member
Donated:
519
Received:
1170
5462
34(46) Legend League 220 JatinBeyal
admin
Donated:
647
Received:
752
5448
35(21) Legend League 224 Midnight OWL
admin
Donated:
913
Received:
2617
5442
36(41) Legend League 236 Piyush Thakur
admin
Donated:
2349
Received:
2372
5426
37(22) Legend League 223 ♡KITKAT❤PRIYOM♡
admin
Donated:
632
Received:
2369
5415
38(39) Legend League 224 InsAne wArrIor
admin
Donated:
2054
Received:
2114
5414
39(27) Legend League 233 Mohit
admin
Donated:
2748
Received:
3927
5411
40(34) Legend League 235 MD KHAN
member
Donated:
416
Received:
2147
5411
41(0) Legend League 236 cool hunter
admin
Donated:
495
Received:
573
5404
42(11) Legend League 258 Rit
leader
Donated:
28453
Received:
11438
5398
43(40) Legend League 223 AK47
member
Donated:
1444
Received:
1127
5395
44(32) Legend League 242 Don
admin
Donated:
2223
Received:
2583
5391
45(38) Legend League 256 junaid
coLeader
Donated:
20990
Received:
8305
5371
46(35) Legend League 224 mudasssir
member
Donated:
1094
Received:
3608
5356
47(42) Legend League 229 p k p
admin
Donated:
852
Received:
1191
5350
48(25) Legend League 222 spaul
admin
Donated:
2387
Received:
8942
5343
49(37) Legend League 219 Deeyampi
member
Donated:
831
Received:
2235
5311
50(44) Legend League 255 PP✨Sumit™✨
coLeader
Donated:
2624
Received:
894
5249