REST API Wrapper for the League of Legends API
A wrapper for the League of Legends official API.
This project aims to provide an easy to use interface for the League of Legends API.
Since it’s my first public project, please feel free to contact me and leave some feedback.
Also please keep in mind that this is not a stable version yet, so interface spec might change while the implementation is still worked on.
$ npm install league-wrapper
The LeagueWrapper accepts the API key and an object with the default region used for the requests.
You can get your key from the Developer Portal.
If no region is passed the Wrapper will default to Region.EUW. Possible regions can be found here
const LeagueWrapper = require('league-wrapper');
const api = new LeagueWrapper('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', {
region: LeagueWrapper.Region.EUW
});
api.summoner.getByNames('PostCrafter').then(function(summoners) {
console.log(summoners);
});
/* Console output:
{
postcrafter: {
id: 48944322,
name: 'PostCrafter',
profileIconId: 1376,
summonerLevel: 30,
revisionDate: 1476740328000
}
}
*/
api.summoner.getByNames('PostCrafter', function(error, summoners) {
console.log(summoners);
});
/* Console output:
{
postcrafter: {
id: 48944322,
name: 'PostCrafter',
profileIconId: 1376,
summonerLevel: 30,
revisionDate: 1476740328000
}
}
*/
See here.
See here.