PHPackages                             islem-kms/riot-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. islem-kms/riot-api

ActiveLibrary[API Development](/categories/api)

islem-kms/riot-api
==================

Riot League of Legends &amp; DataDragon API wrapper for PHP7 (Reference to Daniel Dolejska (just a fork)

1.0(5y ago)05GPL-3.0-or-laterPHPPHP &gt;=7.1

Since Aug 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/islem-kms/riot-api-wrapper)[ Packagist](https://packagist.org/packages/islem-kms/riot-api)[ Docs](https://github.com/islem-kms/riot-api)[ RSS](/packages/islem-kms-riot-api/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

RiotAPI PHP7 wrapper
====================

[](#riotapi-php7-wrapper)

> Version v4.0.1

[![Build Status](https://camo.githubusercontent.com/a871d59f7d6a46b979622b1a303892be34eabf3d4e436c2824a172d42d1b916b/68747470733a2f2f7472617669732d63692e6f72672f646f6c656a736b612d64616e69656c2f72696f742d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dolejska-daniel/riot-api)[![Test Coverage](https://camo.githubusercontent.com/abcc0e2fb414bd85da47870baaf7a349e4ab365f587d82cef1f21b0ab1c6de5d/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f646f6c656a736b612d64616e69656c2f72696f742d6170692f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/dolejska-daniel/riot-api/coverage)[![Packagist](https://camo.githubusercontent.com/b21d9883d5aa2a0a49f0f3c20bd66f1ad16b8bf3875b0b6def61cede874922a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f646f6c656a736b612d64616e69656c2f72696f742d6170692e737667)](https://packagist.org/packages/dolejska-daniel/riot-api)[![Packagist](https://camo.githubusercontent.com/c67e0fb98b873959e39753a98417602c0868a03500a0813f3bf5a02a789a1b5e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f646f6c656a736b612d64616e69656c2f72696f742d6170692e737667)](https://packagist.org/packages/dolejska-daniel/riot-api)[![Support Project](https://camo.githubusercontent.com/3aca8872156c793b21246fa5cd90fe25cca98534e38985a73d1d08ca42a2bb3c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737570706f72745f70726f6a6563742d50617950616c2d626c75652e737667)](https://www.paypal.me/dolejskad)

Table of Contents
=================

[](#table-of-contents)

1. [Available versions](#available-versions)
2. [Introduction](#introduction)
3. [Downloading](#downloading)
4. [League of Legends API](#league-of-legends-api)
    1. [Resource versions](#resource-versions)
    2. [Initializing the library](#initializing-the-library)
    3. [Usage example](#usage-example)
    4. [Cache providers](#cache-providers)
    5. [Rate limiting](#rate-limiting)
    6. [Call caching](#call-caching)
    7. [Asynchronous requests](#asynchronous-requests)
    8. [StaticData endpoints](#staticdata-endpoints)
    9. [StaticData linking](#staticdata-linking)
    10. [Extensions](#extensions)
    11. [Callback functions](#callback-functions)
    12. [CLI support](#cli-support)
5. [DataDragon API](#datadragon-api)

[Available versions](https://github.com/dolejska-daniel/riot-api/wiki/Available-versions)
=========================================================================================

[](#available-versions)

VersionsAPI UpdatesLibrary featuresBranch[![Packagist](https://camo.githubusercontent.com/a8d2737847e7325223cc2b6ba56d609b91611ce4fdac873652f8eaeb5626c303/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d76342e782e782d626c75652e737667)](https://packagist.org/packages/dolejska-daniel/riot-api) [![](https://camo.githubusercontent.com/ef76a1dea5f711ae44e3e93656e026140d41a611f4a277d407851881319d8412/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e312d626c75652e737667)](https://camo.githubusercontent.com/ef76a1dea5f711ae44e3e93656e026140d41a611f4a277d407851881319d8412/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e312d626c75652e737667)✔✔[master](https://github.com/dolejska-daniel/riot-api)[![Packagist](https://camo.githubusercontent.com/dc10a4e394beb90a92d874216ec4f741b6ff37c51d3f7cf47835429b64d35800/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d76332e782e782d626c75652e737667)](https://packagist.org/packages/dolejska-daniel/riot-api) [![](https://camo.githubusercontent.com/09027dd58e80fa350e8bada3c607123ad73f869b1d71265939c7b2ecb8d95282/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545372e302d626c75652e737667)](https://camo.githubusercontent.com/09027dd58e80fa350e8bada3c607123ad73f869b1d71265939c7b2ecb8d95282/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545372e302d626c75652e737667)❌❌[v3-dev](https://github.com/dolejska-daniel/riot-api/tree/v3-dev)[Introduction](https://github.com/dolejska-daniel/riot-api/wiki/Home#introduction)
==================================================================================

[](#introduction)

Welcome to the RiotAPI PHP7 library repo! The goal of this library is to create easy-to-use library for anyone who might need one. This is fully object oriented API wrapper for League of Legends' API. A small DataDragon API wrapper is also included.

Here are some handy features:

- **[Rate limit caching](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Rate-limiting)** and limit exceeding prevention - fully automatic.
- **[Call caching](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Call-caching)** - enables the library to re-use already fetched data within given timespan - saves time and key's rate limit.
- **[StaticData endpoints](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-StaticData-endpoints)** - you can work with StaticData endpoints as if they were never deprecated.
- **[StaticData linking](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-StaticData-linking)** - library can automatically link related StaticData right into the returned object.
- **[Custom callbacks](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Callback-functions)** - you can set custom function which will be called before or after the request is processed.
- **[Object extensions](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Extensions)** - you can implement your own methods to the fetched API objects and enable yourself to use them later to ease of your work.
- **[CLI supported](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-CLI-support)** - usage of this library in console is extremely easy.
- **Interim mode** support - you are going to be able to use the library the same way whether your key is in `interim mode` or not (meaning you won't need to change anything when you jump to production).
- **Objects everywhere** - API calls return data in special objects, this allows modern IDEs to hint existing properties and methods.

[![API method hint and documentation](examples/readme/ide_hint_method.png)](examples/readme/ide_hint_method.png)[![API object hint (LeagueEntry)](examples/readme/ide_hint_object_1.png)](examples/readme/ide_hint_object_1.png)[![API object hint (LeagueEntry.miniSeries)](examples/readme/ide_hint_object_2.png)](examples/readme/ide_hint_object_2.png)

Please, refer mainly to the [wiki pages](https://github.com/dolejska-daniel/riot-api/wiki). This file contains only general introduction to library features.

[Downloading](https://github.com/dolejska-daniel/riot-api/wiki/Home#downloading)
================================================================================

[](#downloading)

The easiest way to download and use this library is via [Composer](https://getcomposer.org/). If you are not using Composer yet, you should start **right now**!

While having Composer installed on your machine it takes only `composer require "dolejska-daniel/riot-api:^4"` command to get the library ready to roll!

For additional information about downloading and initial setup, please see [the wiki pages](https://github.com/dolejska-daniel/riot-api/wiki/Home#downloading).

[League of Legends API](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-How-to-begin)
=================================================================================================

[](#league-of-legends-api)

[Resource versions](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Resources-and-endpoints)
--------------------------------------------------------------------------------------------------------

[](#resource-versions)

Below you can find table of implemented API resources and the version in which these are currently implemented. Please refer to [wiki pages](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Resources-and-endpoints) for additional information about endpoints and resources.

ResourceStatus[Champion](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Resources-and-endpoints#champion-)[![Champion resource implemented version](https://camo.githubusercontent.com/4afbceb45c101ef90bd1da527864892b9f7d3308bd9eb939ce052947b14cfff9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76332d627269676874677265656e2e737667)](https://camo.githubusercontent.com/4afbceb45c101ef90bd1da527864892b9f7d3308bd9eb939ce052947b14cfff9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76332d627269676874677265656e2e737667)[Champion Mastery](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Resources-and-endpoints#champion-mastery-)[![Champion Mastery resource implemented version](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)[League](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Resources-and-endpoints#league-)[![League resource implemented version](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)[League Exp](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Resources-and-endpoints#league-exp-)[![League Exp resource implemented version](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)Masteries[![Masteries resource implemented version](https://camo.githubusercontent.com/1524fea31a8bfd794c6cbdb79010fae16c45849470fcc1b34f494d724bbfdfe1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d646570726563617465642d7265642e737667)](https://camo.githubusercontent.com/1524fea31a8bfd794c6cbdb79010fae16c45849470fcc1b34f494d724bbfdfe1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d646570726563617465642d7265642e737667)[Match](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Resources-and-endpoints#match-)[![Match resource implemented version](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)Runes[![Runes resource implemented version](https://camo.githubusercontent.com/1524fea31a8bfd794c6cbdb79010fae16c45849470fcc1b34f494d724bbfdfe1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d646570726563617465642d7265642e737667)](https://camo.githubusercontent.com/1524fea31a8bfd794c6cbdb79010fae16c45849470fcc1b34f494d724bbfdfe1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d646570726563617465642d7265642e737667)[Spectator](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Resources-and-endpoints#spectator-)[![Spectator resource implemented version](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)[Static Data](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Resources-and-endpoints#static-data-)[![Static Data resource implemented version](https://camo.githubusercontent.com/409b64737805c067a913b0ad6c33f3f9dd278eed1f7987716f7d5aaf209964e3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d5f776f726b696e672d627269676874677265656e2e737667)](https://camo.githubusercontent.com/409b64737805c067a913b0ad6c33f3f9dd278eed1f7987716f7d5aaf209964e3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d5f776f726b696e672d627269676874677265656e2e737667)Stats[![Stats endpoint implemented version](https://camo.githubusercontent.com/1524fea31a8bfd794c6cbdb79010fae16c45849470fcc1b34f494d724bbfdfe1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d646570726563617465642d7265642e737667)](https://camo.githubusercontent.com/1524fea31a8bfd794c6cbdb79010fae16c45849470fcc1b34f494d724bbfdfe1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d646570726563617465642d7265642e737667)[Status](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Resources-and-endpoints#status-)[![Status resource implemented version](https://camo.githubusercontent.com/4afbceb45c101ef90bd1da527864892b9f7d3308bd9eb939ce052947b14cfff9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76332d627269676874677265656e2e737667)](https://camo.githubusercontent.com/4afbceb45c101ef90bd1da527864892b9f7d3308bd9eb939ce052947b14cfff9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76332d627269676874677265656e2e737667)[Summoner](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Resources-and-endpoints#summoner-)[![Summoner resource implemented version](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)[TFT League](#)[![TFT League resource implemented version](https://camo.githubusercontent.com/480a84258aed6942f6ed2b9ecc466aabcd70d34b1c8057125c88e0db880f685c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76315f28756e746573746564292d79656c6c6f772e737667)](https://camo.githubusercontent.com/480a84258aed6942f6ed2b9ecc466aabcd70d34b1c8057125c88e0db880f685c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76315f28756e746573746564292d79656c6c6f772e737667)[TFT Match](#)[![TFT Match resource implemented version](https://camo.githubusercontent.com/1ee07fa7143aae2c82f5b2202ed15f0c9b8d6deb87931795bde414370b14de57/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d6e6f745f7965745f696d706c656d656e7465642d6f72616e67652e737667)](https://camo.githubusercontent.com/1ee07fa7143aae2c82f5b2202ed15f0c9b8d6deb87931795bde414370b14de57/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d6e6f745f7965745f696d706c656d656e7465642d6f72616e67652e737667)[TFT Summoner](#)[![TFT Summoner resource implemented version](https://camo.githubusercontent.com/1ee07fa7143aae2c82f5b2202ed15f0c9b8d6deb87931795bde414370b14de57/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d6e6f745f7965745f696d706c656d656e7465642d6f72616e67652e737667)](https://camo.githubusercontent.com/1ee07fa7143aae2c82f5b2202ed15f0c9b8d6deb87931795bde414370b14de57/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d6e6f745f7965745f696d706c656d656e7465642d6f72616e67652e737667)[Third Party Code](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI%3A-Resources-and-endpoints#third-party-code-)[![Third Party Code endpoint implemented version](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)[Tournament](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Resources-and-endpoints#tournament---tournament-stub-)[![Tournament resource implemented version](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)[Tournament Stub](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Resources-and-endpoints#tournament---tournament-stub-)[![Tournament Stub resource implemented version](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)](https://camo.githubusercontent.com/35420bf237577032392b60771539196f0a33bad66152841caeb64bfc3b2a03c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696d706c656d656e7465645f76657273696f6e2d76342d627269676874677265656e2e737667)[Initializing the library](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-How-to-begin)
----------------------------------------------------------------------------------------------------

[](#initializing-the-library)

How to begin?

```
//  Include all required files (installation via Composer is required)
require_once __DIR__  . "/vendor/autoload.php";

use RiotAPI\LeagueAPI\LeagueAPI;
use RiotAPI\LeagueAPI\Definitions\Region;

//  Initialize the library
$api = new LeagueAPI([
	//  Your API key, you can get one at https://developer.riotgames.com/
	LeagueAPI::SET_KEY    => 'YOUR_RIOT_API_KEY',
	//  Target region (you can change it during lifetime of the library instance)
	LeagueAPI::SET_REGION => Region::EUROPE_EAST,
]);

//  And now you are ready to rock!
$ch = $api->getStaticChampion(61); // Orianna getSummonerByName('I am TheKronnY');

echo $summoner->id;             //  KnNZNuEVZ5rZry3I...
echo $summoner->puuid;          //  rNmb6Rq8CQUqOHzM...
echo $summoner->name;           //  I am TheKronnY
echo $summoner->summonerLevel;  //  69

print_r($summoner->getData());  //  Or array of all the data
/* Array
 * (
 *     [id] => KnNZNuEVZ5rZry3IyWwYSVuikRe0y3qTWSkr1wxcmV5CLJ8
 *     [accountId] => tGSPHbasiCOgRM_MuovMKfXw7oh6pfXmGiPDnXcxJDohrQ
 *     [puuid] => rNmb6Rq8CQUqOHzMsFihMCUy4Pd201vDaRW9djAoJ9se7myXrDprvng9neCanq7yGNmz7B3Wri4Elw
 *     [name] => I am TheKronnY
 *     [profileIconId] => 3180
 *     [revisionDate] => 1543438015000
 *     [summonerLevel] => 69
 * )
 */
```

..or how to fetch a static champion data:

```
//  ...initialization...

//  this fetches the champion data and returns StaticChampionDto object
$champion = $api->getStaticChampion(61);

echo $champion->name;  //  Orianna
echo $champion->title; //  the Lady of Clockwork

print_r($champion->getData());  //  Or array of all the data
/* Array
 * (
 *    [id] => 61
 *    [name] => "Orianna"
 *    [key] => "Orianna"
 *    [title] => "the Lady of Clockwork"
 * )
 */
```

More usage examples for LeagueAPI can be found [here](https://github.com/dolejska-daniel/riot-api/blob/master/examples/LeagueAPI/README.md).

[Cache providers](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Cache-providers)
----------------------------------------------------------------------------------------------

[](#cache-providers)

Cache providers are responsible for keeping data of [rate limiting](#rate-limiting), [call caching](#call-caching) and [static data](##datadragon-api) within instances of the library for easy re-use. This feature is automatically enabled, when any of previously mentioned features is used.

When using this feature, you can set `LeagueAPI::SET_CACHE_PROVIDER` to any class, thought it has to be compatible with PSR-6 standard, eg. implement [`Psr\Cache\CacheItemPoolInterface`](https://github.com/php-fig/cache/blob/master/src/CacheItemPoolInterface.php) interface. By using `LeagueAPI::SET_CACHE_PROVIDER_PARAMS` or `LeagueAPI::SET_DD_CACHE_PROVIDER_PARAMS` option, you can pass any data to the cache provider class.

For additional information about cache providers, please see [the wiki pages](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Cache-providers).

[Rate limiting](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Rate-limiting)
------------------------------------------------------------------------------------------

[](#rate-limiting)

This clever feature will easily prevent exceeding your per key call limits &amp; method limits. In order to enable this feature, you have to set `LeagueAPI::SET_CACHE_RATELIMIT` to `true`. Everything else is completly automatic, so all you need to do is to enable this feature.

For additional information about rate limiting, please see [the wiki pages](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Rate-limiting).

[Call caching](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Call-caching)
----------------------------------------------------------------------------------------

[](#call-caching)

This feature can prevent unnecessary calls to API within short timespan by temporarily saving fetched data from API and using them as the result data. In order to enable this feature, you have to set `LeagueAPI::SET_CACHE_CALLS` to `true`. You should also provide `LeagueAPI::SET_CACHE_CALLS_LENGTH` option to specify cached data lifetime or else default time interval of `60 seconds` will be used.

For additional information about API call caching, please see [the wiki pages](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Call-caching).

[Asynchronous requests](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Asynchronous-requests)
----------------------------------------------------------------------------------------------------------

[](#asynchronous-requests)

This feature allows request grouping and their asynchronous sending using [Guzzle](https://github.com/guzzle/guzzle). After request is sent and its response received, user provided callbacks are invoked with received data.

For additional information about asynchronous requests, please see [the wiki pages](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Asynchronous-requests).

[StaticData endpoints](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-StaticData-endpoints)
--------------------------------------------------------------------------------------------------------

[](#staticdata-endpoints)

These endpoints provide you with easy way to transform StaticData into object instances and easily work with them. They are also supported in numerous DataDragonAPI functions (displaying images).

For additional information about StaticData endpoints, please see [the wiki pages](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-StaticData-endpoints).

[StaticData linking](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-StaticData-linking)
----------------------------------------------------------------------------------------------------

[](#staticdata-linking)

This feature allows you to automatically link static data related to your request, any data are managed through `DataDragonAPI`. All the static data will be locally cached, which makes this operation very fast after its initial requests. Also, any requests made by `DataDragonAPI` do not count towards your rate limit.

For additional information about StaticData linking, please see [the wiki pages](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-StaticData-linking).

[Extensions](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Extensions)
------------------------------------------------------------------------------------

[](#extensions)

Using extensions for `ApiObject`s is extremely useful tool, allowing implementation of your own methods and logic into the `ApiObject`s themselves. Extensions are enabled by using settings option `LeagueAPI::SET_EXTENSIONS` when initializing the library.

For additional information about API object extensions, please see [the wiki pages](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Extensions).

[Callback functions](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Callback-functions)
----------------------------------------------------------------------------------------------------

[](#callback-functions)

Allows you to provide custom functions to be called before and after the actual API request is sent.

Before callbacks have ability to cancel upcomming request - when `false` is returned by *any callback* function, exception `Exceptions\RequestException` is raised and request is cancelled.

For additional information about callback functions, please see [the wiki pages](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-Callback-functions).

[CLI support](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-CLI-support)
--------------------------------------------------------------------------------------

[](#cli-support)

You can also use the library in command line environment:

```
root@localhost:~/riot-api/src/LeagueAPICLI# leagueapicli summoner:get-by-name "I am TheKronnY" --pretty --config ~/config.json
{
    "id": "Y0ac04pquunxrtvEtxWsG8hX0EBYSFfVuuL6JsR5AaWOoLo",
    "accountId": "UIctwb-75CS_vCHe494r-cDO9zlvGzu4JVdWIb_ox7xqmg",
    "puuid": "XYPInPFGOn1mqOmkzZEtf9jzNCUTK5KviHWxNfNnmWZ_4EovMV-q02qY5rXtRGWl1Nb_oK-2D1m4Bg",
    "name": "I am TheKronnY",
    "profileIconId": 540,
    "revisionDate": 1566761498000,
    "summonerLevel": 111
}
```

For additional information about CLI support, please see [the wiki pages](https://github.com/dolejska-daniel/riot-api/wiki/LeagueAPI:-CLI-support). More usage examples for LeagueAPICLI can be found [here](https://github.com/dolejska-daniel/riot-api/blob/master/examples/LeagueAPICLI/README.md).

[DataDragon API](https://github.com/dolejska-daniel/riot-api/wiki/DataDragonAPI:-How-to-begin)
==============================================================================================

[](#datadragon-api)

How easy is it to work with static images? For instance, to get loading screen art of Orianna?

**Source**:

```
echo DataDragonAPI::getChampionLoading('Orianna');
echo DataDragonAPI::getChampionLoading('Orianna', 7);
```

**Output**:

```

```

**Render**:

[![Orianna](https://camo.githubusercontent.com/189a2438117ef28386ffeefb78c2189cb468a9f6eb607e3cfb54fc8653c6134a/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f696d672f6368616d70696f6e2f6c6f6164696e672f4f7269616e6e615f302e6a7067)](https://camo.githubusercontent.com/189a2438117ef28386ffeefb78c2189cb468a9f6eb607e3cfb54fc8653c6134a/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f696d672f6368616d70696f6e2f6c6f6164696e672f4f7269616e6e615f302e6a7067)[![Dark Star Orianna](https://camo.githubusercontent.com/e06e171913899b96f92ee61c65d587a775336ec7b4249d26712e520bccb264aa/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f696d672f6368616d70696f6e2f6c6f6164696e672f4f7269616e6e615f372e6a7067)](https://camo.githubusercontent.com/e06e171913899b96f92ee61c65d587a775336ec7b4249d26712e520bccb264aa/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f696d672f6368616d70696f6e2f6c6f6164696e672f4f7269616e6e615f372e6a7067)

...a bit of nostalgia?

**Source**:

```
DataDragonAPI::iniByVersion('0.151.2');
echo DataDragonAPI::getItemIcon(3132);
echo DataDragonAPI::getItemIcon(3126);
echo DataDragonAPI::getItemIcon(3138);
```

**Output**:

```

```

**Render**:

[![Heart of Gold](https://camo.githubusercontent.com/c48d2f0adfd0f2751f2fa2c4a89cb3cb4f7d89785d27d2e647bc7ca20d5d8c1f/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f302e3135312e322f696d672f6974656d2f333133322e706e67)](https://camo.githubusercontent.com/c48d2f0adfd0f2751f2fa2c4a89cb3cb4f7d89785d27d2e647bc7ca20d5d8c1f/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f302e3135312e322f696d672f6974656d2f333133322e706e67)[![Madred's Bloodrazor](https://camo.githubusercontent.com/a67108a8392d80dfd8cd393a76227fe4182c1542206e84b7eb0b7349d3c47ed3/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f302e3135312e322f696d672f6974656d2f333132362e706e67)](https://camo.githubusercontent.com/a67108a8392d80dfd8cd393a76227fe4182c1542206e84b7eb0b7349d3c47ed3/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f302e3135312e322f696d672f6974656d2f333132362e706e67)[![Leviathan](https://camo.githubusercontent.com/6810a10e672486c52eabab89a4b9a5b26bee50bd5ffc32b4fa003de64b5358d0/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f302e3135312e322f696d672f6974656d2f333133382e706e67)](https://camo.githubusercontent.com/6810a10e672486c52eabab89a4b9a5b26bee50bd5ffc32b4fa003de64b5358d0/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f302e3135312e322f696d672f6974656d2f333133382e706e67)

...or to display icon of champion and its spells based on its object from API?

**Source**:

```
// ...

$orianna = $api->getStaticChampion(61, true);
echo DataDragonAPI::getChampionSplashO($orianna);

foreach($orianna->spells as $spell)
    echo DataDragonAPI::getChampionSpellIconO($spell);
```

**Output**:

```

```

**Render**:

[![Orianna](https://camo.githubusercontent.com/f0c9a43080775d8c598b6054b2ab1cbfa43e0a849a60766d086c74c99f5fdc85/68747470733a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f382e32342e312f696d672f6368616d70696f6e2f4f7269616e6e612e706e67)](https://camo.githubusercontent.com/f0c9a43080775d8c598b6054b2ab1cbfa43e0a849a60766d086c74c99f5fdc85/68747470733a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f382e32342e312f696d672f6368616d70696f6e2f4f7269616e6e612e706e67)[![OrianaIzunaCommand](https://camo.githubusercontent.com/1a05c15d6f5630fd96134d36eae55bae3e07058f1ac9ffe154d2aa1478ac5987/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f382e32342e312f696d672f7370656c6c2f4f7269616e61497a756e61436f6d6d616e642e706e67)](https://camo.githubusercontent.com/1a05c15d6f5630fd96134d36eae55bae3e07058f1ac9ffe154d2aa1478ac5987/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f382e32342e312f696d672f7370656c6c2f4f7269616e61497a756e61436f6d6d616e642e706e67)[![OrianaDissonanceCommand](https://camo.githubusercontent.com/a3b3289bdef6161caaa5737a74b7d420c7764f6225c24d5d0ffd4a6164566f1c/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f382e32342e312f696d672f7370656c6c2f4f7269616e61446973736f6e616e6365436f6d6d616e642e706e67)](https://camo.githubusercontent.com/a3b3289bdef6161caaa5737a74b7d420c7764f6225c24d5d0ffd4a6164566f1c/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f382e32342e312f696d672f7370656c6c2f4f7269616e61446973736f6e616e6365436f6d6d616e642e706e67)[![OrianaRedactCommand](https://camo.githubusercontent.com/6056b472f3a49b85aa261b9c26df6fec08c62a95dbcee65d7a2b5e8a12da3651/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f382e32342e312f696d672f7370656c6c2f4f7269616e61526564616374436f6d6d616e642e706e67)](https://camo.githubusercontent.com/6056b472f3a49b85aa261b9c26df6fec08c62a95dbcee65d7a2b5e8a12da3651/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f382e32342e312f696d672f7370656c6c2f4f7269616e61526564616374436f6d6d616e642e706e67)[![OrianaDetonateCommand](https://camo.githubusercontent.com/d10a4545e76ab728017dca0dc0157aa9c40a1c46ae70b8d4b997358ebc9cb75f/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f382e32342e312f696d672f7370656c6c2f4f7269616e614465746f6e617465436f6d6d616e642e706e67)](https://camo.githubusercontent.com/d10a4545e76ab728017dca0dc0157aa9c40a1c46ae70b8d4b997358ebc9cb75f/687474703a2f2f64647261676f6e2e6c65616775656f666c6567656e64732e636f6d2f63646e2f382e32342e312f696d672f7370656c6c2f4f7269616e614465746f6e617465436f6d6d616e642e706e67)

For more, please see [the wiki pages](https://github.com/dolejska-daniel/riot-api/wiki/DataDragonAPI:-How-to-begin). More usage examples for DataDragonAPI can be found [here](https://github.com/dolejska-daniel/riot-api/blob/master/examples/DataDragonAPI/README.md).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2084d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24529191?v=4)[islem-kms](/maintainers/islem-kms)[@islem-kms](https://github.com/islem-kms)

---

Top Contributors

[![islem-kms](https://avatars.githubusercontent.com/u/24529191?v=4)](https://github.com/islem-kms "islem-kms (1 commits)")

---

Tags

apiwrapperleague of legendsPHP7Riotdata dragon

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/islem-kms-riot-api/health.svg)

```
[![Health](https://phpackages.com/badges/islem-kms-riot-api/health.svg)](https://phpackages.com/packages/islem-kms-riot-api)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[commercetools/commercetools-sdk

The official PHP SDK for the commercetools Composable Commerce APIs

19281.5k](/packages/commercetools-commercetools-sdk)[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.1k](/packages/dariusiii-tmdb-laravel)[michaelgarrez/lol-api

Wrapper for League of Legends API

182.6k](/packages/michaelgarrez-lol-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
