dev-master
9999999-dev https://github.com/defiant/lolapiPHP wrapper for the League of Legends API.
MIT
The Requires
- php >=5.5
- guzzlehttp/guzzle >=6.0
The Development Requires
by Sinan Taga
api league proxy facade wrap lol legends
Wallogit.com
2017 © Pedro Peláez
PHP wrapper for the League of Legends API.
This library allows you to calls to the RIOT API with a proper API Key. Simply replace API_KEY_HERE with your API key from Riot Games. If you don't have a key you can get one from here., (*1)
This is still a work in progress., (*2)
Use composer!, (*3)
Initialize the Api, (*4)
$api = new Lolapi('API_KEY_HERE');, (*5)
Set the Api you want to use. Valid Choices:, (*6)
For example to get the Summoner details you can do something like this., (*7)
$api->Summoner()->byName('remataklan'));
// or
$summoner = new Summoner;
$remataklan = $summoner->byName('remataklan')
You should get an array containing the summoner details., (*8)
Get the Champion data from the api. This returns current champion info., (*9)
Get all the champions:, (*10)
$api->Champion()->all(), (*11)
Get a champion by its id:, (*12)
$api->Champion()->byId($id), (*13)
Get recent games for a player by that players id. (Max 10 Games returned by Riot), (*14)
$api->Game()->recent(), (*15)
Retrieve match history by summoner ID. You can query multiple summoners., (*16)
Simple call: You can send a single id to query a single Summoner., (*17)
$api->History()->get($id), (*18)
Parameters are sent as an array, Array key and values are listed below:, (*19)
$params = ['championIds' => 1, 'rankedQueues' => 'RANKED_SOLO_5x5']; $api->History()->get($id, $params);
Get various league information., (*20)
Get leagues mapped by summoner ID for a given list of summoner IDs., (*21)
$ids: a single Summoner or Team id or an array of integers for multiple ids:, (*22)
$this->League()->bySummoner($ids);, (*23)
$this->League()->byTeam($ids);, (*24)
Get leagues mapped by team ID for a given list of team IDs or Summoner IDs., (*25)
$this->League()->entryBySummoner($ids);, (*26)
$this->League()->entryByTeam($ids);, (*27)
Get match details for a given match., (*28)
$this->match()->detail($id);, (*29)
or you can supply a second parameter (bool) to ask for timeline. Not all matches have timeline info., (*30)
$this->match()->detail($id, true);, (*31)
All static data from riot are queried using this method. This method's api calls does not count toward your rate limit., (*32)
Get static data about a champion. The following will get all champions with default parameter., (*33)
$api->StaticData()->champion();, (*34)
To get a specific champion with default parameters:, (*35)
// Note that you must supply an empty array for default // parameters when requesting a specific champion $api->StaticData()->champion([], $id);
Valid $params, You can pass them as array key/value pairs, (*36)
// Note that if you want more than one champData param // you can pass it as a comma separated string $api->StaticData()->champion(['champData' => 'allytips, lore'])
Get static data about an item. The following will get all items with default parameter., (*37)
$api->StaticData()->item();, (*38)
To get a specific item with default parameters:, (*39)
// Note that you must supply an empty array for default // parameters when requesting a specific item $api->StaticData()->item([], $id);
Valid $params, You can pass them as array key/value pairs, (*40)
// Note that if you want more than one itemlistData param // you can pass it as a comma separated string $api->StaticData()->item(['itemListData' => 'image, inStore'])
Get static data about an item. The following will get all masteries with default parameter., (*41)
$api->StaticData()->mastery();, (*42)
To get a specific item with default parameters:, (*43)
// Note that you must supply an empty array for default // parameters when requesting a specific mastery $api->StaticData()->mastery([], $id);
Valid $params, You can pass them as array key/value pairs, (*44)
// Note that if you want more than one masterylistData param // you can pass it as a comma separated string $api->StaticData()->mastery(['maseryListData' => 'image, ranks'])
Retrieve realm data., (*45)
$api->StaticData()->realm();, (*46)
Get static data about a summoner spell. The following will get all spells with default parameter., (*47)
$api->StaticData()->summonerSpell();, (*48)
To get a specific spell with default parameters:, (*49)
// Note that you must supply an empty array for default // parameters when requesting a specific spell $api->StaticData()->summonerSpell([], $id);
Valid $params, You can pass them as array key/value pairs, (*50)
// Note that if you want more than one spellData param // you can pass it as a comma separated string $api->StaticData()->summonerSpell(['spellData' => 'cooldown, tooltip'])
Get static data about a rune. The following will get all runes with default parameter., (*51)
$api->StaticData()->rune();, (*52)
To get a specific rune with default parameters:, (*53)
// Note that you must supply an empty array for default // parameters when requesting a specific mastery $api->StaticData()->rune([], $id);
Valid $params, You can pass them as array key/value pairs, (*54)
// Note that if you want more than one masterylistData param // you can pass it as a comma separated string $api->StaticData()->mastery(['maseryListData' => 'image, ranks'])
Retrieve version data., (*55)
$api->StaticData()->versions();, (*56)
Get Summoner stats. You can omit $season to get the latest season., (*57)
Get ranked stats by summoner ID., (*58)
$api->Stats()->ranked($id, $season);, (*59)
Get player stats summaries by summoner ID., (*60)
$api->Stats()->summary($id, $seson);, (*61)
Get shard list:, (*62)
$api->Status()->shards();, (*63)
Get shard status. Returns the data available on the status.leagueoflegends.com website for the given region., (*64)
$api->Status()->shards('na');, (*65)
Get info about a summoner., (*66)
$api->Summoner()->get($id);, (*67)
Above method call will get info about a summoner. You can pass an array as parameter. This array can contain both names (strings) and ids (integers), (*68)
For example:, (*69)
This query will get both user named remataklan and user with id 343443:, (*70)
$api->Summoner()->get(['remataklan', 343443]);, (*71)
Get runes pages by summoners IDs. A single integer or an array of integers as parameters:, (*72)
$api->Summoner()->runes($ids), (*73)
Get runes pages by masteries IDs. A single integer or an array of integers as parameters:, (*74)
$api->Summoner()->masteries($ids), (*75)
Get summoner names mapped by summoner ID for a given list of summoner IDs. A single integer or an array of integers as parameters:, (*76)
$api->Summoner()->name($ids), (*77)
Get teams mapped by summoner ID for a given list of summoner IDs., (*78)
$api->Team()->bySummoner($ids), (*79)
Get teams mapped by team ID for a given list of team IDs., (*80)
$api->Team()->teams($teamIds);, (*81)
A single integer or an array of integers as parameters for both methods., (*82)
PHP wrapper for the League of Legends API.
MIT
api league proxy facade wrap lol legends