Supercell has introduced a official API service for Clash of Clans that will enable Clash of Clans players to access their data. Currently, the Clash of Clans API provides the ability to get data for clans, locations and leagues. As for now Clash of Clans API is only in beta mode, expect to see more features and version release in upcoming months. This will trigger new websites, apps, and additional services dedicated to Clash of Clans enthusiasts. While specifics about the API remain limited during the beta, the developer community expects massive changes within the Clash of Clans community to ensue.
Integrate API In PHP
To use the Clash of Clans API, you will need to register for a developer account here. Once you’ve registered and have verified your email address, Supercell will grant you an API key that is tied to your specific IP addresses, and each API key will have a rate limit.
You can view the documentation for the Clash of Clans API here. You can also test potential API queries on the documentation page, Here is the below php code to connect with API