Example of how to get and cache data from the official Clash of Clans API using PHP
-
Create your own API token for the Clash of Clans API.
-
Create a file named
api_token.php
in thesrc
directory and define your API token. Do not include your token in the repository for security reasons.
<?php
define('ACCESS_TOKEN', '___YOUR_TOKEN_HERE___');
?>
- Start your server and point your browser to
donateometer.php
- René Keller, https://github.com/rekomat