RepositoryTypeScriptGBUnited Kingdom
fightmegg

fightmegg/riot-api

Client for Riot Games API

98stars
29forks
0issues
1views

RiotAPI

Version Downloads CircleCI

Node.JS minimal Riot API client written in Typescript

Features

  • Rate limiting through @fightmegg/riot-rate-limiter
  • Automatic retries
  • TypeScript typings
  • 100% endpoint coverage (incl. DDragon)
  • Caching with custom ttls per endpoint
  • Request prioritization

Installation

$ npm install @fightmegg/riot-api

Usage

import { RiotAPI, RiotAPITypes, PlatformId } from "@fightmegg/riot-api";

(async () => {
  const rAPI = new RiotAPI("RGAPI-KEY");

  const summoner = await rAPI.summoner.getBySummonerName({
    region: PlatformId.EUW1,
    summonerName: "Demos Kratos",
  });
})();

Config

const config: RiotAPITypes.Config = {
  debug: false,
  cache: {
    cacheType: "ioredis", // local or ioredis
    client: "redis://localhost:6379", // leave null if client is local
    ttls: {
      byMethod: {
        [RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME]: 5000, // ms
      },
    },
  },
};

const rAPI = new RiotAPI("RGAPI-TOKEN", config);

Error handling

If you use Promises then any error will reject the promise, this can either be an error value, or the response from the API.

Same as above with async/await, where the error thrown will be the response from the API if the error occured at that level.

Caching

Caching is turned off by default, but with the cache property in the config you can enable it with various settings. For now we only support local (in memory) or ioredis caches, will potential support for custom caches in future.

When setting up the cache, you can change the ttl of each method / endpoint individually. This is done through the METHOD_KEY type which can be found in the typings file.

DDragon

We also fully support DataDragon which can be accessed in two ways:

// ...
const rAPI = new RiotAPI("RGAPI-KEY");

const latestV = await rAPI.ddragon.versions.latest();
const champs = await rAPI.ddragon.champion.all();

If you want to just use static data only, then you can do the following:

import { DDragon } from "@fightmegg/riot-api";

const ddragon = new DDragon();
const champs = await ddragon.champion.all();

Just like the main API, we have full TypeScript typings for DDragon endpoints. Please note we do not support caching for DDragon endpoints.

regionToCluster

A helper method to make it easier to determing which cluster you want to hit based on the users region

import { regionToCluster } from "@fightmegg/riot-api";

const cluster = regionToCluster("EUW1"); // outputs "EUROPE"

TypeScript typing

import { RiotAPI, RiotAPITypes, PlatformId } from '@fightmegg/riot-api';

// ...

const summoner: RiotAPITypes.Summoner.SummonerDTO = await rAPI.summoner.getBySummonerName(...);

Debugging

If you want to see want the rate-limiter is currently doing, we use the debug module for logging. Simply run your app with:

DEBUG=riotapi* node ...

Testing

Unit tests: npm test

E2E tests: npm run test:e2e

Planned features

  • Custom Caches
  • Interceptors (before request & on response)

Maintainers

@olliejennings

Similar Projects

Discover other similar projects and AI models.

RepositoryC#
Cat1Bot/league-patch-collection

Vanguard disabler and optimizer League Client

90
Apr 1, 2026
RepositoryRust
wnzzer/rank-analysis

A League of Legends match history and performance analysis assistant built with Tauri 2 and Rust. Its innovative tagging system lets users instantly identify and analyze underperforming teammates, hard carries, and “passenger” players.

482
Nov 30, 2026
RepositoryJava
taycaldwell/riot-api-java

Riot Games API Java Library

194
Aug 8, 2022
RepositoryC#
BlossomiShymae/Needlework.Net

🪡 A .NET helper development tool for the LCU and Game Client!

163
May 25, 2026
RepositoryTypeScript
junlarsen/league-connect

:electric_plug: Node.js HTTP/1.1, HTTP/2.0 and WebSocket interface to the League of Legends Client APIs

165
Aug 31, 2024
RepositoryTypeScript
molenzwiebel/OriannaBot

:robot: Everyone's favorite Discord bot

134
Nov 4, 2026
RepositoryTypeScript
freeCodeCamp/freeCodeCamp

freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.

459.9k
Dec 2, 2026
RepositoryC#
BenFradet/RiotSharp

C# wrapper for the Riot Games API

299
Jun 1, 2026
RepositoryJava
meraki-analytics/orianna

A Java framework for the Riot Games League of Legends API (http://developer.riotgames.com/).

195
Nov 13, 2025