2017 © Pedro Peláez
 

library lolapi

PHP wrapper for the League of Legends API.

image

defiant/lolapi

PHP wrapper for the League of Legends API.

  • Saturday, February 6, 2016
  • by defiant
  • Repository
  • 1 Watchers
  • 2 Stars
  • 27 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Lolapi

League of Legends Api Wrapper

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)

Installation

Use composer!, (*3)

Usage

Initialize the Api, (*4)

$api = new Lolapi('API_KEY_HERE');, (*5)

Set the Api you want to use. Valid Choices:, (*6)

  • Champion
  • Game
  • History
  • League
  • Match
  • StaticData
  • Stats
  • Status
  • Summoner
  • Team

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)

APIs

Champion

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)

Game

Get recent games for a player by that players id. (Max 10 Games returned by Riot), (*14)

$api->Game()->recent(), (*15)

History

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)

  • championIds (ids of champions to filter)
  • rankedQueues (valid options: RANKED_SOLO_5x5, RANKED_TEAM_3x3, RANKED_TEAM_5x5)
  • beginIndex: The begin index to use for fetching games.
  • endIndex: The begin index to use for fetching games.
$params = ['championIds' => 1, 'rankedQueues' => 'RANKED_SOLO_5x5'];
$api->History()->get($id, $params);

League

Get various league information., (*20)

Get leagues mapped by summoner ID for a given list of summoner IDs., (*21)

By Summoner or Team

$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)

By Summoner or Team Entry

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)

Match

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)

StaticData

All static data from riot are queried using this method. This method's api calls does not count toward your rate limit., (*32)

Champion

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)

  • locale
  • version
  • dataById (TRUE or FALSE - Only for all champs)
  • champData ['allytips', 'altimages', 'blurb', 'enemytips', 'image', 'info', 'lore', 'partype', 'passive', 'recommended', 'skins', 'spells', 'stats', 'tags']
// 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'])
Item

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)

  • locale
  • version
  • itemListData ['all', 'colloq', 'consumeOnFull', 'consumed', 'depth', 'from', 'gold', 'groups', 'hideFromAll', 'image', 'inStore', 'into', 'maps', 'requiredChampion', 'sanitizedDescription', 'specialRecipe', 'stacks', 'stats', 'tags', 'tree']
// 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'])
Mastery

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)

  • locale
  • version
  • masteryListData ['all', 'image', 'prereq', 'ranks', 'sanitizedDescription', 'tree']
// 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'])
Realm

Retrieve realm data., (*45)

$api->StaticData()->realm();, (*46)

Summoner Spells

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)

  • locale
  • version
  • dataById (TRUE or FALSE - Only for all champs)
  • spellData ['all', 'cooldown', 'cooldownBurn', 'cost', 'costBurn', 'costType', 'effect', 'effectBurn', 'image', 'key', 'leveltip', 'maxrank', 'modes', 'range', 'rangeBurn', 'resource', 'sanitizedDescription', 'sanitizedTooltip', 'tooltip', 'vars']
// 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'])
Runes

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)

  • locale
  • version
  • runeListData ['all', 'basic', 'colloq', 'consumeOnFull', 'consumed', 'depth', 'from', 'gold', 'hideFromAll', 'image', 'inStore', 'into', 'maps', 'requiredChampion', 'sanitizedDescription', 'specialRecipe', 'stacks', 'stats', 'tags']
// 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'])
Versions

Retrieve version data., (*55)

$api->StaticData()->versions();, (*56)

Stats

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)

Status

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)

Summoner

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)

runes

Get runes pages by summoners IDs. A single integer or an array of integers as parameters:, (*72)

$api->Summoner()->runes($ids), (*73)

masteries

Get runes pages by masteries IDs. A single integer or an array of integers as parameters:, (*74)

$api->Summoner()->masteries($ids), (*75)

name

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)

Team

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)

The Versions

06/02 2016

dev-master

9999999-dev https://github.com/defiant/lolapi

PHP wrapper for the League of Legends API.

  Sources   Download

MIT

The Requires

 

The Development Requires

api league proxy facade wrap lol legends