Using the league-v4 Endpoint to get the ranks of a summoner
The summoner-v4 API in League of Legends is used to get ranking informations about a player or a league.
The base url is https://{platform}.api.riotgames.com/lol/league/v4/
Please make sure to replace {platform} with your current platform.
By Summoner
Using this method you can get the rank(s) of a player using their encrypted summoner id which you can get with summoner-v4.
https://{platform}.api.riotgames.com/lol/league/v4/entries/by-summoner/{encryptedSummonerId}
The result is an array of queueTypes. If the player is not ranked in the queueType or hasn't finished their placement games the queueType won't appear in the result. That can lead to an empty [] result, especially after a rank reset.
[{
"leagueId":"cb92okpj-feiwo3-442",
"queueType":"RANKED_SOLO_5x5",
"tier":"BRONZE",
"rank":"II",
"summonerId":"kjIOiopj24_jinnBzuhbHu8bkov6lBh",
"summonerName":"name",
"leaguePoints":100,
"wins":80,
"losses":302,
"veteran":false,
"inactive":false,
"freshBlood":false,
"hotStreak":false,
"miniSeries": {
"target": 3,
"wins": 2,
"losses": 2,
"progress": "LWLWN"
}
}, {
...
"queueType":"RANKED_FLEX_SR",
...
}]
Fields
The fields can apply multiple times, as the result is an array of LeagueEntryDTOs[]
LeagueEntryDTO
Field | Type | Note |
---|---|---|
leagueId | String (leagueId) | The ID of the league the summoner currently is in. |
queueType | String (ENUM) | RANKED_SOLO_5x5 or RANKED_FLEX_SR |
tier | String (ENUM) | From IRON to CHALLENGER. The current tier of the summoner. |
rank | String (ENUM) | FROM I (1) to IV (4). Apex-tiers (MASTER+) are always rank I. |
summonerId | String | Also called "encrypted summoner id". Id is unique per platform and used to identify the player in this response. |
summonerName | String | Name of the summoner. |
leaguePoints | Number | The current LP of the summoner. |
wins | Number | Number of wins of the summoner during the ranked season in the queueType. |
losses | Number | Number of losses of the summoner during the ranked season in the queueType. |
veteran | Boolean | The summoner has played more than 100 games in the division. |
inactive | Boolean | The summoner isn't playing actively. This field is true if the player will decay in high-elo. |
freshBlood | Boolean | The summoner is new to the division. |
hotStreak | Boolean | Winning streak of 3 or higher. |
miniSeries | miniSeriesDTO | Only set if a mini series is given. Mini series are the promotion series of a summoner. |
MiniSeriesDTO
Keep in mind that the mini series is only set if a summoner is in his promos.
Field | Type | Note |
---|---|---|
target | Number | How many wins are needed to successfully complete the promos. |
wins | Number | The wins of a summoner during the promotion series. |
losses | Number | The losses of a summoner during the promotion series. |
progress | String | The progress as a string. In which order a player won/lost games. W=WIN, L=LOSS, N=NOT-PLAYED |
Understanding the response
A short explanation of the current response (JSON snippet above) into "words":
The summoner 'name' is BRONZE 2 in ranked solo/duo with 100LP and a 20% winrate. The summoner is currently 2w/2l in his promotions and won his last game.
Frequently Asked Questions
Is it possible to get historical ranks of a sumoner?
No, that's not possible. If you want to know how much LP a summoner got during a game, you need to track the summoners LP before and after the game.