-
Notifications
You must be signed in to change notification settings - Fork 34
LEAGUE V3
Chau Nguyen edited this page Jun 6, 2017
·
11 revisions
- Get the challenger league for a given queue.
- Get leagues in all queues for a given summoner ID.
- Get the master league for a given queue.
- Get league positions in all queues for a given summoner ID.
/lol/league/v3/challengerleagues/by-queue/{queue}
DEFAULT: queue = 'RANKED_SOLO_5x5'
- listChallengers([queue], [region], [cb])
- Namespaced Functions: Challenger.list
var QS = KindredAPI.QUEUE_STRINGS
k.Challenger.list(KindredAPI.print)
k.Challenger.list(QS.RANKED_FLEX_SR, KindredAPI.print)
k.Challenger.list('RANKED_FLEX_SR')
.then(data => console.log(data))
.catch(error => console.error(error))
k.Challenger.list('RANKED_FLEX_SR', REGIONS.KOREA)
.then(data => console.log(data))
.catch(error => console.error(error))
k.Challenger.list(REGIONS.KOREA, KindredAPI.print)
- getChallengers({ region, queue = 'RANKED_SOLO_5x5' } }, cb)
- Namespaced Functions: League.getChallengers, League.challengers
k.League.challengers(KindredAPI.print)
k.League.challengers({ region: 'na' }, KindredAPI.print)
k.League.challengers({ queue: 'RANKED_FLEX_5x5' }, KindredAPI.print)
-
/lol/league/v3/leagues/by-summoner/{summonerId}
- Get leagues in all queues for a given summoner ID.
- getLeagues({ region, accountId/accId (int), id/summonerId/playerId (int), name (str) }, cb)
- Namespaced Functions: League.getLeagues, League.leagues, League.get
- Example 3:
k.League.get({ id: 20026563 }, KindredAPI.print)
- Example 4:
k.League.get({ name: 'Contractz' }, KindredAPI.print)
/lol/league/v3/leagues/by-summoner/{summonerId}
N/A
- getLeagues({ region, accountId/accId (int), id/summonerId/playerId (int), name (str) }, cb)
- Namespaced Functions: League.getLeagues, League.leagues, League.get
k.League.get({ accId: 47776491 }, KindredAPI.print)
k.League.get({ id: 20026563 }, KindredAPI.print)
k.League.get({ name: 'Contractz' }, KindredAPI.print)
/lol/league/v3/masterleagues/by-queue/{queue}
DEFAULT: queue = 'RANKED_SOLO_5x5'
- listMasters([queue], [region], [cb])
- Namespaced Functions: Master.list
k.Master.list(KindredAPI.print)
k.Master.list('RANKED_FLEX_SR', KindredAPI.print)
k.Master.list('RANKED_FLEX_SR')
.then(data => console.log(data))
.catch(error => console.error(error))
k.Master.list('RANKED_FLEX_SR', REGIONS.KOREA)
.then(data => console.log(data))
.catch(error => console.error(error))
k.Master.list(REGIONS.KOREA, KindredAPI.print)
- getMasters({ region, queue = 'RANKED_SOLO_5x5' } }, cb)
- Namespaced Functions: League.getMasters, League.masters
k.League.masters(KindredAPI.print)
k.League.masters({ region: 'na' }, KindredAPI.print)
k.League.masters({ queue: 'RANKED_FLEX_5x5' }, KindredAPI.print)
/lol/league/v3/positions/by-summoner/{summonerId}
N/A
- getLeaguePositions({ region, accountId/accId (int), id/summonerId/playerId (int), name (str) }, cb)
- Namespaced Functions: League.getLeaguePositions, League.getPositions, League.positions
k.League.positions({ id: 20026563 }, KindredAPI.print)
// Return ranks in specific variables.
// WOOPS this fails for certain cases such as
// having flex5 but not solo
// https://github.com/ChauTNguyen/kindred-api/issues/5
let ctzSolo, ctzFlex5, ctzFlexTT
k.League.positions({ name: 'Contractz' }, function(err, data) {
if (err) console.error(error)
if (data) {
if (data.length === 0)
console.log('empty leagues')
if (data.length >= 1)
ctzSolo = data[0]
if (data.length >= 2)
ctzFlex5 = data[1]
if (data.length === 3)
ctzFlexTT = data[2]
// do something here
console.log('ctzSolo:', ctzSolo)
console.log('\nctzFlex5:', ctzFlex5)
console.log('\nctzFlexTT:', ctzFlexTT)
}
})