Skip to content

Pupix/lol-riot-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lol-riot-api

A configurable League of Legends API. It uses the official developer's API offered by Riot Games, so you will need an API key to be able to use it. Here's the complete documentation of their API. In the documentation below there will be references to the official methods used for each route.

Download

lol-riot-api is installable via:

  • GitHub git clone https://github.com/Pupix/lol-riot-api.git
  • npm: npm install lol-riot-api

Getting started

To start the API server run the following command:

node run start

You will have to do a one time configuration to be able to use the API. At the prompt you will be asked for the default API key to be used for the calls, the port on which the API will run, the default region to be used for the API calls and the caching strategy.

Resetting the configuration

You can change the provided API configuration at any time, simply by running:

npm run resetconfig

Documentation

The API's calls are mapped to various API methods from Riot Game's documentation. All URLs can accept apiKey and region as query string parameters, if you want to do calls for a different region or with a different key than the specified defaults.

Routes


Retrieves a summoner by accountId.


Retrieves matchlist by accountId.

Querystring parameters

  • season - Comma-separated list of season ids to use for filtering matchlist.

  • queue - Comma-separated list of ranked queue types to use for filtering matchlist.

    • Possible values: RANKED_SOLO_5x5 | RANKED_FLEX_SR | RANKED_FLEX_TT.
  • beginIndex - The begin index to use for fetching games.

    • Possible values: Any positive natural number.
  • beginTime - The begin time to use for fetching games specified as epoch milliseconds.

    • Possible values: Any positive natural number.
  • endTime - The end time to use for fetching games specified as epoch milliseconds.

    • Possible values: Any positive natural number.
  • endIndex - The end index to use for fetching games.

    • Possible values: Any positive natural number.

Retrieves matchlist for last 20 matches played on given accountId.


Retrieves the status of all champions.

Querystring parameters

  • freeToPlay - Filter param to revireve only free to play champions.
    • Possible values: Anything

Retrieves the status of given champion id.


Retrieves a list of featured games.


Retrieves the challenger tier leagues

Querystring parameters

  • queue - The queue type.
    • Possible values: "RANKED_SOLO_5x5" | "RANKED_FLEX_SR" | "RANKED_FLEX_TT"

Retrieves the master tier leagues

Querystring parameters

  • queue - The queue type.
    • Possible values: "RANKED_SOLO_5x5" | "RANKED_FLEX_SR" | "RANKED_FLEX_TT"

Retrieves a match by its id.


Retrieves a match's timeline by matchId.


Retrieves champion list.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.

  • dataById - If specified as true, the returned data map will use the champions' id as the keys. If not specified or specified as false, the returned data map will use the champions' keys instead.

  • champData - Tags to return additional data. Only id, key, name, and title are returned by default if this parameter isn't specified. To return all additional data, use the tag 'all'.

    • Possible values: "all" | "allytips" | "altimages" | "blurb" | "enemytips" | "image" | "info" | "lore" | "partype" | "passive" | "recommended" | "skins" | "spells" | "stats" | "tags"

Retrieves a champion by its id.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.

  • champData - Tags to return additional data. Only id, key, name, and title are returned by default if this parameter isn't specified. To return all additional data, use the tag 'all'.

    • Possible values: "all" | "allytips" | "altimages" | "blurb" | "enemytips" | "image" | "info" | "lore" | "partype" | "passive" | "recommended" | "skins" | "spells" | "stats" | "tags"

Retrieves a list of all items in the game.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.

  • itemData - Tags to return additional data. Only id, name, plaintext, group, and description are returned by default if this parameter isn't specified. To return all additional data, use the tag 'all'.

    • Possible values: "all" | "colloq" | "consumeOnFull" | "consumed" | "depth" | "effect" | "from" | "gold" | "hideFromAll" | "image" | "inStore" | "into" | "maps" | "requiredChampion" | "sanitizedDescription" | "specialRecipe" | "stacks" | "stats" | "tags"

Retrieves an item by id.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.

  • itemData - Tags to return additional data. Only id, name, plaintext, group, and description are returned by default if this parameter isn't specified. To return all additional data, use the tag 'all'.

    • Possible values: "all" | "colloq" | "consumeOnFull" | "consumed" | "depth" | "effect" | "from" | "gold" | "hideFromAll" | "image" | "inStore" | "into" | "maps" | "requiredChampion" | "sanitizedDescription" | "specialRecipe" | "stacks" | "stats" | "tags"

Retrieves supported languages data.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.


Retrieves language string data.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.


Retrieves map data.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.


Retrieves the masteries list.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.

  • masteryData - Tags to return additional data. Only id, name, and description are returned by default if this parameter isn't specified. To return all additional data, use the tag 'all'

    • Possible values: "all" | "image" | "masteryTree" | "prereq" | "ranks" | "sanitizeDescription"

Retrieves a mastery item by id.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.

  • masteryData - Tags to return additional data. Only id, name, and description are returned by default if this parameter isn't specified. To return all additional data, use the tag 'all'

    • Possible values: "all" | "image" | "masteryTree" | "prereq" | "ranks" | "sanitizeDescription"

Retrieves profile icons data.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.


Retrieves realm data.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.


Retrieves all runes in game.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.

  • runeData - Tags to return additional data. Only id, name, rune, and description are returned by default if this parameter isn't specified. To return all additional data, use the tag 'all'.

    • Possible values: "all" | "colloq" | "consumeOnFull" | "consumed" | "depth" | "from" | "gold" | "hideFromAll" | "image" | "inStore" | "into" | "maps" | "requiredChampion" | "sanitizedDescription" | "specialRecipe" | "stacks" | "stats" | "tags"

Retrieves a rune by id.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.

  • runeData - Tags to return additional data. Only id, name, rune, and description are returned by default if this parameter isn't specified. To return all additional data, use the tag 'all'.

    • Possible values: "all" | "colloq" | "consumeOnFull" | "consumed" | "depth" | "from" | "gold" | "hideFromAll" | "image" | "inStore" | "into" | "maps" | "requiredChampion" | "sanitizedDescription" | "specialRecipe" | "stacks" | "stats" | "tags"

Retrieves all summoner spells in game.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.

  • dataById - If specified, the returned data map will use the spells' id as the keys. If not specified or specified as false, the returned data map will use the spells' keys instead.

    • Possible values: Anything
  • spellData - Tags to return additional data. Only type, version, data, id, key, name, description, and summonerLevel are returned by default if this parameter isn't specified. To return all additional data, use the tag 'all'.

    • Possible values: "all" | "cooldown" | "cooldownBurn" | "cost" | "costBurn" | "costType" | "effect" | "effectBurn" | "image" | "key" | "leveltip" | "maxrank" | "modes" | "range" | "rangeBurn" | "resource" | "sanitizedDescription" | "sanitizedTooltip" | "tooltip" | "vars"

Retrieves a summoner spell by id.

Querystring parameters

  • locale - Locale code for returned data (e.g., en_US, es_ES). If not specified, the default locale for the region is used.

  • version - Data dragon version for returned data. If not specified, the latest version for the region is used. List of valid versions can be obtained from the /versions endpoint.

  • spellData - Tags to return additional data. Only type, version, data, id, key, name, description, and summonerLevel are returned by default if this parameter isn't specified. To return all additional data, use the tag 'all'.

  • Possible values: "all" | "cooldown" | "cooldownBurn" | "cost" | "costBurn" | "costType" | "effect" | "effectBurn" | "image" | "key" | "leveltip" | "maxrank" | "modes" | "range" | "rangeBurn" | "resource" | "sanitizedDescription" | "sanitizedTooltip" | "tooltip" | "vars"


Retrieves version data.


Retrieves the list of available regions.


Retrieves a summoner based on name, id or accountId.

Querystring parameters

  • name - The name of the summoner

  • id - The Id of the summoner

  • accountId - The account id of the summoner


Retrieves a summoner by id.


Retrieves active game information for the given summonerId.


Retrieves all champion mastery entries by summonerId.


Retrieves a champion mastery entry by summonerId and championId.


Retrieves the total champion mastery score by summonerId.


Retrieves leagues in all queues for a given summonerId.


Retrieves league positions in all queues for a given summonerId.


Get mastery pages for a given summonerId.


Get rune pages for a given summonerId.


Clears the cache for a given accountId.


Clears the cache for a given summonerId.