@dr-fabian/riot_api
v2.0.1
Published
A library made in Typescript that makes it easy to use the Riot API.
Downloads
2
Maintainers
Readme
@Dr-Fabian/Riot_API
@Dr-Fabian/Riot_API is a Javascript library written in TypeScript, with the purpose of facilitating the use of RIOT's api.
Installation
Using NPM
npm i @dr-fabian/riot_api
Using yarn
yarn add @dr-fabian/riot_api
Usage
Get Summoner
const Riot = require('@dr-fabian/riot_api');
const RiotAPI = new Riot(/* <token goes here> */);
// Returns informations about the summoner's account.
await RiotAPI.leagueOfLegends.getPlayer(username);
Get Summoner's last matches
const Riot = require('@dr-fabian/riot_api');
const RiotAPI = new Riot(/* <token goes here> */);
// Returns an array of the summoner's last matches, if not specified, the request begins at index 0 and ends at index 1.
await RiotAPI.leagueOfLegends.getPlayerLastMatches(
accountId,
beginIndex,
endIndex
);
Get Match info
const Riot = require('@dr-fabian/riot_api');
const RiotAPI = new Riot(/* <token goes here> */);
// Returns informations about the match.
RiotAPI.leagueOfLegends.getMatchInfo(matchId);
Get Champion Mastery
const Riot = require('@dr-fabian/riot_api');
const RiotAPI = new Riot(/* <token goes here> */);
// Returns array of player's champions info.
RiotAPI.leagueOfLegends.getPlayerChampionsInfo(summonerEncryptedId);
Informations
- This library only supports League of Legends for now, but I plan on providing a support for Valorant as well in the future, when the API will be public.
- Anyone can contribute to this library. Feel free to do it.