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 : 17
鲨王
鲨王#QQ2CYQU 八月全力冲杯顶中国🇨🇳世榜!微信审核:ayq0277mq 战营:鲨王冲突(14级部落)。分营:鲨王盟(15级部落)。🈲挂机。
Total points57380
Wars won244
War win streak6
Wars drawn
Wars lost
Members50/50
TypeinviteOnly
Required trophies5500
War frequencyalways
Clan locationChina
1(2) Legend League 219 鲨王❤️✨✨星星✨✨
admin
Donated:
45
Received:
2270
6002
2(1) Legend League 200 查利仔er
admin
Donated:
379
Received:
632
5893
3(0) Legend League 253 斌哥⚔️—-No1
admin
Donated:
1243
Received:
588
5853
4(0) Legend League 196 强人所难 丶
admin
Donated:
0
Received:
0
5829
5(0) Legend League 245 鲨王❤️宇洋小镇
member
Donated:
0
Received:
0
5807
6(3) Legend League 205 大唐 莱茵
admin
Donated:
9109
Received:
7733
5792
7(18) Legend League 238 鲨王♥☆南风少年☆
admin
Donated:
1850
Received:
3714
5784
8(0) Legend League 222 青花瓷⚔️——No1
admin
Donated:
2649
Received:
516
5772
9(0) Legend League 244 ❄️ Blue Prints
admin
Donated:
1205
Received:
336
5766
10(4) Legend League 205 西伯利亚大尾巴狼
admin
Donated:
4548
Received:
5164
5749
11(13) Legend League 234 墨言
admin
Donated:
3233
Received:
2898
5736
12(0) Legend League 217 HSL•黑 蛇
coLeader
Donated:
1978
Received:
816
5733
13(0) Legend League 205 随我不随你
admin
Donated:
0
Received:
72
5733
14(9) Legend League 218 好名猪取去丶
admin
Donated:
7672
Received:
5505
5723
15(0) Legend League 179 鲨王❤️最靓的仔
admin
Donated:
42
Received:
486
5720
16(15) Legend League 212 梨园
admin
Donated:
379
Received:
672
5695
17(12) Legend League 260 鲨王❤️宇洋小镇
admin
Donated:
2368
Received:
4187
5689
18(0) Legend League 198 【圣典.~李小龍~】
admin
Donated:
219
Received:
712
5685
19(0) Legend League 201 Meteor
admin
Donated:
0
Received:
0
5684
20(16) Legend League 239 only❤️你是自由的
admin
Donated:
16269
Received:
5072
5679
21(22) Legend League 218 鲨王❤少 龙
admin
Donated:
1581
Received:
6138
5669
22(14) Legend League 243 鲨王❤️✨✨豆豆✨✨
admin
Donated:
8066
Received:
4915
5655
23(21) Legend League 234 ⚜️⚜️✨一✨朵✨⚜️⚜️
admin
Donated:
2505
Received:
7537
5652
24(0) Legend League 216 情义灬✨小菲猫✨
admin
Donated:
1325
Received:
270
5651
25(36) Legend League 224 鲨王❤️灰太狼
admin
Donated:
3183
Received:
5528
5630
26(0) Legend League 194 随我不随你
admin
Donated:
0
Received:
72
5629
27(10) Legend League 220 蜗牛
admin
Donated:
12210
Received:
7325
5628
28(0) Legend League 236 大黑脸
admin
Donated:
151
Received:
546
5626
29(17) Legend League 260 paris
admin
Donated:
114
Received:
5754
5623
30(0) Legend League 228 HSL•大雄村
admin
Donated:
112
Received:
216
5614
31(7) Legend League 206 Promise
admin
Donated:
1498
Received:
4708
5611
32(0) Legend League 306 情义灬相依
admin
Donated:
0
Received:
72
5610
33(41) Legend League 219 鲨王❤夜游神
coLeader
Donated:
26909
Received:
7218
5606
34(0) Legend League 228 君临天下
admin
Donated:
159
Received:
432
5605
35(0) Legend League 227 《从头再来》
member
Donated:
0
Received:
156
5598
36(24) Legend League 226 七念
admin
Donated:
3706
Received:
4549
5586
37(0) Legend League 196 mangod OvO *
admin
Donated:
0
Received:
72
5582
38(0) Legend League 233 COCA COLA
admin
Donated:
461
Received:
240
5576
39(0) Legend League 192 小馒头
admin
Donated:
0
Received:
0
5576
40(33) Legend League 284 鲨王❤五哥
admin
Donated:
4603
Received:
3294
5569
41(27) Legend League 208 鲨王❤老烟枪
admin
Donated:
1078
Received:
5994
5568
42(43) Legend League 202 山竹
admin
Donated:
4020
Received:
7080
5550
43(0) Legend League 214 喜欢你
admin
Donated:
533
Received:
576
5550
44(6) Legend League 223 清້໌ᮨ风
admin
Donated:
1487
Received:
5542
5549
45(23) Legend League 288 南征北战精神人
admin
Donated:
6075
Received:
6670
5537
46(0) Legend League 192 ☆攻无⊙不克☆
admin
Donated:
0
Received:
0
5517
47(0) Legend League 186 ღ᭄ꦿ淺墨✨墜星空௸࿐
admin
Donated:
0
Received:
144
5515
48(28) Legend League 212 爱江山更爱美人
admin
Donated:
859
Received:
4104
5463
49(0) Legend League 231 ☠️☠️☠️战狼☠️☠️☠️
admin
Donated:
0
Received:
186
5461
50(46) Legend League 222 阿史那·cc
leader
Donated:
9762
Received:
4474
5278