League of legends skinned launcher là gì

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

To execute a request to the League of Legends API, select the correct host to execute your request to. The League of Legends [LoL] API uses routing values in the domain to ensure your request is properly routed. Platform IDs and regions are used as routing values, for example, 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

PlatformHostBR1br1.api.riotgames.comEUN1eun1.api.riotgames.comEUW1euw1.api.riotgames.comJP1jp1.api.riotgames.comKRkr.api.riotgames.comLA1la1.api.riotgames.comLA2la2.api.riotgames.comNA1na1.api.riotgames.comOC1oc1.api.riotgames.comTR1tr1.api.riotgames.comRUru.api.riotgames.com

Regional Routing Values

RegionHostAMERICASamericas.api.riotgames.comASIAasia.api.riotgames.comEUROPEeurope.api.riotgames.comSEAsea.api.riotgames.com

There is currently no service-level agreement [SLA] for the Riot Games API.

Use Cases

Riot analyzes two main factors when evaluating applications:

  • Is the use case good and approved?
  • Does the developer show they will deliver on that use case?

To demonstrate that your app meets the use case, you should be able to have one or more of the following:

  • Be an established brand that wants to add Riot Games to its portfolio.
  • New app that is fully functional and testable by Riot.
  • Prototype that is mostly testable by Riot.
  • Mockups where Riot can clearly express your intent and the user flow.
  • A deck that shows your ambition and intent and some of the user flow.

Riot needs to see the user flow to understand what your intended player experience is, such as account creation process, login pipeline, or queuing up for match pipeline.

You must also send a link to a working site, mockup, prototype, or rendering where it is easy to understand the user flows of the tool.

Examples of Approved Use Cases for Personal Keys

  • Personal sites
  • School projects
  • Creating a proof of concept for a Production Key request

Examples of Approved Use Cases for Production Keys

  • Showing [self] player stats
  • Running tournaments
  • Training tools that allow players to view their own match histories and aggregate stats
  • Looking For Game [LFG] tools
  • Game overlays that provide static data that is available prior to the game
  • Aggregate player stats [no specific players]
  • Official Ladder Leaderboards

Examples of Unapproved Use Cases

The following use cases will not be approved:

  • Products may not provide any game-session-specific information that would be previously unknown to the player
  • Apps that dictate player decisions
  • Apps that violate the general game policies

Examples of LoL Personal Keys

  • Personal keys are meant for smaller-size, personal projects
  • Production keys are meant for larger-size, professional projects

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.

seasons.json

[
  {
    "id": 0,
    "season": "PRESEASON 3"
  },
  ...
]

Queue Ids

Queue ids show up in several places throughout the API and are used to indicate which kind of match was played. A full list of queue ids can be found in the file below.

Note: In early 2022, we divided URF [previously

[
  {
    "gameMode": "CLASSIC",
    "description": "Classic Summoner's Rift and Twisted Treeline games"
  },
  ...
]
2 900] into separate queues - ARURF [
[
  {
    "gameMode": "CLASSIC",
    "description": "Classic Summoner's Rift and Twisted Treeline games"
  },
  ...
]
2 900] and Pick URF [
[
  {
    "gameMode": "CLASSIC",
    "description": "Classic Summoner's Rift and Twisted Treeline games"
  },
  ...
]
2 1900]. All Pick URF games from before this distinction will still be in
[
  {
    "gameMode": "CLASSIC",
    "description": "Classic Summoner's Rift and Twisted Treeline games"
  },
  ...
]
2 900.

queues.json

[
  {
    "queueId": 0,
    "map": "Custom games",
    "description": null,
    "notes": null
  },
  ...
]

Maps

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

maps.json

[
  {
    "mapId": 1,
    "mapName": "Summoner's Rift",
    "notes": "Original Summer variant"
  },
  ...
]

Game Modes

A full list of game modes can be found in the file below.

gameModes.json

[
  {
    "gameMode": "CLASSIC",
    "description": "Classic Summoner's Rift and Twisted Treeline games"
  },
  ...
]

Game Types

A full list of game types can be found in the file below.

gameTypes.json

[
  {
    "gameType": "CUSTOM_GAME",
    "description": "Custom games"
  },
  ...
]

Ranked Info

Queue Types

The leagues endpoints return a field called

[
  {
    "gameMode": "CLASSIC",
    "description": "Classic Summoner's Rift and Twisted Treeline games"
  },
  ...
]
6 that will indicate what map/mode that player played. Depending on the
[
  {
    "gameMode": "CLASSIC",
    "description": "Classic Summoner's Rift and Twisted Treeline games"
  },
  ...
]
6 the
[
  {
    "gameMode": "CLASSIC",
    "description": "Classic Summoner's Rift and Twisted Treeline games"
  },
  ...
]
8 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

[
  {
    "gameMode": "CLASSIC",
    "description": "Classic Summoner's Rift and Twisted Treeline games"
  },
  ...
]
6 and
[
  {
    "gameMode": "CLASSIC",
    "description": "Classic Summoner's Rift and Twisted Treeline games"
  },
  ...
]
8 for each.

Summoner's Rift

Unranked
    RANKED_SOLO_5x5
    RANKED_TEAM_5x5
Ranked Solo/Duo
    RANKED_SOLO_5x5
Ranked Team 5x5
    RANKED_TEAM_5x5

Other Maps

If a match is not played on Summoner's Rift, the

[
  {
    "gameMode": "CLASSIC",
    "description": "Classic Summoner's Rift and Twisted Treeline games"
  },
  ...
]
8 field will return the highest ending tier for the previous season from any ranked queue.

Icons and Emblems

The emblems and position assets for all ranks after Ranked Remastered update can be found below.

ranked-emblems.zip
ranked-positions.zip

The old tier icon assets from before the Ranked Remasted update can be found below.

tier-icons.zip

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.

Latest
//ddragon.leagueoflegends.com/cdn/dragontail-12.23.1.tgz

Patch 10.10 was uploaded as a zip archive [.zip] instead of the typical compressed tarball [.tgz]
//ddragon.leagueoflegends.com/cdn/dragontail-10.10.5.zip

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.

//ddragon.leagueoflegends.com/api/versions.json

Regions

Data Dragon versions aren't always equivalent to the League of Legends client version in a region. You can find the version each region is using via the realms files.

//ddragon.leagueoflegends.com/realms/na.json

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

[
  {
    "gameType": "CUSTOM_GAME",
    "description": "Custom games"
  },
  ...
]
2 and the
[
  {
    "gameType": "CUSTOM_GAME",
    "description": "Custom games"
  },
  ...
]
3 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.

//ddragon.leagueoflegends.com/cdn/languages.json

CODELANGUAGEcs_CZCzech [Czech Republic]el_GRGreek [Greece]pl_PLPolish [Poland]ro_RORomanian [Romania]hu_HUHungarian [Hungary]en_GBEnglish [United Kingdom]de_DEGerman [Germany]es_ESSpanish [Spain]it_ITItalian [Italy]fr_FRFrench [France]ja_JPJapanese [Japan]ko_KRKorean [Korea]es_MXSpanish [Mexico]es_ARSpanish [Argentina]pt_BRPortuguese [Brazil]en_USEnglish [United States]en_AUEnglish [Australia]ru_RURussian [Russia]tr_TRTurkish [Turkey]ms_MYMalay [Malaysia]en_PHEnglish [Republic of the Philippines]en_SGEnglish [Singapore]th_THThai [Thailand]vn_VNVietnamese [Viet Nam]id_IDIndonesian [Indonesia]zh_MYChinese [Malaysia]zh_CNChinese [China]zh_TWChinese [Taiwan]

Champions

There are two kinds of data files for champions. The

[
  {
    "gameType": "CUSTOM_GAME",
    "description": "Custom games"
  },
  ...
]
4 data file returns a list of champions with a brief summary. The individual champion JSON files contain additional data for each champion.

//ddragon.leagueoflegends.com/cdn/12.23.1/data/en_US/champion.json
//ddragon.leagueoflegends.com/cdn/12.23.1/data/en_US/champion/Aatrox.json

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

[
  {
    "gameType": "CUSTOM_GAME",
    "description": "Custom games"
  },
  ...
]
5 field [e.g.,
[
  {
    "gameType": "CUSTOM_GAME",
    "description": "Custom games"
  },
  ...
]
6 is a placeholder for
[
  {
    "gameType": "CUSTOM_GAME",
    "description": "Custom games"
  },
  ...
]
7].

/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"effectBurn": [
  null,
  "80/130/180/230/280",
  "1",
  "1350",
  ...
]

{{ 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

[
  {
    "gameType": "CUSTOM_GAME",
    "description": "Custom games"
  },
  ...
]
8, find the object in the vars array whose key field has the value
[
  {
    "gameType": "CUSTOM_GAME",
    "description": "Custom games"
  },
  ...
]
9]. The value for this variable is the coeff field in that same object.

/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"vars": [
  {
    "key": "a1",
    "link": "spelldamage",
    "coeff": [
      0.7
    ]
  }
]

Under a champions spells there are two fields

Unranked
    RANKED_SOLO_5x5
    RANKED_TEAM_5x5
Ranked Solo/Duo
    RANKED_SOLO_5x5
Ranked Team 5x5
    RANKED_TEAM_5x5
0 and
[
  {
    "gameType": "CUSTOM_GAME",
    "description": "Custom games"
  },
  ...
]
5.
Unranked
    RANKED_SOLO_5x5
    RANKED_TEAM_5x5
Ranked Solo/Duo
    RANKED_SOLO_5x5
Ranked Team 5x5
    RANKED_TEAM_5x5
0 contains an array of an ability's values per level where, in contrast,
[
  {
    "gameType": "CUSTOM_GAME",
    "description": "Custom games"
  },
  ...
]
5 contains a string of all the values at every level. [e.g.,
Unranked
    RANKED_SOLO_5x5
    RANKED_TEAM_5x5
Ranked Solo/Duo
    RANKED_SOLO_5x5
Ranked Team 5x5
    RANKED_TEAM_5x5
4 vs
Unranked
    RANKED_SOLO_5x5
    RANKED_TEAM_5x5
Ranked Solo/Duo
    RANKED_SOLO_5x5
Ranked Team 5x5
    RANKED_TEAM_5x5
5]. You might notice how the
Unranked
    RANKED_SOLO_5x5
    RANKED_TEAM_5x5
Ranked Solo/Duo
    RANKED_SOLO_5x5
Ranked Team 5x5
    RANKED_TEAM_5x5
0 and
[
  {
    "gameType": "CUSTOM_GAME",
    "description": "Custom games"
  },
  ...
]
5 arrays have a
Unranked
    RANKED_SOLO_5x5
    RANKED_TEAM_5x5
Ranked Solo/Duo
    RANKED_SOLO_5x5
Ranked Team 5x5
    RANKED_TEAM_5x5
8 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.

"effect": [
  null,
  [ 120, 150, 180, 210, 240 ],
  [ 50, 70, 90, 110, 130 ],
  [ 25, 35, 45, 55, 65 ],
  [ 0.2, 0.2, 0.2, 0.2, 0.2 ],
  [ 50, 60, 70, 80, 90 ]
],
"effectBurn": [
  "",
  "120/150/180/210/240",
  "50/70/90/110/130",
  "25/35/45/55/65",
  "0.2",
  "50/60/70/80/90"
]

Calculating Spell Costs

In most cases a spell costs mana or energy, you'll find those related costs under the

Unranked
    RANKED_SOLO_5x5
    RANKED_TEAM_5x5
Ranked Solo/Duo
    RANKED_SOLO_5x5
Ranked Team 5x5
    RANKED_TEAM_5x5
9 and
/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"effectBurn": [
  null,
  "80/130/180/230/280",
  "1",
  "1350",
  ...
]
0 fields. When a spell costs health, the cost will be found in the
Unranked
    RANKED_SOLO_5x5
    RANKED_TEAM_5x5
Ranked Solo/Duo
    RANKED_SOLO_5x5
Ranked Team 5x5
    RANKED_TEAM_5x5
0 and
[
  {
    "gameType": "CUSTOM_GAME",
    "description": "Custom games"
  },
  ...
]
5 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.

/* Soraka's Astral Infusion */
"resource": "10% Max Health, {{ cost }} Mana",
"cost": [ 20, 25, 30, 35, 40 ],
"costBurn": "20/25/30/35/40"
[
  {
    "queueId": 0,
    "map": "Custom games",
    "description": null,
    "notes": null
  },
  ...
]
0
[
  {
    "queueId": 0,
    "map": "Custom games",
    "description": null,
    "notes": null
  },
  ...
]
1

Champion Splash Assets

//ddragon.leagueoflegends.com/cdn/img/champion/splash/Aatrox_0.jpg

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

/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"effectBurn": [
  null,
  "80/130/180/230/280",
  "1",
  "1350",
  ...
]
3 field and the skin number is indicated by the
/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"effectBurn": [
  null,
  "80/130/180/230/280",
  "1",
  "1350",
  ...
]
4 field.

[
  {
    "queueId": 0,
    "map": "Custom games",
    "description": null,
    "notes": null
  },
  ...
]
2

Champion Loading Screen Assets

//ddragon.leagueoflegends.com/cdn/img/champion/loading/Aatrox_0.jpg
The number at the end of the filename follows the same convention described in the Champion Splash Art.

Champion Square Assets

//ddragon.leagueoflegends.com/cdn/12.23.1/img/champion/Aatrox.png

Champion Passive Assets

//ddragon.leagueoflegends.com/cdn/12.23.1/img/passive/Anivia_P.png

You can find the filename for each champion's passive in the individual champion Data Dragon file. The JSON contains a

/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"effectBurn": [
  null,
  "80/130/180/230/280",
  "1",
  "1350",
  ...
]
5 field with image data. The filename is indicated by the
/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"effectBurn": [
  null,
  "80/130/180/230/280",
  "1",
  "1350",
  ...
]
6 field.

[
  {
    "queueId": 0,
    "map": "Custom games",
    "description": null,
    "notes": null
  },
  ...
]
3

Champion Ability Assets

//ddragon.leagueoflegends.com/cdn/12.23.1/img/spell/FlashFrost.png

You can find the filename for each champion's abilities in the individual champion Data Dragon file. The

/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"effectBurn": [
  null,
  "80/130/180/230/280",
  "1",
  "1350",
  ...
]
7 field contains an array of objects which includes
/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"effectBurn": [
  null,
  "80/130/180/230/280",
  "1",
  "1350",
  ...
]
8 data. The filename is indicated by the
/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"effectBurn": [
  null,
  "80/130/180/230/280",
  "1",
  "1350",
  ...
]
6 field.

[
  {
    "queueId": 0,
    "map": "Custom games",
    "description": null,
    "notes": null
  },
  ...
]
4

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.

//ddragon.leagueoflegends.com/cdn/12.23.1/data/en_US/item.json

There is a field called

Unranked
    RANKED_SOLO_5x5
    RANKED_TEAM_5x5
Ranked Solo/Duo
    RANKED_SOLO_5x5
Ranked Team 5x5
    RANKED_TEAM_5x5
0 which holds an array of variables used extra scripts. As an example, on Doran's shield you see the following data in the
Unranked
    RANKED_SOLO_5x5
    RANKED_TEAM_5x5
Ranked Solo/Duo
    RANKED_SOLO_5x5
Ranked Team 5x5
    RANKED_TEAM_5x5
0 field, which corresponds to the 8 damage that is blocked from champion attacks.

[
  {
    "queueId": 0,
    "map": "Custom games",
    "description": null,
    "notes": null
  },
  ...
]
5

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

/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"vars": [
  {
    "key": "a1",
    "link": "spelldamage",
    "coeff": [
      0.7
    ]
  }
]
2 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.,
    /* Amumu's Bandage Toss */
    "tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
    "vars": [
      {
        "key": "a1",
        "link": "spelldamage",
        "coeff": [
          0.7
        ]
      }
    ]
    
    3 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.

Item Assets

//ddragon.leagueoflegends.com/cdn/12.23.1/img/item/1001.png
The number appended to the item filename corresponds to the item id. You can find a list of the items ids in the item data file.

Other

Summoner Spells

//ddragon.leagueoflegends.com/cdn/12.23.1/data/en_US/summoner.json
//ddragon.leagueoflegends.com/cdn/12.23.1/img/spell/SummonerFlash.png

Profile Icons

//ddragon.leagueoflegends.com/cdn/12.23.1/data/en_US/profileicon.json
//ddragon.leagueoflegends.com/cdn/12.23.1/img/profileicon/685.png

Minimaps

//ddragon.leagueoflegends.com/cdn/6.8.1/img/map/map11.png
The number appended to the map filename corresponds to the map id. You can find a list of the map ids in the Map Names section of Game Constants.

Sprites

//ddragon.leagueoflegends.com/cdn/12.23.1/img/sprite/spell0.png

Scoreboard Icons [version 5.5.1]

//ddragon.leagueoflegends.com/cdn/5.5.1/img/ui/champion.png
//ddragon.leagueoflegends.com/cdn/5.5.1/img/ui/items.png
//ddragon.leagueoflegends.com/cdn/5.5.1/img/ui/minion.png
//ddragon.leagueoflegends.com/cdn/5.5.1/img/ui/score.png
//ddragon.leagueoflegends.com/cdn/5.5.1/img/ui/spells.png

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:

  1. Register tournament providers and tournaments in a specific region/shard and its callback URL.
  2. Generate tournament codes for a given tournament.
  3. 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.
  4. Use match identifier [matchID] received in the callback to pull full stats data for the given match.
  5. Pull end of game data based on given tournament code in case the callback is never received.
  6. 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

The Tournaments API introduces a simple parent-child data structure to ensure data model consistency:

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:

  1. 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.
  2. Use providerID to register a tournament for given Tournament Provider. Receive tournamentID in return.
  3. 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.

Port Restrictions
The server callback supports http [port 80] and https [port 443] however Certificate Authorities [CA] approved after Jan 29, 2012 aren't supported. The callback server won't perform a callback if it is unable to validate an SSL cert issued by an unknown CA [and therefore doesn't trust].

Domain Restrictions
Only valid gTLDs approved by ICANN before March 2011 are considered valid. This excludes newer gTLDs such as [.mail, .xxx, .xyz, etc.]

Valid gTLDs [approved before March 2011]
aero, asia, biz, cat, com, coop, info, jobs, mobi, museum, name, net, org, pro, tel, travel, gov, edu, mil, int

Valid Country Code TLDs
ac, ad, ae, af, ag, ai, al, am, an, ao, aq, ar, as, at, au, aw, ax, az, ba, bb, bd, be, bf, bg, bh, bi, bj, bm, bn, bo, br, bs, bt, bv, bw, by, bz, ca, cc, cd, cf, cg, ch, ci, ck, cl, cm, cn, co, cr, cu, cv, cx, cy, cz, de, dj, dk, dm, do, dz, ec, ee, eg, er, es, et, eu, fi, fj, fk, fm, fo, fr, ga, gb, gd, ge, gf, gg, gh, gi, gl, gm, gn, gp, gq, gr, gs, gt, gu, gw, gy, hk, hm, hn, hr, ht, hu, id, ie, il, im, in, io, iq, ir, is, it, je, jm, jo, jp, ke, kg, kh, ki, km, kn, kp, kr, kw, ky, kz, la, lb, lc, li, lk, lr, ls, lt, lu, lv, ly, ma, mc, md, me, mg, mh, mk, ml, mm, mn, mo, mp, mq, mr, ms, mt, mu, mv, mw, mx, my, mz, na, nc, ne, nf, ng, ni, nl, no, np, nr, nu, nz, om, pa, pe, pf, pg, ph, pk, pl, pm, pn, pr, ps, pt, pw, py, qa, re, ro, rs, ru, rw, sa, sb, sc, sd, se, sg, sh, si, sj, sk, sl, sm, sn, so, sr, st, su, sv, sy, sz, tc, td, tf, tg, th, tj, tk, tl, tm, tn, to, tp, tr, tt, tv, tw, tz, ua, ug, uk, um, us, uy, uz, va, vc, ve, vg, vi, vn, vu, wf, ws, ye, yt, yu, za, zm, zw

  • 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.

[
  {
    "queueId": 0,
    "map": "Custom games",
    "description": null,
    "notes": null
  },
  ...
]
6

Below is a sample JSON response returned by the League of Legends servers when a callback is made.

[
  {
    "queueId": 0,
    "map": "Custom games",
    "description": null,
    "notes": null
  },
  ...
]
7

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:

[
  {
    "queueId": 0,
    "map": "Custom games",
    "description": null,
    "notes": null
  },
  ...
]
8

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.

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

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.

[
  {
    "queueId": 0,
    "map": "Custom games",
    "description": null,
    "notes": null
  },
  ...
]
9

Swagger

You can request the Swagger v2 and OpenAPI v3 specs for the Game Client API with the following urls:

/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"vars": [
  {
    "key": "a1",
    "link": "spelldamage",
    "coeff": [
      0.7
    ]
  }
]
4
/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"vars": [
  {
    "key": "a1",
    "link": "spelldamage",
    "coeff": [
      0.7
    ]
  }
]
5

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.

/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"vars": [
  {
    "key": "a1",
    "link": "spelldamage",
    "coeff": [
      0.7
    ]
  }
]
6
Get all available data.

You can find a sample response here.

Endpoints

Active Player

/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"vars": [
  {
    "key": "a1",
    "link": "spelldamage",
    "coeff": [
      0.7
    ]
  }
]
7
Get all data about the active player.

[
  {
    "mapId": 1,
    "mapName": "Summoner's Rift",
    "notes": "Original Summer variant"
  },
  ...
]
0

/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"vars": [
  {
    "key": "a1",
    "link": "spelldamage",
    "coeff": [
      0.7
    ]
  }
]
8
Returns the player name.

[
  {
    "mapId": 1,
    "mapName": "Summoner's Rift",
    "notes": "Original Summer variant"
  },
  ...
]
1

/* Amumu's Bandage Toss */
"tooltip": "Launches a bandage in a direction. If it hits an enemy unit, Amumu pulls himself to them, dealing {{ e1 }} [+{{ a1 }}] magic damage and stunning for {{ e2 }} second.",
"vars": [
  {
    "key": "a1",
    "link": "spelldamage",
    "coeff": [
      0.7
    ]
  }
]
9
Get Abilities for the active player.

[
  {
    "mapId": 1,
    "mapName": "Summoner's Rift",
    "notes": "Original Summer variant"
  },
  ...
]
2

"effect": [
  null,
  [ 120, 150, 180, 210, 240 ],
  [ 50, 70, 90, 110, 130 ],
  [ 25, 35, 45, 55, 65 ],
  [ 0.2, 0.2, 0.2, 0.2, 0.2 ],
  [ 50, 60, 70, 80, 90 ]
],
"effectBurn": [
  "",
  "120/150/180/210/240",
  "50/70/90/110/130",
  "25/35/45/55/65",
  "0.2",
  "50/60/70/80/90"
]
0
Retrieve the full list of runes for the active player.

[
  {
    "mapId": 1,
    "mapName": "Summoner's Rift",
    "notes": "Original Summer variant"
  },
  ...
]
3

All Players

"effect": [
  null,
  [ 120, 150, 180, 210, 240 ],
  [ 50, 70, 90, 110, 130 ],
  [ 25, 35, 45, 55, 65 ],
  [ 0.2, 0.2, 0.2, 0.2, 0.2 ],
  [ 50, 60, 70, 80, 90 ]
],
"effectBurn": [
  "",
  "120/150/180/210/240",
  "50/70/90/110/130",
  "25/35/45/55/65",
  "0.2",
  "50/60/70/80/90"
]
1
Retrieve the list of heroes in the game and their stats.

[
  {
    "mapId": 1,
    "mapName": "Summoner's Rift",
    "notes": "Original Summer variant"
  },
  ...
]
4

"effect": [
  null,
  [ 120, 150, 180, 210, 240 ],
  [ 50, 70, 90, 110, 130 ],
  [ 25, 35, 45, 55, 65 ],
  [ 0.2, 0.2, 0.2, 0.2, 0.2 ],
  [ 50, 60, 70, 80, 90 ]
],
"effectBurn": [
  "",
  "120/150/180/210/240",
  "50/70/90/110/130",
  "25/35/45/55/65",
  "0.2",
  "50/60/70/80/90"
]
2
Retrieve the list of the current scores for the player.

[
  {
    "mapId": 1,
    "mapName": "Summoner's Rift",
    "notes": "Original Summer variant"
  },
  ...
]
5

"effect": [
  null,
  [ 120, 150, 180, 210, 240 ],
  [ 50, 70, 90, 110, 130 ],
  [ 25, 35, 45, 55, 65 ],
  [ 0.2, 0.2, 0.2, 0.2, 0.2 ],
  [ 50, 60, 70, 80, 90 ]
],
"effectBurn": [
  "",
  "120/150/180/210/240",
  "50/70/90/110/130",
  "25/35/45/55/65",
  "0.2",
  "50/60/70/80/90"
]
3
Retrieve the list of the summoner spells for the player.

[
  {
    "mapId": 1,
    "mapName": "Summoner's Rift",
    "notes": "Original Summer variant"
  },
  ...
]
6

"effect": [
  null,
  [ 120, 150, 180, 210, 240 ],
  [ 50, 70, 90, 110, 130 ],
  [ 25, 35, 45, 55, 65 ],
  [ 0.2, 0.2, 0.2, 0.2, 0.2 ],
  [ 50, 60, 70, 80, 90 ]
],
"effectBurn": [
  "",
  "120/150/180/210/240",
  "50/70/90/110/130",
  "25/35/45/55/65",
  "0.2",
  "50/60/70/80/90"
]
4
Retrieve the basic runes of any player.

[
  {
    "mapId": 1,
    "mapName": "Summoner's Rift",
    "notes": "Original Summer variant"
  },
  ...
]
7

"effect": [
  null,
  [ 120, 150, 180, 210, 240 ],
  [ 50, 70, 90, 110, 130 ],
  [ 25, 35, 45, 55, 65 ],
  [ 0.2, 0.2, 0.2, 0.2, 0.2 ],
  [ 50, 60, 70, 80, 90 ]
],
"effectBurn": [
  "",
  "120/150/180/210/240",
  "50/70/90/110/130",
  "25/35/45/55/65",
  "0.2",
  "50/60/70/80/90"
]
5
Retrieve the list of items for the player.

[
  {
    "mapId": 1,
    "mapName": "Summoner's Rift",
    "notes": "Original Summer variant"
  },
  ...
]
8

Events

"effect": [
  null,
  [ 120, 150, 180, 210, 240 ],
  [ 50, 70, 90, 110, 130 ],
  [ 25, 35, 45, 55, 65 ],
  [ 0.2, 0.2, 0.2, 0.2, 0.2 ],
  [ 50, 60, 70, 80, 90 ]
],
"effectBurn": [
  "",
  "120/150/180/210/240",
  "50/70/90/110/130",
  "25/35/45/55/65",
  "0.2",
  "50/60/70/80/90"
]
6
Get a list of events that have occurred in the game.

[
  {
    "mapId": 1,
    "mapName": "Summoner's Rift",
    "notes": "Original Summer variant"
  },
  ...
]
9

You can find a list of sample events here.

Game

"effect": [
  null,
  [ 120, 150, 180, 210, 240 ],
  [ 50, 70, 90, 110, 130 ],
  [ 25, 35, 45, 55, 65 ],
  [ 0.2, 0.2, 0.2, 0.2, 0.2 ],
  [ 50, 60, 70, 80, 90 ]
],
"effectBurn": [
  "",
  "120/150/180/210/240",
  "50/70/90/110/130",
  "25/35/45/55/65",
  "0.2",
  "50/60/70/80/90"
]
7
Basic data about the game.

[
  {
    "gameMode": "CLASSIC",
    "description": "Classic Summoner's Rift and Twisted Treeline games"
  },
  ...
]
0

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

[
  {
    "gameMode": "CLASSIC",
    "description": "Classic Summoner's Rift and Twisted Treeline games"
  },
  ...
]
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.

Chủ Đề