Hey RB6: Siege Twitch streamers, I wrote a PHP script that uses the API statistics and gathers end-points of the rainbow6 profile page and forwards them to Nightbot. I deployed it on Heroku and it is ready to use by everyone!
This server-side script is making use of Nightbot’s dynamic response system (mostly $(urlfetch)) with which you are able to fetch the resources forwarded by my Heroku App.
Do not worry! Nothing is saved server-side.
This privat “API” is purely for “viewing” ressources!
?platform= (xbl, psn or uplay.) xbl for Xbox One, psn for PS4, uplay for PC.
&nick= (Your nick on the specific platform OR your profile ID.)
Specify a command after the &command= query parameter at the end of the URL in the $(urlfetch) method.
In the example above I specified “rank” as for the current rank in the current season.
Note:
You CAN write custom text before and after $(urlfetch) in the response!
Do NOT forget to close any opening parantheses ‘(’ with a closing ‘)’ at the end!
You can let the user search for a player themself by doing ?platform=$(1)&nick=$(2).
The user will have to put the platform and a nick as arguments separated by a space after your command.
List of commands you can specify after the &command= query parameter:
rank
Example output: "Platinum Ⅰ - matchmaking rating: 4465 「35 ᴍᴍʀ left for a rank promotion to Diamond ★ 」"
You can specify ®ion=(NA, EU or ASIA) if you play on multiple regions with one account!
Use ®ion=$(1) to allow viewers to input a region as second argument.
stats
Example output: “Lv.115 | 1.7 W/L ratio | 1.1 K/D ratio”
(Only ranked resources are used to calculate these values.)
time
Example output: “238h 38m 24s”
(time spent in multiplayer, ie. ranked + casual.)
If there is demand for other commands ie. statistics I will add more.
Common troubleshooting
Problem: Unable to fetch resources using gamer tags with spaces in the ‘nick=’ query parameter. Solution: Use the login nick you created your account with instead. (ie. your first nick ever.) Solution 2: Use your profileId which you can get from your profile URL at https://game-rainbow6.ubi.com/
I use this API in our Twitch channel but some of the viewers are having trouble viewing their rank if they have spaces in their xbox live gamertag, ie viewer types !myrank xbl its derpy queen. I think the api doesn’t recognize the spaces that many xbox live gamertags have. Is there a way that I can fix this for the viewers?
space are not allowed in the uplay client as far as I know. If you already tried %20 try an underscore. ( Awesome Name => Awesome_Name ) They must be replacing the space with something else internally.
If underscore doesn’t work then the gametag is not the nick you should be using. There must be a ‘login nick’ or something you created the uplay account with. For example, I created an account with “N3kr3s” and changed the gamertag to “Fairfight_Pls”. However, I noticed (while sniffing out the profile page) that the first ever account name won’t be removed ever. It is still used as reference for fetching resources and describing my profile internally.
Arguments ie. command parameters are separated by spaces.
Example.
!myCommand argument argument2 argument3
Bots with a dynamic custom command system can interpret spaces between words as multiple arguments. Nightbot catches those if you input $(number)
So $(1) catches the word after the first space after the command. $(2) after the space after $(1). The $(3) after the $(2) and so on. Just input it where you’d put your platform, nick or region in the URL query parameters accordingly.
It’s written in the first post. Please read carefully.
hey Nekres
please contant me on twitch username mirculix - you script is not working anymore
got error: Error Connecting To Remote Server
please HAAAAAALLLLPPPP
I am also receiving a message saying “Error Connecting To Remote Server” whenever I try to use the command for R6 in my twitch chat. It has been working fine for a few months, but now all of a sudden it has stopped working.
Hey Nekres,
I’m currently rank Platinum III but your API shows that i’m Plat IV. There has never been a rank “platinum IV” in the game so you might wanna update it as soon as you have time for it. Points are correct though!
I haven’t tested other ranks, I just know that there is this problem with platinum ranks…
Was waiting for someone to alert me if any of the ranks are wrong. Did the table of ranks on my vacation with only the knowledge of them starting from IV after the Velvet Shell patch. I corrected Platinum accordingly.
Source code is available here. (Table of ranks at line 127-131)