Download the PHP package berskde/coc-api-php without Composer
On this page you can find all versions of the php package berskde/coc-api-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download berskde/coc-api-php
More information about berskde/coc-api-php
Files in berskde/coc-api-php
Package coc-api-php
Short Description PHP wrapper for querying the Supercell Clash of Clans API
License MIT
Informations about the package coc-api-php
Clash of Clans API
Easily query Supercell's API for Clash of Clans data! This package uses official API. For more information, please visit https://developers.clashofclans.com
This package is tested and working on PHP 5.5 and greater, including PHP 7.0!
Do note that the API might change at any given moment, as there are no stable releases yet.
Requirements
For using this package, you need to obtain an API key at https://developer.clashofclans.com
Installation
Using Composer
Usage
When instantiating Client, you have to provide your API key:
Clans
Refers to /clans endpoint from the official docs.
You can use any of the parameters specified in the official docs as keys, and the values as parameter values, likewise
Tip: if you are only searching by clan name, you don't have to specify the array as parameter but just a simple string:
For all available parameters, please browse through the offical docs.
Get specific clan by tag
Refers to /clans/{clanTag} endpoint from the official docs.
It's very easy to use:
For more available methods, visit ClashOfClans\Api\Clan\Clan class.
Getting leader info
For more available methods, visit ClashOfClans\Api\Clan\Player class.
Getting co-leaders and elders
Leagues
Refers to /leagues endpoint from the official docs.
Locations
Refers to /locations endpoint from the official docs.
Getting all available locations is pretty easy:
Get specific location by ID
Refers to /locations/{locationId} endpoint from the official docs.
Get rankings for specific location
Refers to /locations/{locationId}/rankings/{rankingId} endpoint from the official docs.
Instead of 'clans', as the second parameter you can also pass string players which will return array of Player objects.