How to retrieve Overwatch stats through Nightbot

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)
  • 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: @Gerhardoh
Discord: xgerhard#2439

5 Likes

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.

1 Like

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?

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.

thank you very much :slight_smile: :slight_smile:

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.

1 Like

it appears to still have the numbers after it http://i.imgur.com/cHlWVK3.png, is this a matter of the website not having updated yet or a problem?

My bad, didn’t push it live yet, should be good now :wink:

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

This should be fixed now.

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

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.