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 : 19
鲨王
鲨王#QQ2CYQU 2020年一月赛季全力冲杯顶榜新春营。微信审核:ayq0277mq
Total points62006
Wars won269
War win streak0
Wars drawn
Wars lost
Members50/50
TypeinviteOnly
Required trophies5300
War frequencyalways
Clan locationChina
1(0) Legend League 222 Best丶萌新✨
admin
Donated:
107
Received:
341
7150
2(0) Legend League 226 迷雾麋鹿迷了路
admin
Donated:
0
Received:
344
6936
3(0) Legend League 233 鲨王❤️猪猪
admin
Donated:
82
Received:
419
6730
4(0) Legend League 238 逗比中的小公鸡
admin
Donated:
0
Received:
47
6572
5(9) Legend League 212 全部落的希望
admin
Donated:
1048
Received:
4710
6543
6(8) Legend League 229 鲨王♥夜雨星辰
admin
Donated:
152
Received:
1489
6517
7(12) Legend League 187 白宫
admin
Donated:
700
Received:
4145
6490
8(7) Legend League 214 张起灵
admin
Donated:
3414
Received:
4354
6472
9(0) Legend League 241 鲨王❤️✨涵涵✨
admin
Donated:
445
Received:
767
6427
10(0) Legend League 217 HSL·桂花香
admin
Donated:
0
Received:
0
6417
11(0) Legend League 223 ✨✨月亮✨✨
admin
Donated:
0
Received:
77
6322
12(10) Legend League 210 PG_ONE
admin
Donated:
48
Received:
1022
6190
13(14) Legend League 226 小风2号
admin
Donated:
6457
Received:
5831
6094
14(0) Legend League 220 鲨王❤️✨小北鼻✨
admin
Donated:
380
Received:
0
5996
15(15) Legend League 216 小风1号
admin
Donated:
3372
Received:
3610
5868
16(33) Legend League 213 一念
admin
Donated:
3201
Received:
6367
5859
17(20) Legend League 193 顺天府|天子
admin
Donated:
2249
Received:
4239
5855
18(17) Legend League 201 中国缘 强叔
admin
Donated:
2973
Received:
10522
5786
19(16) Legend League 198 樾下
admin
Donated:
1644
Received:
1553
5779
20(22) Legend League 238 墨言
admin
Donated:
5023
Received:
10622
5766
21(38) Legend League 217 鲨王❤✨天空✨
admin
Donated:
5937
Received:
4708
5757
22(24) Legend League 251 鲨王❤️✨✨豆豆✨✨
coLeader
Donated:
12893
Received:
5139
5753
23(21) Legend League 293 小黑屋 @✨Legend✨
admin
Donated:
7628
Received:
5546
5731
24(28) Legend League 232 七念
admin
Donated:
12800
Received:
6196
5718
25(18) Legend League 239 ⚜️⚜️✨一✨朵✨⚜️⚜️
admin
Donated:
2902
Received:
5699
5711
26(23) Legend League 214 血海骨城杯中酒&仇敵三千奈我何
admin
Donated:
4083
Received:
4735
5707
27(36) Legend League 186 相遇无敌霹雳帅
admin
Donated:
1796
Received:
4783
5683
28(27) Legend League 249 ✨✨Nick✨✨
admin
Donated:
5510
Received:
6350
5683
29(34) Legend League 229 ✨樾下✨
admin
Donated:
650
Received:
942
5656
30(42) Legend League 204 CN.one❤️阿灿的小弟❤️
admin
Donated:
3995
Received:
4016
5647
31(19) Legend League 223 鲨王❤️✨风笛✨
admin
Donated:
5410
Received:
10789
5602
32(35) Legend League 250 鲨王❤️面条哥
leader
Donated:
27134
Received:
7943
5594
33(25) Legend League 232 鲨王❤️CON
admin
Donated:
4680
Received:
4179
5582
34(29) Legend League 221 陌上妍如玉丶公子世无双
admin
Donated:
1780
Received:
6221
5577
35(43) Legend League 240 曾啊信
admin
Donated:
10127
Received:
3925
5561
36(40) Legend League 217 潸然
admin
Donated:
4489
Received:
4388
5546
37(37) Legend League 224 鲨王❤️六妹
admin
Donated:
4075
Received:
5987
5533
38(41) Legend League 261 paris
admin
Donated:
2967
Received:
7427
5532
39(39) Legend League 207 彡傲天灬鑫月
admin
Donated:
976
Received:
4955
5532
40(46) Legend League 217 梨园
admin
Donated:
1176
Received:
3646
5530
41(30) Legend League 232 鲨王❤调皮蛋蛋
admin
Donated:
19606
Received:
4805
5505
42(31) Legend League 225 鲨王❤️✨兰若寺✨
admin
Donated:
4558
Received:
5587
5497
43(26) Legend League 237 他日若遂凌云志,敢笑黄巢不丈夫
admin
Donated:
3860
Received:
3519
5494
44(32) Legend League 235 ☠️☠️☠️战狼☠️☠️☠️
admin
Donated:
5696
Received:
11091
5491
45(47) Legend League 226 清້໌ᮨ风
admin
Donated:
2105
Received:
4135
5481
46(45) Legend League 206 【圣典.~李小龍~】
admin
Donated:
4181
Received:
7897
5477
47(44) Legend League 237 ༻木ི兆木ོ卮ༀ女ེ夭女ོ尧࿐
admin
Donated:
4442
Received:
4437
5411
48(48) Legend League 218 浴火重生❤️九妹
admin
Donated:
5534
Received:
10981
5337
49(49) Legend League 233 鲨王❤️✨✨星星✨✨
coLeader
Donated:
4727
Received:
4843
5240
50(50) Legend League 243 鲨王❤️CC
coLeader
Donated:
10932
Received:
1497
4960