Back to list
shepherdjerred

riot-api-reference

by shepherdjerred

Create match reports for League of Legends

2🍴 1📅 Jan 24, 2026

SKILL.md


name: riot-api-reference description: | Riot Games API reference for League of Legends integration. Use when working with twisted library, API endpoints, rate limiting, PUUID lookups, match data, summoner info, or regional routing.

Riot Games API Reference

Comprehensive reference for integrating with the Riot Games API for League of Legends data.

API Endpoints Overview

Account-V1 (Riot ID Lookup)

Base URL: https://{region}.api.riotgames.com/riot/account/v1/

EndpointDescription
/accounts/by-riot-id/{gameName}/{tagLine}Get PUUID by Riot ID
/accounts/by-puuid/{puuid}Get account info (gameName + tagLine) by PUUID

Important: Riot IDs replaced summoner names as of November 20, 2023. The by-name endpoints are deprecated.

Summoner-V4

Base URL: https://{platform}.api.riotgames.com/lol/summoner/v4/

EndpointDescription
/summoners/by-puuid/{puuid}Get summoner by PUUID (recommended)
/summoners/{summonerId}Get summoner by encrypted summoner ID
/summoners/by-account/{accountId}Get summoner by encrypted account ID

Match-V5

Base URL: https://{region}.api.riotgames.com/lol/match/v5/

EndpointDescription
/matches/by-puuid/{puuid}/idsGet list of match IDs for a player
/matches/{matchId}Get match details by match ID
/matches/{matchId}/timelineGet match timeline (not all matches have this)

Query Parameters for matchlist:

  • start - Start index (default 0)
  • count - Number of matches (default 20, max 100)
  • queue - Filter by queue ID
  • type - Filter by match type (ranked, normal, etc.)
  • startTime / endTime - Filter by timestamp (epoch seconds)

League-V4

Base URL: https://{platform}.api.riotgames.com/lol/league/v4/

EndpointDescription
/entries/by-summoner/{summonerId}Get ranked entries for a summoner
/entries/{queue}/{tier}/{division}Get all entries for a tier/division
/challengerleagues/by-queue/{queue}Get challenger league
/grandmasterleagues/by-queue/{queue}Get grandmaster league
/masterleagues/by-queue/{queue}Get master league

Note: If a player hasn't finished placements or isn't ranked in a queue, that queue won't appear in results.

Champion-Mastery-V4

Base URL: https://{platform}.api.riotgames.com/lol/champion-mastery/v4/

EndpointDescription
/champion-masteries/by-puuid/{puuid}Get all champion masteries
/champion-masteries/by-puuid/{puuid}/topGet top champion masteries
/scores/by-puuid/{puuid}Get total mastery score

Spectator-V5

Base URL: https://{platform}.api.riotgames.com/lol/spectator/v5/

EndpointDescription
/active-games/by-summoner/{puuid}Get current game info (404 if not in game)
/featured-gamesGet list of featured games

Limitations: Stats like role, KDA, or CS are not included. Custom game data is not available due to privacy policies.

Challenges-V1

Base URL: https://{platform}.api.riotgames.com/lol/challenges/v1/

EndpointDescription
/player-data/{puuid}Get player challenge progress
/challenges/configGet all challenge configurations
/challenges/{challengeId}/leaderboards/by-level/{level}Get challenge leaderboard (MASTER/GRANDMASTER/CHALLENGER)

Regional vs Platform Routing

Platform Routing Values

Used for most endpoints (Summoner-V4, League-V4, Champion-Mastery-V4, Spectator-V5):

PlatformRegion
na1North America
euw1Europe West
eun1Europe Nordic & East
krKorea
jp1Japan
br1Brazil
la1Latin America North
la2Latin America South
oc1Oceania
tr1Turkey
ruRussia
ph2Philippines
sg2Singapore
th2Thailand
tw2Taiwan
vn2Vietnam

Regional Routing Values

Used for Account-V1 and Match-V5:

RegionPlatforms Covered
americasNA1, BR1, LA1, LA2
europeEUW1, EUN1, TR1, RU
asiaKR, JP1
seaPH2, SG2, TH2, TW2, VN2

Example URLs:

Platform: https://na1.api.riotgames.com/lol/summoner/v4/summoners/by-puuid/{puuid}
Regional: https://americas.api.riotgames.com/lol/match/v5/matches/by-puuid/{puuid}/ids

Rate Limiting

Three Types of Rate Limits

  1. Application Rate Limit - Per API key, per region

    • Development keys: 20 requests/second, 100 requests/2 minutes
    • Production keys: Higher limits based on approval
  2. Method Rate Limit - Per endpoint, per key, per region

    • Each endpoint has its own limit (e.g., match history may be more restricted)
  3. Service Rate Limit - Per service, shared across all applications

    • Can cause 429 errors without X-Rate-Limit-Type header

Rate Limit Headers

HeaderDescription
X-App-Rate-LimitYour app's rate limit
X-App-Rate-Limit-CountCurrent count against app limit
X-Method-Rate-LimitEndpoint's rate limit
X-Method-Rate-Limit-CountCurrent count against method limit
Retry-AfterSeconds to wait before retrying (on 429)

Error Handling

CodeMeaningAction
429Rate limit exceededWait for Retry-After seconds
403Forbidden (invalid/blacklisted key)Check API key validity
404Not foundResource doesn't exist (e.g., player not in game)

Blacklisting: Repeated violations result in temporary blacklisting (escalating duration), eventually permanent.


PUUID and Riot ID

Identifier Types

ID TypeScopeUse Case
PUUIDGlobal, permanentPreferred for all lookups
Summoner IDPer-regionLegacy, still used in some endpoints
Account IDPer-regionLegacy
Riot IDGlobalDisplay name (gameName#tagLine)
  1. Get PUUID from Riot ID:

    GET /riot/account/v1/accounts/by-riot-id/{gameName}/{tagLine}
    
  2. Use PUUID for all subsequent calls:

    GET /lol/match/v5/matches/by-puuid/{puuid}/ids
    GET /lol/summoner/v4/summoners/by-puuid/{puuid}
    

Note: PUUIDs are encrypted per project. A PUUID from your dev key won't work with your production key.


Data Dragon (Static Data)

Base URLs

  • Versions: https://ddragon.leagueoflegends.com/api/versions.json
  • Data: https://ddragon.leagueoflegends.com/cdn/{version}/data/{locale}/
  • Images: https://ddragon.leagueoflegends.com/cdn/{version}/img/

Common Data Files

FileContent
champion.jsonAll champions (basic info)
champion/{name}.jsonSingle champion (detailed)
item.jsonAll items
summoner.jsonSummoner spells
runesReforged.jsonRunes
profileicon.jsonProfile icons

Example URLs

Champions: https://ddragon.leagueoflegends.com/cdn/14.24.1/data/en_US/champion.json
Items: https://ddragon.leagueoflegends.com/cdn/14.24.1/data/en_US/item.json
Champion image: https://ddragon.leagueoflegends.com/cdn/14.24.1/img/champion/Ahri.png
Item image: https://ddragon.leagueoflegends.com/cdn/14.24.1/img/item/1001.png

Community Dragon

Data Dragon can be inaccurate (especially champion spell data). Use Community Dragon (cdragon) for more accurate data:


Twisted Library Usage

This project uses the twisted npm package for Riot API calls.

Installation

npm install twisted

Basic Setup

import { LolApi, RiotApi, TftApi } from 'twisted';

const riotApi = new RiotApi({ key: process.env.RIOT_API_KEY });
const lolApi = new LolApi({ key: process.env.RIOT_API_KEY });

Common Operations

// Get PUUID from Riot ID
const account = await riotApi.Account.getByRiotId(
  gameName,
  tagLine,
  RegionGroups.AMERICAS
);

// Get summoner by PUUID
const summoner = await lolApi.Summoner.getByPUUID(
  puuid,
  Regions.AMERICA_NORTH
);

// Get match history
const matches = await lolApi.Match.list(
  puuid,
  RegionGroups.AMERICAS,
  { count: 20 }
);

// Get match details
const match = await lolApi.Match.get(
  matchId,
  RegionGroups.AMERICAS
);

// Get ranked data
const leagues = await lolApi.League.bySummoner(
  summonerId,
  Regions.AMERICA_NORTH
);

Configuration Options

const api = new LolApi({
  key: 'RGAPI-xxx',
  rateLimitRetry: true,        // Auto-retry on 429 (default: true)
  rateLimitRetryAttempts: 3,   // Max retries
  concurrency: 10,             // Max concurrent requests
  debug: {
    logTime: true,
    logUrls: true,
    logRatelimits: true,
  }
});

Sources

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon