New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@viriato/lol-esports-api

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@viriato/lol-esports-api

Implementation of League of Legends' Unofficial Esports API.

latest
Source
npmnpm
Version
0.6.0
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

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");

Keywords

lol-esports-api

FAQs

Package last updated on 20 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts