lol-api-client
Version:
A Node client for interfacing with the League of Legends API
23 lines (17 loc) • 576 B
JavaScript
const web = require('./web')
class Stats {
constructor (apiKey, region) {
this.apiKey = apiKey
this.region = region
this.statsUrl = `https://${this.region}.api.pvp.net/api/lol/${this.region}/v1.3/stats/by-summoner/`
}
getSummary (summonerId) {
const requestUrl = this.statsUrl + `${summonerId}/summary?api_key=${this.apiKey}`
return web.makeRequest(requestUrl)
}
getRanked (summonerId) {
const requestUrl = this.statsUrl + `${summonerId}/ranked?api_key=${this.apiKey}`
return web.makeRequest(requestUrl)
}
}
module.exports = Stats