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


SIVA SANKAR, Working as a Software Engineer, Blogging is my hobby. I completed my Bachelors of Engineering (Computer Science Engineering) in Chennai, India. and my Master of Engineering (Embedded System Technologies) in Tamilnadu, India.

22 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) {
    string(9) “#YVU9YLQ9”
    string(15) “Build n Destroy”
    string(10) “inviteOnly”
    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”
    object(stdClass)#314 (3) {
    string(13) “International”
    object(stdClass)#315 (3) {

  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” }

  4. Sir, where to put up the given php code. i mean i am using windows 7, so where should i paste the given code. in notepad or somewhere else.. kindly tell me

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.