Data Dragon — yasuo.dataDragon¶
Data Dragon is Riot's static game data and asset CDN (champions, runes, versions, queues, maps…). It is served from a public CDN, so this namespace is special:
Data Dragon is not a query builder
Unlike every other namespace, yasuo.dataDragon.* methods return
Promises of the DTO directly — you just await them. There is:
- no
.execute()— the method already returns a Promise; - no
.error/.http— you get the parsed payload, not an entity/result wrapper; - no rate limiting and no API key required (rate limiting does not apply here).
Because there is no error-carrying result, a failed request throws. Wrap
calls in try / catch if you need to handle CDN failures.
import { Yasuo } from 'yasuo.js'
const yasuo = new Yasuo({ key: process.env.RIOT_API_KEY! })
// Just await it — no .execute(), no .error:
const versions = await yasuo.dataDragon.versions()
console.log(versions[0]) // latest patch, e.g. "14.13.1"
Methods that build a versioned CDN URL (champions, champion, championById,
runesReforged) resolve against the latest version automatically and accept
an optional language locale that defaults to en_US.
versions()¶
All available Data Dragon versions, newest first (the result is memoised).
- Returns —
Promise<string[]>— version strings;versions[0]is the latest patch.
languages()¶
All available locales.
- Returns —
Promise<string[]>— locale codes such asen_US,ko_KR,es_ES.
realm(server)¶
The realm descriptor for a server.
- Params —
server: string— the realm/server code (e.g.na,euw,kr). - Returns —
Promise<DDragonRealmDTO>— key fields:v(data version),cdn(asset base URL),dd(Data Dragon version),l(default language),n(per-section versions,Record<string, string>),profileiconmax.
champions(language?)¶
The full champion list for the latest patch.
- Params —
language: string— locale, defaults toen_US. - Returns —
Promise<DDragonChampionListDTO>— key fields:version,type,format, anddata(Record<string, DDragonChampionSummaryDTO>, keyed by champion id). Each summary carriesid,key(numeric id as a string),name,title,blurb,tags,partype,info,image,stats.
const champions = await yasuo.dataDragon.champions()
const aatrox = champions.data.Aatrox
console.log(champions.version, aatrox.name, aatrox.tags)
champion(name, language?)¶
Detailed data for a single champion by its Data Dragon id.
- Params —
name: string— the champion's Data Dragon id (e.g.Aatrox);language: string— locale, defaults toen_US. - Returns —
Promise<DDragonChampionDetailDTO>— extends the summary withlore,allytips,enemytips,spells(DDragonSpellDTO[]— Q/W/E/R),passive(name,description,image), andskins. Throws if the id is not found.
const aatrox = await yasuo.dataDragon.champion('Aatrox')
console.log(aatrox.lore)
console.log(aatrox.spells.map((spell) => spell.name))
championById(championId, language?)¶
Look up a champion summary by its numeric champion id (matched against the
key field of the latest champion list).
- Params —
championId: number— the numeric champion id (e.g.266for Aatrox);language: string— locale, defaults toen_US. - Returns —
Promise<DDragonChampionSummaryDTO | null>— the summary, ornullif the id is not present in the latest patch.
const champion = await yasuo.dataDragon.championById(266)
if (champion === null) return
console.log(champion.id, champion.name) // "Aatrox" "Aatrox"
runesReforged(language?)¶
The reforged rune paths for the latest patch.
- Params —
language: string— locale, defaults toen_US. - Returns —
Promise<DDragonRunesReforgedDTO[]>— one entry per path (Precision, Domination, …), each withid,key,icon,name, andslots(each slot has arunes: DDragonRuneDTO[]array —id,key,name,shortDesc,longDesc).
const paths = await yasuo.dataDragon.runesReforged()
for (const path of paths) {
console.log(path.name, path.slots[0].runes.map((rune) => rune.name))
}
queues()¶
The static queues reference list.
- Returns —
Promise<DDragonQueueDTO[]>— each withqueueId,map,description(string | null),notes(string | null).
const queues = await yasuo.dataDragon.queues()
const soloDuo = queues.find((queue) => queue.queueId === 420)
console.log(soloDuo?.description)
maps()¶
The static maps reference list.
- Returns —
Promise<DDragonMapDTO[]>— each withmapId,mapName,notes.
gameModes()¶
The static game-modes reference list.
- Returns —
Promise<DDragonGameModeDTO[]>— each withgameMode,description.
const gameModes = await yasuo.dataDragon.gameModes()
console.log(gameModes.map((mode) => mode.gameMode))
gameTypes()¶
The static game-types reference list.
- Returns —
Promise<DDragonGameTypeDTO[]>— each withgametype,description.
const gameTypes = await yasuo.dataDragon.gameTypes()
console.log(gameTypes.map((type) => type.gametype))
seasons()¶
The static seasons reference list.
- Returns —
Promise<DDragonSeasonDTO[]>— each withid,season.
const seasons = await yasuo.dataDragon.seasons()
console.log(seasons.map((season) => season.season))
Handling failures¶
Because Data Dragon returns plain payloads (no .error), a failed CDN request
throws. Handle it with try / catch: