Closed ghost closed 7 years ago
I'm not sure what you mean by passing as an option different queues and parameters, but would this endpoint be what you need?
https://developer.riotgames.com/api-methods/#league-v3/GET_getAllLeaguePositionsForSummoner
Notice that you can't pass in any options into that endpoint, so I exclude the options
from my method at the very bottom of this post.
k.League.positions({ name: 'Contractz' }, KindredAPI.print)
/*
{
tier: 'CHALLENGER',
queueType: 'RANKED_SOLO_5x5',
rank: 'I',
playerOrTeamId: '32932398',
playerOrTeamName: 'Contractz',
leaguePoints: 550,
wins: 225,
losses: 186,
veteran: true,
inactive: false,
freshBlood: false,
hotStreak: false },
{ leagueName: 'Ahri\'s Soldiers',
tier: 'PLATINUM',
queueType: 'RANKED_FLEX_SR',
rank: 'I',
playerOrTeamId: '32932398',
playerOrTeamName: 'Contractz',
leaguePoints: 53,
wins: 10,
losses: 7,
veteran: false,
inactive: false,
freshBlood: false,
hotStreak: false } ]
*/
Note that the positions only show up if they're ranked in that specific queueType (there's ranked flex, ranked solo 5x5, and ranked twisted treeline). If they are not ranked, it won't show up.
If you're talking about the methods specifically (which you might be, I just woke up), then this is the documentation
https://github.com/ChauTNguyen/kindred-api/wiki/LEAGUE-V3
I'm still updating the wiki to make it cleaner, but this documentation piece was at the very very bottom so sorry about that. I've been working on other parts of this wrapper so I haven't gotten around to making the documentation clearer.
/lol/league/v3/positions/by-summoner/{summonerId}
Get league positions in all queues for a given summoner ID.
getLeaguePositions({ region, accountId/accId (int), id/summonerId/playerId (int), name (str) }, cb)
Namespaced Functions: League.getLeaguePositions, League.getPositions, League.positions
Example 1: k.League.positions({ summonerId: 20026563 }, KindredAPI.print)
I think I need that but not really sure because I want to pass Options like QueueType. I am developing a boosting service and need to make a check like these guys here - https://elo-boost.net/boosting/purchase
Check DuoQueue and see how they fetch the ranking for a summoner. Can this be achieved in the same manner?
Thanks!
@gopchi
Yeah this isn't possible based on the Riot API methods. You would have to filter out based on the queueType in the data (it says RANKED_SOLO_5x5 and stuffs in the data above).
This is probably (or definitely) how the boosting site does it too -- there are only three ways of being ranked, and so only 0-3 league position objects can show up (if they're not ranked in twisted treeline, it won't show up, to be clear). They only have 3 options as well for determining rank.
There are no options at all to pass through to the endpoint unfortunately.
However, I could eventually get to adding convenience methods if enough people ask.
@ChauTNguyen As you supposed I will check every object in the array of objects if queueType exists and if so what is the value and return the result based on it.
Thank you for pointing this information out. It was clear enough. :) You may close this
@gopchi
Yes, according to the documentation queueType will always exist, and so that's one fine way to do it.
However, after doing a bunch of manual summoner grabbing with my League.positions
, the way data is returned is always in this order:
RANKED_SOLO_5x5 -> RANKED_FLEX_5x5 -> RANKED_FLEX_TT
And so you simply have to check the length of data and you will know what queue types you have retrieved.
@ChauTNguyen That's awesome, really thanks a lot!
Hi, I really liked your API and decided to use it in a project. But I have one issue - how do I get the current rank of a summoner by passing as an option different queues and regions?
It would be very helpful if you can help!