PHPackages                             lpphan/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. lpphan/riot-api

ActiveLibrary[API Development](/categories/api)

lpphan/riot-api
===============

A simple wrapper for the League of Legends API.

0.1.1(9y ago)144MITPHP &gt;=5.5

Since Jun 22Compare

[ Source](https://github.com/lamphuong223/riot-api-php)[ Packagist](https://packagist.org/packages/lpphan/riot-api)[ RSS](/packages/lpphan-riot-api/feed)WikiDiscussions Synced yesterday

READMEChangelogDependencies (2)Versions (3)Used By (0)

League of Legends API wrapper in PHP
------------------------------------

[](#league-of-legends-api-wrapper-in-php)

Version 0.1.1

### Introduction

[](#introduction)

A simple PHP wrapper for [League of legends API](https://developer.riotgames.com/api/methods).

### How to Install

[](#how-to-install)

Require the package with composer:

```
composer require lpphan/riot-api

```

### Example usage

[](#example-usage)

```
use Lpphan\RiotApi;

// Load up the API
$api = new RiotApi($apiKey);

// Load up the summoner api object.
$summoner = $api->summonerApi();

// Get the information about this user, this will return an Lpphan\Response object
$response  = $summoner->getSummonerByNames($arrayOfSummonerName);

$info = $response->getBody();
print_r($info);
```

### Regions

[](#regions)

You can set the region that you wish to query. By default it is 'na' but it can be changed.

```
use Lpphan\RiotApi;
use Lpphan\Regions;

// Load up the API
$api = new RiotApi($apiKey);
$api->setRegion(Regions::BR);

//or
$summoner = $api->summonerApi();
$api->setRegion(Regions::BR);
$summoner->getSummonerByNames($array);
```

### Cache

[](#cache)

By default, the cache requires `memcached` to be installed and operating on default port and localhost.

```
use Lpphan\RiotApi;

$api = new RiotApi($apiKey);
$summoner = $api->summonerApi();

//Cache this response for 5 minutes
$response = $summoner->getSummonerByNames(['summonerName'])->remember(5);

//or use this
$api->remember($response,5);
```

The cache can be changed by implement your own version of `Lpphan\CacheInterface`;

```
use Lpphan\RiotApi;

//set custom cache
$api = new RiotApi($apiKey,$cacheProvider);

//or use this
$api->setCache($cacheProvider);
```

### Exceptions handling

[](#exceptions-handling)

```
use Lpphan\RiotApi;

$api = new RiotApi($apiKey);
$summoner = $api->summonerApi();

try{
	$response = $summoner->getSummonerByNames(['summonerName']);
}catch (Lpphan\Exception\Http404Exception $e){
	//throw when a 404 http error is found
}catch (Lpphan\Exception\Http429Exception $e){
        //Rate limit exceeded
        //Should retry after
        $seconds = $e->retryAfter();
}catch (Lpphan\Exception\HttpException $e){
	//throw for all http error
}
```

//Todo : add doc

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

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

Every ~44 days

Total

2

Last Release

3616d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14314629?v=4)[Lam Phuong Phan](/maintainers/lamphuong223)[@lamphuong223](https://github.com/lamphuong223)

---

Top Contributors

[![lamphuong223](https://avatars.githubusercontent.com/u/14314629?v=4)](https://github.com/lamphuong223 "lamphuong223 (4 commits)")

---

Tags

apiproxywrapfacadeleague of legendsLoLRiot

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[league-php/leaguewrap

A wrapper for the League of Legends API.

2011.2k1](/packages/league-php-leaguewrap)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[michaelgarrez/lol-api

Wrapper for League of Legends API

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

PHPackages © 2026

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