Idea: League of Legends API + Commands

Well, let’s start this, I asked in twitter about a League of Legends API, such as Moobot, or Xanbot has. Few things that viewers may ask to the bot for League of Legends would be, League/Rank/League Points, Masteries, and Runes.

I tried looking for a bot with LoL API so i tried somes, as I said Moobot and Xanbot have this features, Moobot is kinda short range search, you put your summoner name and server and only works for that while Xanbot, you do that AND if you put “server+name” you get a proper search of another summoner name.

I think the second one is the properly and best one to use.

League of Legends works with summoner names as IGN that use to play 2 fixed things that usually people ask for: runes and masteries that depends on the champion (character that you’re using right in that moment). That would be 2 variables to use for API, and the last one would be ranked thingy that says which league and many league points you have.

I’m sorry for my english if i made any mistake. And i don’t know if i can help for the API in any other way.

Thanks for read.


Unfortunately I don’t play League of Legends nor does anyone who helps out with the project. If you can summarize, with a lot of specificity, what information needs to be pulled from the API we can probably create a variable to do this.

We’ve added a rank lookup variable:

1 Like

I tried to use this rank lookup variable, but only get the output [Invalid Variable]
Am I the only one having this issue?

After some testing, I see it works fine with nightbot beta. I would assume it would never work on the normal nightbot?

The beta Nightbot will be replacing the old Nightbot in the near future. If you’re not already using the beta I recommend upgrading now.

1 Like

How might you handle spaces in the summoner name? %20 and quoting the name don’t work.

Hi there, I actually created some commands for my friend who is streaming League of Legends. I created them on my own server using PHP and I grab them using the $(customapi ) variable on nightbot. I haven’t those commands on another League of Legends stream and I believe that some of them are really helpful.

Here are some of the commands:

  • 5 most played champions;
  • 5 champions that have the most win rate;
  • Stats for a specific champion;
  • Stats from last game;
  • Current queue type

This is something we weren’t aware of, but will fix. In the meantime, you can apparently remove spaces and it will query properly.

If you post an example league summoner name and example responses you’d like Nightbot to serve for each of those 5 command types, we can potentially extend the league variable extract more information. As is stated above in my first reply, we don’t play league so we have no idea what is or is not important information to return in the variable.

Sure I can show you the response I get from the commands. All commands are made for the summoner name ‘Brouitup’ from the NA region. I hope it answer your question and if not, I can be available to explain further more :slightly_smiling:

5 most played champions

Nightbot: Brouitup’s most played champs : 1. Ekko (18), 2. Zac (6), 3. Pantheon (2), 4. Shaco (2), 5. Blitzcrank (2)

5 champions that have the most win rate

Nightbot: Overall : 48.7% Top 5 : 1. Gragas (58.2%), 2. Cho’Gath (57.1%), 3. Shaco (57%), 4. Ekko (53.8%), 5. Rengar (52.2%)

Stats for a specific champion

!stats shaco
Nightbot: Brouitup’s stats with shaco: 57% [187/141]. KDA: 9.3/7.7/7.3. 1 penta kill!

Stats from last game

Nightbot: Last game lost with Ekko 3/11/10 (1.18 KDA and 30.2% kill participation) 2 double kills!

Current queue type

Nightbot: Current queue: Ranked 5v5

Current rank

Nightbot: Rank of Brouitup : Platinum IV (100 LP) Series: X O -

Thanks for the helpful examples. I’ve added this to the to-do list. Unfortunately due to larger changes happening I don’t have an ETA for its completion.

hey night, would it be possible to also add the LP to the actual league rank?

Actually the results looks like: "{Summonername}'s current rank: {divison}"
What would be pretty helping would be: “{Summonersname}'s current rank: {division} (LP: {leaguePoints})”

I guess actually you do /api/lol/{region}/v1.4/summoner/by-name/{summonerNames} to get the summoners id and after that /api/lol/{region}/v2.5/league/by-summoner/{summonerIds}/entry to get the divison, the second command also gives you “leaguePoints” back, which are the LP.

Currently the mods are editing the “!elo” command by hand after every game. If you could add this to the leagueoflegends variable that would be pretty cool and maybe not that much work :slightly_smiling:

Thank you very much!