Skip to content
Back to skills

League Sdk

ASecurity

Build League of Legends apps using league-sdk TypeScript library. Use when working with Riot API, summoner/player lookups, match history, champion mastery, ranked stats, live game spectator, or building LoL Discord bots, websites, or apps.

  • 225 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 4, 2026
developmenttypescriptgobashapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned September 4, 2026

npx -y skills add NeverSight/skills_feed --skill league-sdk --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of League Sdk?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for League Sdk
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/neversight-league-sdk/badge)](https://www.skillsdirectory.com/skills/neversight-league-sdk)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: league-sdk
description: Build League of Legends apps using league-sdk TypeScript library. Use when working with Riot API, summoner/player lookups, match history, champion mastery, ranked stats, live game spectator, or building LoL Discord bots, websites, or apps.
---

# League SDK

Typed TypeScript SDK for Riot LoL API. Handles routing, PUUID conversions, rate limiting.

## LoL API Concepts

**Scope**: This SDK covers League of Legends only. TFT, Valorant, Wild Rift have separate APIs.

**PUUID**: Universal ID across Riot games. Preferred over SummonerId/AccountId (deprecated).

**Platform**: Use player's server (`kr` for Korean, `euw1` for EU West). Wrong platform = 404.

**Queue IDs**: `420` Solo/Duo, `440` Flex, `450` ARAM, `400` Normal Draft, `430` Blind

**Timestamps**: Unix epoch milliseconds → `new Date(match.gameCreation)`

**Match history**: Riot retains ~2 years. Older matches may be unavailable.

## Patterns

```typescript
import { LolClient, NotFoundError, RateLimitError } from 'league-sdk';

const client = new LolClient({
  apiKey: process.env.RIOT_API_KEY!,
  platform: 'na1'
});

// Player lookup
const player = await client.players.getByRiotId('Name', 'Tag');

// Ranked stats
const soloQ = await player.getSoloQueueStats();
// soloQ.tier, soloQ.division, soloQ.winRate (0-1 decimal)

// Match history
const matches = await player.getMatches({ count: 10, queue: 420 }); // 420 = ranked
for (const match of matches) {
  const p = match.getParticipant(player.puuid)!;
  console.log(`${p.championName} ${p.kills}/${p.deaths}/${p.assists} - ${p.win ? 'W' : 'L'}`);
}

// Participant stats
const p = match.getParticipant(player.puuid)!;
p.kills; p.deaths; p.assists; p.kda;
p.championName; p.win;
p.items;          // { item0-5, trinket }
p.totalCs; p.csPerMinute;
p.damage.toChampions; p.damage.taken;
p.goldEarned; p.visionScore;

// Match stats
match.gameDurationFormatted;  // "32:15"
match.queueName;              // "Ranked Solo/Duo"
match.blueTeam; match.redTeam;
match.getWinner(); match.didPlayerWin(player.puuid);

// Team comparison
const { blueTeam, redTeam } = match;
console.log(`Blue: ${blueTeam.totalKills}K, ${blueTeam.totalGold}g`);

// Live game (null if not in game)
const game = await player.getLiveGame();

// Mastery
const top = await player.getTopMastery(3);
// m.championName, m.championPoints, m.championLevel

// Static data (no API key needed)
const champs = await client.dataDragon.getChampions();
const items = await client.dataDragon.getItems();
await client.dataDragon.getChampionIconUrl('Ahri');
await client.dataDragon.getItemIconUrl(3157);
```

## Asset Downloads

```bash
npx league-sdk-assets --output ./assets --all
```

Programmatic: `import { downloadAllAssets } from 'league-sdk/scripts'`

## Platforms

`na1` `euw1` `eun1` `kr` `jp1` `br1` `la1` `la2` `oc1` `tr1` `ru` `sg2` `ph2` `th2` `tw2` `vn2`

## Troubleshooting

- **401**: API key expired (dev keys last 24h)
- **404**: Wrong platform or player doesn't exist
- **429**: Rate limited (SDK handles automatically)
- **NotFoundError**: Player/match doesn't exist
- **RateLimitError**: Has `retryAfter` property (seconds)
- **AuthenticationError**: Invalid API key

Files in this skill

  • SKILL.md3.1 KB
  • description_ar.txt487 B
  • description_cn.txt254 B
  • description_de.txt304 B
  • description_en.txt240 B
  • description_es.txt332 B
  • description_fr.txt365 B
  • description_it.txt326 B
  • description_ja.txt422 B
  • description_ko.txt292 B
  • description_ru.txt507 B
  • description_tw.txt254 B
  • stats.json66 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.