Overview

This set of documentation will help you gain a better understanding of how to use the APIs and developer resources related to League of Legends. It is designed to help you begin developing your own tools and products for the League of Legends player community.

Getting Started

Before starting on a product for League of Legends, there are two requirements every developer must complete:

Only after developers have read the policies and registered their product on the Developer Portal are they granted a limited license to use Riot Games’ intellectual property (IP) outlined in the Legal Jibber Jabber.

Before you start reading this documentation you need to first login with your Riot Games account. Once you do, a Developer Portal account is created for you! This action also generates a basic development API key that is associated with your account. Parts of this documentation will reference trying things out in the API Reference page. While this documentation is by no means exhaustive we believe it will give you a great start toward building products in the League of Legends ecosystem. As always, if you run into any difficulties or are having technical issues please join Developer Discord for support.

Routing Values

The first step to executing a request to the League of Legends API is to select the correct host to execute your request to. The League of Legends (LoL) API uses what we call routing values in the domain to ensure your request is properly routed. We use both platform ids and regions as routing values (e.g., na1 and americas). These routing values are determined by the topology of the underlying services. Services are frequently clustered by platform resulting in platform ids being used as routing values. Occasionally services are clustered by region, which is when regional routing values are used. The best way to tell if an endpoint uses a platform or a region as a routing value is to execute a sample request through the reference page.

Platform Routing Values

Platform

Host

BR1

br1.api.riotgames.com

EUN1

eun1.api.riotgames.com

EUW1

euw1.api.riotgames.com

JP1

jp1.api.riotgames.com

KR

kr.api.riotgames.com

LA1

la1.api.riotgames.com

LA2

la2.api.riotgames.com

NA1

na1.api.riotgames.com

OC1

oc1.api.riotgames.com

TR1

tr1.api.riotgames.com

RU

ru.api.riotgames.com

Regional Routing Values

Region

Host

AMERICAS

americas.api.riotgames.com

ASIA

asia.api.riotgames.com

EUROPE

europe.api.riotgames.com

Uptime

There is currently no service-level agreement (SLA) for the Riot Games API.

General

Game Constants

When looking up specific seasons, queues, maps and modes it is important to use the correct ids.

Seasons

Season ids are used in match history to indicate which season a match was played. A full list of season ids can be found in the file below.

Game Types

Ranked Info

Queue Types

The leagues endpoints return a field called queueType that will indicate what map/mode that player played. Depending on the queueType the highestTierAchieved field will return the highest ending tier for the previous season from a group of ranked queues.

Here is a list of all of the queueType and highestTierAchieved for each.

Data Dragon

Data Dragon is our way of centralizing League of Legends game data and assets, including champions, items, runes, summoner spells, and profile icons. All of which can be used by third-party developers. You can download a compressed tarball (.tgz) for each patch which will contain all assets for that patch. Please be aware that updating Data Dragon after each League of Legends patch is a manual process, so it is not always updated immediately after a patch.

Versions

You can find all valid Data Dragon versions in the versions file. Typically there's only a single build of Data Dragon for a given patch, however occasionally there will be additional builds. This typically occurs when there's an error in the original build. As such, you should always use the most recent Data Dragon version for a given patch for the best results.

Data & Assets

Data Dragon provides two kinds of static data; data files and game assets. The data files provide raw static data on various components of the game such as summoner spells, champions, and items. The assets are images of the components described in the data files.

Data Files

The data file urls include both a version and language code. The examples in the documentation below use version 10.11.1 and the en_US language code. If you want to view assets released in other versions or languages you can replace the version or language code in the url.

Languages

Data Dragon provides localized versions of each of the data files in languages supported by the client. Below is a list of the languages supported by Data Dragon, which you can also retrieved from the Data Dragon languages file.

Champions

There are two kinds of data files for champions. The champion.json data file returns a list of champions with a brief summary. The individual champion JSON files contain additional data for each champion.

Interpreting Spell Text

Lore, tips, stats, spells, and even recommended items are all part of the data available for every champion. Champion spell tooltips often have placeholders for variables which are signified by double curly brackets. Below are some tips about interpreting these placeholders:

{{ eN }} placeholders
Placeholders are replaced by the corresponding item in the array given in the effectBurn field (e.g., {{ eN }} is a placeholder for spell["effectBurn"]["1"]).

{{ aN }} or {{ fN }} placeholders
These placeholders are slightly more complicated. Their values can be found in the vars field. First, find the object in the vars array whose key matches the variable (e.g., for {{ a1 }}, find the object in the vars array whose key field has the value a1). The value for this variable is the coeff field in that same object.

Under a champions spells there are two fields effect and effectBurn. effect contains an array of an ability's values per level where, in contrast, effectBurn contains a string of all the values at every level. (e.g., "effect": [30,60,90,120,150] vs "effectBurn": "30/60/90/120/150"). You might notice how the effect and effectBurn arrays have a null value in the 0 index. This is because those values are taken from designer-facing files where arrays are 1-based. JSON is 0-based so a null is inserted to make it easier to verify the JSON files are correct.

Calculating Spell Costs

In most cases a spell costs mana or energy, you'll find those related costs under the cost and costBurn fields. When a spell costs health, the cost will be found in the effect and effectBurn fields. You should always be able to determine how to calculate the cost of a spell by looking at the resource field which should point you to the variable being used to display the cost of a spell.

Champion Splash Assets

The number at the end of the filename corresponds to the skin number. You can find the skin number for each skin in the file for each individual champion in Data Dragon. Each champion contains a skins field and the skin number is indicated by the num field.

Champion Ability Assets

You can find the filename for each champion's abilities in the individual champion Data Dragon file. The spells field contains an array of objects which includes image data. The filename is indicated by the full field.

/* Anivia (id: 34) */
"spells": [
{
"name": "Flash Frost",
"key": "FlashFrost",
"description": "Anivia brings her wings together and summons a sphere of ice that flies towards her opponents, chilling and damaging anyone in its path. When the sphere explodes it does moderate damage in a radius, stunning anyone in the area.",
"sanitizedDescription": "Anivia brings her wings together and summons a sphere of ice that flies towards her opponents, chilling and damaging anyone in its path. When the sphere explodes it does moderate damage in a radius, stunning anyone in the area.",
"image": {
"full": "FlashFrost.png",
"sprite": "spell0.png",
"group": "spell",
"x": 192,
"y": 144,
"w": 48,
"h": 48
}
},
...
]

Items

Data Dragon also provides the same level of detail for every item in the game. Within Data Dragon you can find info such as the item's description, purchase value, sell value, items it builds from, items it builds into, and stats granted from the item.

There is a field called effect which holds an array of variables used extra scripts. As an example, on Doran's shield you see the following data in the effect field, which corresponds to the 8 damage that is blocked from champion attacks.

"effect": {
"Effect1Amount": "8"
}

Stat Naming Conventions

A list of possible stats that you gain from items, runes, or masteries can also be found in Data Dragon. You can find a list of stats gained by the item, rune, or mastery by searching for the stats field. Below are some tips when it comes to understanding what a stat means and how they are calculated:

Mod stands for modifier.

An "r" at the beginning of the stat means those stats can be found on runes.

Displaying flat vs. percentage vs. per 5 etc. is unfortunately case by case. For a given stat, though, it will always be the same. (e.g., PercentAttackSpeedMod you always multiply by 100 and display it as a percentage)

Stats are called flat if you add them together, and percent if you multiply them together.

Tenacity from an item does NOT stack but tenacity from a rune DOES stack.

Riot Games API

Tournament API

League of Legends leverages custom game lobbies to support developers that want to build Tournaments for players. Custom games can utilize Tournament Codes that help you quickly and easily get players into private custom game lobbies with preset game settings (map, pick type, etc). At the completion of each Tournament Code enabled game the results will be forwarded automatically (HTTP POST) to a URL specified by the tournament developer.

When getting started with the Tournaments API it is important to understand what you can do with it:

Register tournament providers and tournaments in a specific region/shard and its callback URL.

Generate tournament codes for a given tournament.

Receive game results in the form of an automatic callback (HTTP POST) from League of Legends servers whenever a game created using tournament code has been completed.

Use match identifier (matchID) received in the callback to pull full stats data for the given match.

Pull end of game data based on given tournament code in case the callback is never received.

Query pre-game lobby player activity events for a given tournament code.

Tournament API Notes

Tournament providers are strongly associated with API keys, regenerating an API key will require a new provider.

Though tournament codes can be re-used to generate additional lobbies. For best results with callbacks and Match-v4 lookups, we recommend only creating a single match with a tournament code.

Lobby events should only be used to audit Tournament matches as needed. In rare cases lobby events may get dropped. Using lobby events to programmatically progress a tournament or to forfeit participants is not advised.

Tournaments will expire if there are no active codes associated with the tournament. Tournament codes are eligible for expiration three months after they're generated. Because tournaments and their codes can expire, creating them as close to the event as possible ensures no disruptions. For the best results we suggest the following:

Create a tournament no more than a week before the start of the first match.

Upon creation of the tournament, generate a code to ensure the tournament has an active tournament code associated with it (thereby making ineligible for cleanup).

Tournament codes should be generated as needed, not all at once at the start of the event.

Tournaments API Structure

Tournaments API Methods

Access to the Tournaments API provides several new methods that can be viewed on the API Reference page. We suggest exploring every method to get more information on actual usage including the format and description of parameters you can supply.

Full overview of all methods and their functionality is provided in the diagram below:

Best Practices

To preserve the quality of the tournaments service, your Tournaments API Key may be revoked if you do not adhere to the following best practices:

Respect the rate limit for your Tournament API Key and implement logic that considers the headers returned from a 429 Rate Limit Exceeded response.

Implement logic to detect unsuccessful API calls and back off accordingly. Please notify us if you believe your application is working correctly and you are receiving errors, but don't continue to slam the tournaments service with repeatedly unsuccessful calls.

Generate tournaments and tournament codes only as needed in production and development. Please don't create 1,000 tournament codes for a 10 game tournament. As a reminder, you can always create additional tournament codes as your tournament grows.

Tournaments and tournament codes should be generated within a reasonable time in relation to the event. Don't pre-create tournaments and tournament codes at the start of the year and use them as the year progresses, but rather generate the tournament and codes as the event is announced and participants sign up.

Use Case Example

Presume there is a tournament website created for League of Legends players that does the following:

Announces tournament and rules

Registers players/teams

Generates/renders tournament brackets

Seeds registered teams across the brackets

Sends invites for matched teams to play their games

Collects end of game results from team captains

Provides new matches for teams that advance

Officiates for situations when something goes wrong (no show, etc)

The Tournaments API is designed to help automate the last four mentioned functions of tournament websites.

It is recommended to register a tournament provider (specifying region/shard and URL for results) well in advance and do a full loop testing to ensure everything is setup properly for your web service.

GENERATING TOURNAMENT CODES

To generate actual tournament codes follow the steps below:

Use /lol/tournament/v4/providers API endpoint to register as a provider in specific region while also setting a URL to be used for receiving game results notifications (HTTP POST). Returns providerID.

Use providerID to register a tournament for given Tournament Provider. Receive tournamentID in return.

Use tournamentID to generate one or more tournament codes for a given tournament using specific game settings (map, spectator rules, pick type etc).

A tournament code should only be used to create a single match. If you reuse a tournament code the server callback will not return stats for each match.

The method to generate tournament codes will return up to 1,000 tournament codes at a time. If needed, additional calls to this method can be made to create additional tournament codes.

Stale or unused tournament codes may be purged after a period of inactivity.

Tournament organizers can generate all the tournament codes they need in advance or generate them as necessary per each phase as shown below:

SERVER CALLBACK

When a game created using tournament code has completed, the League of Legends servers will automatically make a callback to the tournament provider's registered URL via HTTP POST. Below are a couple notes about how the server callback works.

The provider registration and callback mechanism are relatively inflexible. For best results, use one of the valid generic top level domains (gTLDs) listed below and use http over https for your callback url while using the metaData field to validate callbacks.

The callback from the League of Legends server relies on a successful response from the provider's registered URL. If a 200 response is not detected, there is a retry mechanism that will make additional attempts. In the rare occasion that a callback is not received within 5 minutes, you can assume the callback failed.

If you need to change your provider callback URL, you can register a new provider but remember tournaments generated with the old provider will continue to make callbacks to the old provider callback URL.

When a game created using Tournament Code has completed, the League of Legends servers will automatically make a callback to the tournament provider's registered URL via HTTP POST. Below are a couple notes about how the server callback works.

If you're having trouble debugging your logic, use the following cURL to mimic the behavior of the callback.

LOBBY EVENTS

In addition to game stats related methods, the lobby-events/by-code/{tournamentCode} method that can help query pre-game lobby events. This is useful for building tournament administration system and be able to detect whether a game for a given tournament code started normally. This call can be made both after the match for the full timeline, and anytime during the lobby phase for a timeline of events up to that moment. Below is an example of the JSON returned for lobby events:

League Client API

What is the League Client API?

In an article on the Riot Games Engineering Blog, there's an image that is useful for defining what we're classifying as "League Client APIs".

Specifically, we're referring to a set of protocols that the Chromium Embedded Framework (CEF) uses to communicate with a C++ Library that in turn communicates with the League of Legends platform. As you'll notice, the communications between the C++ library and the CEF all occur locally on your desktop. This is the League Client API. This service is not officially supported for use with third party applications.

NOTE: We provide no guarantees of full documentation, service uptime, or change communication for unsupported services. This team does not own any components of the underlying services, and will not offer additional support related to them.

What's next

Whether you're combining the Riot Games API and League Client API, or doing something by only using the League Client endpoints, we need to know about it. Either create a new application or leave a note on your existing application in the Developer Portal. We need to know which endpoints you're using and how you're using them in order to expand on current or future feature sets. If you have any questions please join the Developer Discord for help.

Game Client API

The Game Client APIs are served over HTTPS by League of Legends game client and are only available locally for native applications.

Root Certificate / SSL Errors

The League of Legends client and the game client use a self-signed certificate for HTTPS requests. To use the Game Client API, you can ignore these errors or use the root certificate to validate the game client's SSL certificate. If you're testing locally, you can use the following insecure CURL that will ignore the SSL certificate errors.

curl --insecure https://127.0.0.1:2999/swagger/v3/openapi.json

Swagger

You can request the Swagger v2 and OpenAPI v3 specs for the Game Client API with the following urls:https://127.0.0.1:2999/swagger/v2/swagger.jsonhttps://127.0.0.1:2999/swagger/v3/openapi.json

Live Client Data API

The Live Client Data API provides a method for gathering data during an active game. It includes general information about the game as well player data.

Get All Game Data

The Live Client Data API has a number of endpoints that return a subset of the data returned by the /allgamedata endpoint. This endpoint is great for testing the Live Client Data API, but unless you actually need all the data from this endpoint, we suggest one of the endpoints listed below that return a subset of the response.

GET https://127.0.0.1:2999/liveclientdata/allgamedata
Get all available data.

Replay API

What is the Replay API?

The Replay API allows developers to adjust the in-game camera during replays. We released League Director as an open source example of how a tool can leverage the Replay API.

Getting Started

By default the Replay API is disabled. To get started using the Replay API you will first need to enable the Replay API in the game client config. To do so you will need to locate where your game is installed and add the following lines to the game.cfg file:

Example file location:C:\Riot Games\League of Legends\Config\game.cfg

[General]
EnableReplayApi=1

Once you have enabled the Replay API, the game client will generate the Swagger v2 and OpenAPI v3 specs for the Replay API which will indicate that the Replay API is usable.

Endpoints

GET https://127.0.0.1:2999/replay/game
Information about the game client process.

GET https://127.0.0.1:2999/replay/playback
Returns the current replay playback state such as pause and current time.

POST https://127.0.0.1:2999/replay/playback
Allows modifying the playback state such as play / pause and the game time to seek to. All values are optional.

GET https://127.0.0.1:2999/replay/render
Returns the current render properties.

POST https://127.0.0.1:2999/replay/render
Allows modifying the current render properties. All values are optional.

GET https://127.0.0.1:2999/replay/recording
Returns the current status of video recording. Poll this resource for progress on the output.

POST https://127.0.0.1:2999/replay/recording
Post to begin a recording specifying the codec and output filepath. Subsequent GET requests to this resource will update the status.

GET https://127.0.0.1:2999/replay/sequence
Returns the sequence currently being applied.

POST https://127.0.0.1:2999/replay/sequence
Post to apply a sequence of keyframes that the replay should play. Post an empty object to remove the sequence.