[CustomAPI] Tom Clancy's Rainbow Six Siege API commands (unofficial!)

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!


How to add commands to Nightbot.

With chat:
"!commands add !command_name command_response"
or
"!addcom !command_name command_response"
With interface:
https://beta.nightbot.tv/commands/custom


Here’s what the response should contain for Nightbot to reply with your current rank:

$(urlfetch http://rainbowsix7nightbot.herokuapp.com/rainbowsix7.php?platform=YourPlatformHere&nick=YourNickHere&command=rank)
  • Adjust the URL parameters to fit your purposes.
  • ?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 &region= (NA, EU or ASIA) if you play on multiple regions with one account!
Use &region=$(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/

1 Like

Added APCu caching for login ticket and fixed Authorization failed - ticket expired | ticket required errors.

Endorsed by many RB6:Siege streamers.

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.

Hi can you please send me the code where people can search for their own ranks because i cant really figure it out

Thanks

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.

I dont really understand api so if you can please providecthe command

Is this how to do it
!addcom !rank $(urlfetch http://rainbowsix7nightbot.herokuapp.com/rainbowsix7.php?platform=?platform=$(1)&nick=$(2)=&command=rank)

I seem to have figured it out. I read it again and this is what worked for me
!addcom !rank $(urlfetch http://rainbowsix7nightbot.herokuapp.com/rainbowsix7.php?platform=$(1)&nick=$(2)&command=rank)

Thank you very much for your fast replying.

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.

Uplay had a recent internal error where you couldn’t login on the webpage which is crucial for fetching profile resources and this API.

The technical support forum shows that many threads were opened recently addressing login issues on the ubi webpage.
http://forums.ubi.com/forumdisplay.php/514-Technical-Support

It seems to be fixed now.

works fine now - thx for keeping us up2date
thx for your api script

Dont work, me write > Couldn’t find current standings! Maybe player isn’t ranked yet?

You probably were using an alternative gamer tag. Only PC players may be allowed to use their uplay nick.

If you are a console player you have to use the nick you created your account with ie. your first ever gamer tag that has no white spaces.

Even when you change your first nick ever: Ubisoft will always save that nick to refer to your account for internal scripting.

Please refer to the README.md on the projects GitHub page for common troubleshooting.

I use it for PC Player and i still get that “Maybe player isn’t ranked yet ?” after that recent update
can you help me or fix it ?

Velvet Shell fix

Fixed blank clearance level. (stats command)
Fixed time command (now displays casual + ranked time spent)
Fixed rank command (+ Velvet Shell rank changes)

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. :slight_smile: Points are correct though! :slight_smile:
I haven’t tested other ranks, I just know that there is this problem with platinum ranks…


This is the pic with the ranks if it helps you find it faster :slight_smile:
Thanks in advance!
KITTMaceWindu

Platinum rank fix.

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)

Enjoy,

Is the API down? The last couple of days I’m getting this response: Error Connecting To Remote Server