LeagueAPIWrapper (Node.JS)
Simple Wrapper for all League Of Legends API methods
Example get accountInfo object to be used in other methods:
let LeagueAPI = require('leagueapiwrapper');
LeagueAPI = new LeagueAPI(leagueAPIKey, Region.NA);
LeagueAPI.getSummonerByName('LeagueOfSausage')
.then(function(accountInfo) {
console.log(accountInfo);
})
.catch(console.error);
Get featured games, populated with DDRagon data
LeagueAPI.initialize()
.then(function(){ return LeagueAPI.getFeaturedGames() })
.then(function(data) {
console.log(data);
})
.catch(console.error);
Methods
initialize
LeagueAPI.initialize()
.then() {
})
.catch(console.error);
getDDragonLocalDataVersion
LeagueAPI.getDDragonLocalDataVersion();
setFullyLoadClasses(boolean)
LeagueAPI.setFullyLoadClasses(false);
changeRegion(Region)
LeagueAPI.changeRegion(Region.NA);
getThirdPartyCode(AccountObject)
LeagueAPI.getThirdPartyCode(accountId)
.then(function(data) {
console.log(data);
})
.catch(console.error);
getStatus()
LeagueAPI.getStatus()
.then(console.log)
.catch(console.error);
getFeaturedGames()
LeagueAPI.getFeaturedGames()
.then(console.log)
.catch(console.error);
getMatch(matchId) - Match-V5
LeagueAPI.getMatch('NA1_4102250582')
.then(console.log)
.catch(console.error);
getMatchByTournament(matchId, tournamentCode)
LeagueAPI.getMatchByTournament(2970107953, tournamentCode)
.then(console.log)
.catch(console.error);
getMatchIdsByTournament(tournamentCode)
LeagueAPI.getMatchIdsByTournament(tournamentCode)
.then(console.log)
.catch(console.error);
getClash(accountObj)
LeagueAPI.getClash(accountObj)
.then(console.log)
.catch(console.error);
getClashTournament()
LeagueAPI.getClashTournament()
.then(console.log)
.catch(console.error);
getLeagueRanking(accountObject)
LeagueAPI.getSummonerByName('LeagueOfDrMundo').then(function(accountObject) {
LeagueAPI.getLeagueRanking(accountObject)
.then(console.log)
.catch(console.error);
});
getSummonerByName(summonerName)
LeagueAPI.getSummonerByName('LeagueOfDrMundo')
.then(function(accountObject) {
console.log(accountObject);
})
.catch(console.error);
getActiveGames(accountObject)
LeagueAPI.getSummonerByName('LeagueOfDrMundo')
.then(function(accountObject) {
return LeagueAPI.getActiveGames(accountObject);
})
.then(function(activeGames) {
console.log(activeGames);
})
.catch(console.error);
getMatchList(accountObject) - Match-V5
LeagueAPI.getSummonerByName('LeagueOfDrMundo')
.then(function(accountObject) {
return LeagueAPI.getMatchList(accountObject);
})
.then(function(activeGames) {
console.log(activeGames);
})
.catch(console.error);
getMatchTimeline(matchId) - Match-V5
LeagueAPI.getMatchTimeline('NA1_4102250582')
.then(console.log)
.catch(console.error);
getChampionMasteryTotal(accountObject)
LeagueAPI.getSummonerByName('LeagueOfSausage')
.then(function(accountObj) {
return LeagueAPI.getChampionMasteryTotal(accountObj);
})
.then(function(championMasteryTotal)
{
console.log(championMasteryTotal);
})
.catch(console.error);
getChampionMastery(accountObject)
LeagueAPI.getSummonerByName('LeagueOfDrMundo')
.then(function(accountObj) {
return LeagueAPI.getChampionMastery(accountObj);
})
.then(function(championMasteryList)
{
console.log(championMasteryList);
})
.catch(console.error);
getChampionMasteryByChampion(accountObject, championObj)
const drMundoChampId = 36;
const leagueOfDrMundoSummonerId = 'IE2WdICfZnhEWYPIBfHio7jxCeo1IFynclJAPquqENRrpeYK';
LeagueAPI.getChampionMasteryByChampion(leagueOfDrMundoSummonerId, drMundoChampId)
.then(console.log)
.catch(console.error);
getFreeChampionRotation()
LeagueAPI.getFreeChampionRotation()
.then(console.log)
.catch(console.error);
Disclaimer
MundoScript
is not endorsed by Riot Games and does not reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.
Feel free to make suggestions on features/etc.