Clash of Clans API Integration on PHP

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

19 thoughts on “Clash of Clans API Integration on PHP

  1. Hello Sir,
    This time I have resolved the authorization issue, but now not getting data in we organised format.
    I’m getting response like below. Please provide the way to show live stats of clan with proper format.

    object(stdClass)#313 (14) {
    [“tag”]=>
    string(9) “#YVU9YLQ9”
    [“name”]=>
    string(15) “Build n Destroy”
    [“type”]=>
    string(10) “inviteOnly”
    [“description”]=>
    string(228) “It is an established competitive war clan that participates in nonstop wars. Our warriors r expected to consistently contribute 3-stars attacks each war. If u r a serious war focused gamer join us.www.buildndestroy.wordpress.com”
    [“location”]=>
    object(stdClass)#314 (3) {
    [“id”]=>
    int(32000006)
    [“name”]=>
    string(13) “International”
    [“isCountry”]=>
    bool(false)
    }
    [“badgeUrls”]=>
    object(stdClass)#315 (3) {
    [“small”]=>

  2. Hi… Can you help me with this error?

    Error String:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

    Im in a free hosting and free domain, to test the app… Can be a problem?

      1. Thanks for the quick reply. Ok i will do…

        But, if I have a web without SSL, how can I do the correct conecction with the API?

  3. object(stdClass)#1 (2) { [“reason”]=> string(12) “accessDenied” [“message”]=> string(21) “Invalid authorization” }

Leave a Reply

Your email address will not be published. Required fields are marked *