How to retrieve Overwatch stats through Nightbot

Asked May 31, 2016·103 replies·Last activity 2 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

Hello!

After the positive reactions & feedback I got for sharing my Destiny and Division command on the forums, I present to you the Overwatch command. For this project I teamed up with OverwatchTracker, they were able to provide me these awesome statistics. The usage is the same as the other commands you might be used to.

How it works:

!overwatch < action > < username > < platform >

Examples

  • !overwatch skills xgerhard xbox

xgerhard: xgerhard's Solo kills: 138 (#514, Top 72%).

  • !overwatch kd randomuser ps

xgerhard: randomuser's K/D ratio: 1,17 (#662, Top 93%).

  • !overwatch games user-1234 pc

xgerhard: user-1234's Games Played: 57 (#516, Top 72%).

Notice
Usernames are case sensitive
If your BattleNet tag is User#1234, replace # with -, like this: User-1234
Use + instead of spaces in your username: !overwatch kills user+with+spaces xbox
Available platforms: xbox, ps, pc

< action >
'Action' is the stat you would to display.
(Full up to date command list here: https://2g.be/twitch/Overwatch/)

Action list:

  • kd (Kill/Death ratio)
  • kda (Kill+Assists/Death ratio)
  • wins (Total wins)
  • winp (Win %)
  • lvl (Player level)
  • games (Games played)
  • score (Total score)
  • eliminations (Total eliminations)
  • healing (Total healing done)
  • finalblows (Total final blows)
  • dmg (Total dmg done)
  • kpg (Kills per game)
  • profile (Returns OverwatchTracker profile url)

Kills / Deaths / Assists

  • skills (Total solo kills)
  • okills (Total objective kills)
  • mkills (Total multi kills)
  • ekills (Total environmental kills)
  • deaths (Total deaths)

103 replies

  • edeaths (Total environmental deaths)
  • assists (Total assists)
  • defassists (Total defensive assists)
  • offassists (Total offensive assists)

Time

  • time (Total playtime)
  • firetime (Total time spent on fire)
  • obtime (Total objective time)

Rewards

  • cards (Total Card rewards)
  • medals (Total medals)
  • gmedals (Total Gold medals)
  • smedals (Total Silver medals)
  • bmedals (Total Bronze medals)

Best in 1 game

  • mskills (Most Solo kills in 1 game)
  • mokills (Most Objective kills in 1 game)
  • meliminations (Most Eliminations in 1 game)
  • mfinalblows (Most Final blows in 1 game)
  • mdmg (Most Damage done in 1 game)
  • mhealing (Most Healing done in 1 game)
  • mdefassists (Most deffensive assists in 1 game)
  • moffassists (Most offensive assists in 1 game)
  • motime (Most objective time in 1 game)
  • mfiretime (Most time spent on fire)

Other

  • commands (Link to commands list)
  • install (Link to install guide)
  • contact (Contact info)
  • donate (Support info)
  • Hero specific

If you want to check stats for a Hero specific, just type the Hero's name before the stat. For example:

  • !overwatch tracerkd xgerhard xbox

xgerhard: xgerhard's Tracer K/D ratio: 0,98 (#456, Top 76%).

  • !overwatch meikpg xgerhard xbox

xgerhard: xgerhard's Mei Kills per game: 3,00 (#201, Top 42%).

  • !overwatch widowmakerfiretime xgerhard xbox

xgerhard: xgerhard's Widowmaker Time spent on Fire: 21 days, 18 hours and 0 minutes (522.00 hours), (#67, Top 10%).

Available champions: Lucio, Reaper, Tracer, Mercy, Hanzo, Torbjorn, Reinhardt, Pharah, Winston, Widowmaker, Bastion, Symmetra, Zenyatta, Genji, McCree, Zarya, Soldier76, DVa, Mei, Ana, Roadhog, Junkrat, Sombra, Orisa, Doomfist.

< gamertag / psn / BattleNet >
The username you use. Use + instead of spaces in your username.

Usernames are case sensitive.
For example: !overwatch skills user+with+spaces xbox
BattleNet users replace # with -.
For example: !overwatch skills user-1234 pc

< platform >
Available platforms are: xbox/ps/pc.

Install (Update 5 Jan 2017 - New copy-pasta command)

Installing is simple, just copy paste the following command:

!commands add !overwatch -cd=5 -ul=everyone $(urlfetch https://2g.be/twitch/Overwatch/command/query=$(querystring)&defaultconsole=xbox)

Note: Make sure to change xbox to your personal default console xbox/ps/pc.
Note: You can change the userlevel (-ul) and cooldown (-cd) to your preferences.
Note: Add &hideBnetID add the end of the url to hide Battlenet ID's

Or use the command generator over here: https://2g.be/twitch/Overwatch/

Update: setplayer command
Since typing the usernames can be a struggle (case sensitive, replacing stuff) use the new setplayer command, the command will link your Twitch username to your Overwatch account.
Usage: !overwatch setplayer xgerhard xbox

This also works for region specific accounts:
!overwatch setplayer xgerhad-1234-eu pc

After linking your account, you can just use the command without having to type your username:
xgerhard: !overwatch skillrating
Nightbot: [Dev] xgerhard: xgerhard's Skill Rating: 2.407 (#60.077, Top 23%).

Questions or feedback?
Twitch: Xgerhard
Twitter: @member
Discord: xgerhard#2439

How can I edit the link to always show the stats of same person (the streamer)?

Graceful Giraffe said:
How can I edit the link to always show the stats of same person (the streamer)?

!commands add !overwatch -cd=5 -ul=everyone $(urlfetch https://2g.be/twitch/Overwatch/command/action=$(1)&format=$(provider)&user=$(user)&bot=nightbot&console=PLATFORMHERE&channel=$(channel)&defaultconsole=xbox&gamertag=USERNAMEHERE)

Change USERNAMEHERE and PLATFORMHERE to the persons value in the command above. Now the command will always take the stats from that person.

Another question, does the user need to create a profile on the Overwatch Tracker first or does the site have a database of all players?

Graceful Giraffe said:
Another question, does the user need to create a profile on the Overwatch Tracker first or does the site have a database of all players?

The user does not have to create a profile. Not all players are in the database yet, whenever you use the command or just search your username on their site, you'll be saved and ranked in the leaderbords.

Hey, do you have any idea why I can't search for my own stats? I've tried everything and it says there is noone named me. I use a pc and write the # as - and still no. Any idea?

Snowy Eagle said:
I've tried everything and it says there is noone named me.

Hey, whats your Battlenet and region, I'll have a look.

Hello,

I want to install this on my twitch, but i dont want it to display my gamertag when people call it (to stop unwanted friend requests). Is there a way/can you add a way to manipulate the output to say, for example:

xgerhard: STREAMERNAME's Tracer K/D ratio: 0,98 (#456, Top 76%).

instead of

xgerhard: xgerhard's Tracer K/D ratio: 0,98 (#456, Top 76%).

(perhaps it could be set as a variable, or extract it straight from the stream)

Hi,
I've been thinking of a solution for this, but at this moment it's not possible.
I would need to track a custom name for every user, and it would allow people to show stats from other people with their name on it. Showing the gamertag is the only way for people to check if the stats are legit.
I see your problem, but untill I find a flawless solution this won't be possible.

what about potentially only showing their in game name but not the number, this would solve that to a degree because you could then see if they are using one that you would expect, eg:

xgerhard: user's Games Played: 57 (#516, Top 72%).

instead of
xgerhard: user-1234's Games Played: 57 (#516, Top 72%).

you could surely implement this with another php boolean variable and a simple if statement. because to a degree you can still claim someone elses with or without the numbers, the numbers are fairly irrelevant... doing this would mean you could show its your gamer tag without releasing the full details.

That should work for now yes, good suggestion. I'll add that option this weekend, I'll post here when it's finished with instructions.

Sturdy Raccoon said:
what about potentially only showing their in game name but not the number, this would solve that to a degree because you could then see if they are using one that you would expect, eg:

So to use this get the basic command and add &hideBnetID at the end.

!commands add !overwatch -cd=5 -ul=everyone $(urlfetch https://2g.be/twitch/Overwatch/command/action=$(1)&format=$(provider)&user=$(user)&bot=nightbot&console=$(3)&channel=$(channel)&defaultconsole=xbox&gamertag=$(2)&hideBnetID)

If you want the command just for your stats, look at the comment I posted above (replace $(2) with your username, and $(3) with your platform). If you want the command to be public for everybody, and still want your GT private, use commands like this:
!commands add -a=!overwatch !overwatchkd kd user-1234 pc

Now when you type !overwatchkd it will show:
xgerhard: user's kd is 1.00 (#x, Top x%)

And ofcourse you can replace the kd part with every stat you would like.

My bad, didn't push it live yet, should be good now ;)

love it, minor edit, could you disable the profile command when &hideBnetID is there? then it would literally be perfect.

so how do you do it with pc and does it work in canada

I just tried to install this and I keep getting back " Nightbot : Error Connecting To Remote Server"

Did I do something wrong or is it down?

This is what I added, I play on PC and my GT is ted1025 (BN #1410), do I need to put that in the command? I thought I would need to leave the gamer tag as $ so anyone could use the command

"!commands add !overwatch -cd=5 -ul=everyone $(urlfetch https://2g.be/twitch/Overwatch/command/action= $(1)&format=$(provider)&user=$(user)&bot=nightbot&console=$(3)&channel=$(channel)&defaultconsole=pc&gamertag=$(2))"

Thanks let me know

Sugary Parrot said:
I just tried to install this and I keep getting back " Nightbot : Error Connecting To Remote Server"

Did I do something wrong or is it down?

Hey, thanks for trying out the command. The command looks fine, usually when you get 'Error Connecting To Remote Server' message, my server took too long to load your stats. However if you try the same command again, it should almost instantly respond. Could you try again now, the command is currently working fine for me.

Sturdy Peacock said:
so how do you do it with pc and does it work in canada

Heya, use the command generator to generate the command. Now paste the generated text in your Twitch chat. After that you should be able to check people's stats, all regions supported.
For example: !overwatch kd xgerhard xbox.

i don t understand what the provider is

Sturdy Peacock said:
i don t understand what the provider is

You don't need to change anything in the generated text, just copy paste it in your chat. FYI, the $(provider) tells me if a user is requesting the command from Discord or Twitch.

also dat thing happened to me where it cant find the username

So yeah I'm an idiot - I removed my post lol

I posted about not finding my PC stats not realizing I had to change User to my BN tag and also use the #after. Sorry about that. Working great now!!! Thanks. Also I've been using the Destiny one for a while now, also love that, great work!

Hi I am trying to set up this on my nightbot but I am extremely new and do not understand what it is i need to change in the code my console is Xbox one and my battle net is DragonMike#11914 but my Xbox gamertag is DragonMike0520.

Heya, there is nothing you need to change in the code, you can just copy paste it in your chat.
When its added you can use the command like:
!overwatch kd DragonMike-11914 pc
!overwatch kd DragonMike0520 xbox

Hope this helps, good Luck!

Yes but as the person above I wanted to make it so that in my stream when this command was made my chat wouldn't have to us my gamer tag or platform. They could just use something simple like !overwatch kd

Wooden Tiger said:
Yes but as the person above I wanted to make it so that in my stream when this command was made my chat wouldn't have to us my gamer tag or platform. They could just use something simple like !overwatch kd

Ah thats possible, however you will need to choose which platform you want to show, you cant use 2 accounts in a single command, or you would need to create 2 commands.

!commands add !overwatch -cd=5 -ul=everyone $(urlfetch https://2g.be/twitch/Overwatch/command/action=$(1)&format=$(provider)&user=$(user)&bot=nightbot&console=PLATFORMHERE&channel=$(channel)&defaultconsole=xbox&gamertag=USERNAMEHERE)

Change USERNAMEHERE to DragonMike-11914 or DragonMike0520 and PLATFORMHERE to pc/xbox in the command above. Now the command will always take the stats from that person.

First off I wanna say thank you for the trackers you have made they are amazing. I was wondering if there was a way with the Overwatch tracker to attach your account to a Gamertag like the Destiny tracker with "!destiny setplayer username console". Thanks!

Heya!
Short answer: Soon™
Long answer: The Overwatch command is a bit outdated and needs a few updates, however the !destiny code is even worse and a mess, so I'm rewriting that command first before the DLC drops. After that I'll have more time updating the other commands, and adding the setplayer function is on top of my to-do list.

I play on EU servers and i have played on US servers with friends a couple of times. And I have this weird bug on Overwatchtracker that pops my US account

Obviously the "right account" is on EU, but the US account doesnt seem to be updated (I'm level 51)

Now the problem with your commands : By default the commands seem to take the stats from my US account so it displays the wrong level when i type !overwatch lvl (it displays 38 so obviously from the US one)

Is there a way to tell the command to take the EU stats by default and not the US one ?

Sans_titre.png

Heya!
So first off all that bug seems weird, I'll ask the guys from Overwatchtracker what it is exactly (it shows lvl 51 for me now, but the blizzard error still pops up).

There is no way (yet) to set a default region, maybe in the future, but for now if you add '-eu' to your Battlenet (Yokiie-2447-eu) it will take the stats from the EU account.

Here you see an example, as you can see US is default, so the bottom 2 commands give the same result:
<img src='>

ca9480ee9142514b9c1ed3901fa2dd02.png

It seems like the Competitive command is only pulling from season 2 numbers, any way to make it pull season 1 or take the better value between the two?

Sugary Parrot said:
It seems like the Competitive command is only pulling from season 2 numbers, any way to make it pull season 1 or take the better value between the two?

The competitive command will always show stats from the current season, which is season 2 atm. Theres currently no way to show season 1 stats.

Hello Gerhard,
I've got the same problem: It only shows Season 1, not season 2.
Here you can see an example:
http://prntscr.com/d75mzx
(maybe it is kinda hard to see)

I hope you are still active does this Code work for europe to and does it wirklich for the psn stats

Active yes, Europe yes, PSN yes.
What are you confused about, if you need help let me know.

I added the command and It Shows !overwatch-cd=5 -ul=everyone Remote Server retuned Code 500

And for some reason i cant add commands threw the chat

@Able Octopus Can you post or screenshot the command you added, it looks like it's not added correctly.
What do you mean you cant add commands through chat? Did you disable the !commands command by any change (can be found under commands -> default)?

Great coding and project!

Works like a charm.

Only question I have is, how do I make sure it takes my EU profile by default and not US?

Hey there, thanks!

Gerhard said:
There is no way (yet) to set a default region, maybe in the future, but for now if you add '-eu' to your Battlenet (Yokiie-2447-eu) it will take the stats from the EU account.

As shown above setting a default region is not available yet. Soon you will able to link your Battletag to your Twitch username, hopefully this will make this a bit easier and more user friendly.

Awesome.

Thanks for the fast reply and keep up the good work!

I just made some changes to the !overwatch command, please see the start post. There's a new install command which should work better and I suggest people who use the old one to update.

New command: setplayer
Since typing the usernames can be a struggle (case sensitive, replacing stuff) use the new setplayer command, the command will link your Twitch username to your Overwatch account.
Usage: !overwatch setplayer xgerhard xbox

This also works for region specific accounts:
!overwatch setplayer xgerhad-1234-eu pc

After linking your account, you can just use the command without having to type your username:
xgerhard: !overwatch skillrating
Nightbot: [Dev] xgerhard: xgerhard's Skill Rating: 2.407 (#60.077, Top 23%).

If something did break, or if you have any questions please let me know 🙂

@Sassy Ox @Wooden Shrimp @Hazel Parrot

what do i put for channel for using ankhbot ?

that just gives me the error No valid channel given

edit nvm fixed it i wasnt writing pc after everything

Would there be a way to make it so that you would only have to type !overwatch? So rather than typing !overwatch skillrating it would just automatically do skillrating? I am currently using this: !commands add !overwatch -cd=5 -ul=everyone $(urlfetch https://2g.be/twitch/Overwatch/command/action=$(1)&format=$(provider)&user=$(user)&bot=nightbot&console=pc&channel=$(channel)&defaultconsole=xbox&gamertag=Blayed-11503&hideBnetID)

@Golden Frog Yeah thats possible, this command should work:
!commands add !overwatch -cd=5 -ul=everyone $(urlfetch https://2g.be/twitch/Overwatch/command/query=skillrating Blayed-11503 pc&hideBnetID)

i may be stupid but: how do i actually add these commands?

Hi, you can simply copy paste the command (starts with !commands add) in The start Post in your chat, after sending that message Nightbot Will add the command.

Hi all. Trying to help an OW streamer and am about to pull hairs out.

Right now for a streamer we've ran !addcom !overwatch skillrating and then alias'd "!overwatch" as "!rank" because we only need the rank aspect of the commands. But as it is "USERs Skill Rating: 0,000 [Rank] (#000, Top 1%)." is too cluttered for us and we'd like for it to only show the SR. I want to ask if there's anything I can add besides "&hideBnetID)" to achieve our goal of the !rank/!overwatch command to only show the SR?

Thank you for taking the time to read and help.

P.S. for further context the old !rank command(that i accidentally deleted) we used would auto update and only show the SR so I know it's possible but can't figure out how to get to that point.

You might have used a different command before, my command doesn't support that (yet). However this has been requested by a few people, so I will look into this soon.

Got it. Thanks for the reply and I hope your endeavors go well.

Hello! I really love this API, thank you for it. I was curious about if I was able to change the highlight color or not, though? When using Twitch's nightmode, the White-on-black (when it calls back to whichever user made the command), is a little harsh on the eyes.

Is there any way to allow for custom coloring?

Nightbot/customapi's have no control over twitch's coloring. That's on twitch's end.

Thank you for the speedy reply! Appreciate it.

Hello,
Would love to know if some of the new heroes work with this command?
For example Sombra or Orisa
If they do not, would you let me know when they will be added?

thanks,
PT

@Fair Chick Both champions should work, just put the champion name in front of the stat you would want to check, forexample: sombrakd, orisagames.

Hi there, is there a way to make this work with with streamlabs? I see the ankhbot command generator but it doesn't seem to be working with the new streamlabs. Anyways, great project! it would be awesome for a channel I mod on twitch <3

Heya since this is the Nightbot forums, would you mind contacting me on Twitter (@gerhardoh).

If I were to only want this to show one specific command (skill rating to be specific), how would I edit the link?

You replace the $(querystring) with the stat you want to show, do you want a command for a specific user, or just a command that people can check their skillrating?

Command for one specific user:
!commands add !skillrating -cd=5 -ul=everyone $(urlfetch https://2g.be/twitch/Overwatch/command/query=skillrating xgerhard xbox)
Usage: !skillrating
Nightbot: Skillrating is...

Command for people to check their skillrating:
!commands add !skillrating -cd=5 -ul=everyone $(urlfetch https://2g.be/twitch/Overwatch/command/query=skillrating%20$(querystring)&defaultconsole=xbox)
Usage: !skillrating xgerhard xbox
Nightbot Xgerhard's skillrating is...

@Gerhard

Is there a way to get "numbers only" from overwatch stats? right now, my command is:

$(urlfetch https://2g.be/twitch/Overwatch/command/query=skillrating%20NPC-XXXX%20pc&chan…)) on PC and $(urlfetch https://2g.be/twitch/Overwatch/command/query=skillrating%20Online-NPC%20ps&ch…)) on PS4"

and the output is messy.

[❤️] Online_NPC: NPC's Skill Rating: 2,202 [Gold] (No rank, Top 8%). on PC and [❤️] Online_NPC: Online-NPC's Skill Rating: 2,687 [Platinum] (No rank, Top 4%). on PS4

I'd like the command support a &numbersonly to output something clean like:

NPC's Rank is 2,202 [Gold] on PC and 2,687 [Platinum] on PS4.

Hiding the full ID of my PS4 account and all that other stuff except the numbers/medal-rank. (the rest of the text is pre-formatted in the command response.)

Heya, try adding &notext&hideRanks at the end of the url.

edit, forgot the ranks :)

Yo, is there a way that when viewers type for example !overwatch skillrating, that the skillrating of the streamer (me) is displayed, without typing the name?

Heya! Yes you can set the command to always use your name, this however will stop the users from tracking their own stats.

Example:
!commands add !overwatch -cd=5 -ul=everyone $(urlfetch https://2g.be/twitch/Overwatch/command/query=$(querystring) xgerhard xbox)

Replace xgerhard xbox with the desired username & platform. For every command you do now, the stats from that user will be shown.

Is the bot currently broken? I cant seem to get the command to work for any PC players...

It seems to work for me, however the data resource is a bit slow, I'll contact them. If a command fails (Error Connecting To Remote Server) and you wait a couple of seconds, it usually works instantly the second time you run it.

When ever I type my gamertag it doesn't work, I even went to there website to try it and linked my xbox account but it still isn't showing up. I am on EU if that means anything

Hiya, I would need your gamertag to see what's going on.

i have a little problem, i have used the command but i just says "Sorry, an error has occured, please try again." and ive tried it multiple times, refresh the site but it doesnt work.. what should i do?

Heya, could you send me your username / platform so I can debug what's going wrong, I tried a couple of accounts which seem to work fine.

Thank you, this should be resolved now! Can you try again?

Hello, I can't find my username or account on Overwatch tracker even after creating my account. My username is AskaRobz#2359 NA Canada PC. I have also a question, how do I implement a command only for my SR ? Thank you!

Can you try this:

This profile is private and we cannot refresh statistics. You can modify this setting in Overwatch under Options - Social, then restart Overwatch.

Once you can find your account on Overwatchtracker you can use the the !overwatch command.

Hello! Thank you it should work now. Do you know how to implement a command just for my sr ? Thank you 🙂

Thank you so much! So I managed to do it, but it seems the stats haven't been properly updated on the overwatch tracker website because my sr is currently 2677. Do you know what it could be caused by ? I tried updating them but it won't work... My profile is public as well.

Out of curiousity, have you thought about making something like this for Smite? Or would that be possible? There is a site known as smite.guru which has alot of the stats for people who do not hide their profiles, and would be nice if we could pull an active ELO from there.

Hiya, if the game offers a public API to retrieve data from the game then that would be possible!
However, I personally have not thought about making one for Smite. Since it takes time to setup and maintain I only have made these commands for games I play(ed) or am interested in.

There is one for people who don't hide their profiles and it is called Smite.guru, but I get that! No worries, wasn't sure if there was a general thing to have it based off of. Thanks!

Would the ones for overwatch and LoL be able to be edited for other games?
Im just not super confident on how to start from scratch on it!

Would it be possible to update the bot to include role specific SR? So users rank 0000 on tank, 0000 on DPS and 0000 on support? or have the possibility to set a specific role to pull the stats for?

Hiya, thanks for the suggestion. I dont think I have this data available, the only one Im able to see is the overall Skill rating.

Hiya mate, first of all, thanks for this post, I've found it very useful!

I'm wondering if there has been any movement on the individual SR per role support? I know that popular streamers like Kephrii have somehow managed it, but was wondering if a method had been found?

It shows individual sr on playoverwatch, can we draw it from there?

Hey, when I did what @Easy Lobster did it just returns, "Skill Rating: 0." My b-tag is zwqk#1943 and my disc is zwqk#0101. I'd appreciate if you could contact me there, not familiar with this website. 😃

Gerhard said:
After linking your account, you can just use the command without having to type your username:
xgerhard: !overwatch skillrating
Nightbot: [Dev] xgerhard: xgerhard’s Skill Rating: 2.407 (#60.077, Top 23%).

just curious, if u link your account like this, will u still be able to add a different name to check somebody else's and it just defaults to your linked account, or is it only ever going to work for the linked account?

Hiya, no updates sorry. Currently not active working on this project.

Didn't find your answer? The community is on Discord.

Ask on Discord