lol-stats-api

1.1.3 • Public • Published

lol-stats-api

NPM

npm version dependencies Status

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-stats-api is installable via:

  • GitHub git clone https://github.com/danielsogl/lol-stats-api.git
  • npm: npm install lol-stats-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


/account/:accountId

Retrieves a summoner by accountId.


/account/:accountId/matchlist

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.

/account/:accountId/matchlist/recent

Retrieves matchlist for last 20 matches played on given accountId.


/champions

Retrieves the status of all champions.

Querystring parameters

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

/champions/:id

Retrieves the status of given champion id.


/featured-games

Retrieves a list of featured games.


/leagues/challenger

Retrieves the challenger tier leagues

Querystring parameters

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

/leagues/master

Retrieves the master tier leagues

Querystring parameters

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

/matches/:id

Retrieves a match by its id.


/matches/:matchId/timeline

Retrieves a match's timeline by matchId.


/static/champions

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"

/static/champions/:id

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"

/static/items

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"

/static/items/:id

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"

/static/languages

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.


/static/language-strings

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.


/static/maps

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.


/static/masteries

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"

/static/masteries/:id

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"

/static/profile-icons

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.


/static/realms

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.


/static/runes

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"

/static/runes/:id

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"

/static/spells

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"

/static/spells/:id

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"


/static/versions

Retrieves version data.


/status

Retrieves the list of available regions.


/summoner

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


/summoner/:id

Retrieves a summoner by id.


/summoner/:summonerId/currentGame

Retrieves active game information for the given summonerId.


/summoner/:summonerId/championMastery

Retrieves all champion mastery entries by summonerId.


/summoner/:summonerId/championMastery/:championId

Retrieves a champion mastery entry by summonerId and championId.


/summoner/:summonerId/championMastery/score

Retrieves the total champion mastery score by summonerId.


/summoner/:summonerId/leagues

Retrieves leagues in all queues for a given summonerId.


/summoner/:summonerId/leagues/positions

Retrieves league positions in all queues for a given summonerId.


/summoner/:summonerId/masteries

Get mastery pages for a given summonerId.


/summoner/:summonerId/runes

Get rune pages for a given summonerId.


/clear-cache/account/:accountId

Clears the cache for a given accountId.


/clear-cache/summoner/:summonerId

Clears the cache for a given summonerId.


Package Sidebar

Install

npm i lol-stats-api

Weekly Downloads

13

Version

1.1.3

License

MIT

Last publish

Collaborators

  • danielsogl