npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@viriato/lol-esports-api

v0.6.0

Published

Implementation of League of Legends' Unofficial Esports API.

Downloads

1,522

Readme

Unofficial League Esports API Wrapper

NPM Package Publisher

This is a simple wrapper of League of Legends' eSports API.

A huge contribution to this project has been vickz84259's documentation, from which the API responses' types have been generated.

Full API Reference


Usage

Events

Fetching currently live events:
import APIClient from "lol-esports-api";

const client = new APIClient();
const liveEvents = await client.events.getLive();

Games

Fetching a game:
import APIClient from "lol-esports-api";

const client = new APIClient();
const game = await client.games.get("110853167109116577");
Fetching data for a portion of a game:

The API's response contains a frames array property where each element represents a "snapshot" of the game's state. It spans a period of 10 seconds.

If given a startingDate parameter value of a later point in time than the end of the game, it will return with the game's last 10 frames. This can be useful if you'd like to fetch a game's finished state data.

It includes information such as objectives taken and players' scoreboard data. To fetch more detailed information, see getDetails.

import APIClient from "lol-esports-api";

const client = new APIClient();

const gameWindow = await client.games.getWindow(
  "110853167109116577",
  "2023-10-19T09:35:40.000Z" // can either be a string or a Date
);
Fetching detailed data for a portion of a game:

Works similarly to getWindow, except it returns with more detailed information such as champion level and stats, creep score, gold earned, ability level up sequence, etc.

import APIClient from "lol-esports-api";

const client = new APIClient();

const detailedGameWindow = await client.games.getDetails(
  "110853167109116577",
  "2023-10-19T09:35:40.000Z" // can either be a string or a Date
);

Leagues

Fetching all leagues:
import APIClient from "lol-esports-api";

const client = new APIClient();
const leagues = await client.leagues.get();
Fetching a league's tournaments:
import APIClient from "lol-esports-api";

const client = new APIClient();
const leagueTournaments = await client.leagues.getTournaments(
  "98767975604431411"
);
Fetching a league's schedule:
import APIClient from "lol-esports-api";

const client = new APIClient();
const leagueSchedule = await client.leagues.getSchedule("98767975604431411");

Matches

Fetching a match's event:
import APIClient from "lol-esports-api";

const client = new APIClient();
const matchEvent = await client.matches.getEvent("108998961199240268");

Teams

Fetching all teams:
import APIClient from "lol-esports-api";

const client = new APIClient();
const teams = await client.teams.get();
Fetching a single team:
import APIClient from "lol-esports-api";

const client = new APIClient();
const fnaticTeam = await client.teams.get("fnatic");

Tournaments

Fetch a tournament's completed events:
import APIClient from "lol-esports-api";

const client = new APIClient();
const tournaments = await client.tournaments.getCompletedEvents(
  "108998961191900167"
);
Fetch a tournament's standings:
import APIClient from "lol-esports-api";

const client = new APIClient();
const standings = await client.tournaments.getStandings("108998961191900167");