NightDev Community Forums

[CustomAPI] Tom Clancy’s Rainbow Six Siege API (not official)


Hi everyone, im Rui Oliveira (aka Hacklason/Hackerino), a newbie developer.

I wrote this PHP “API” that gets player’s data with r6tab API, filters the data for human readable text and forwards the results to Nightbot.

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 API.

This API will not save any data!

The source code is private for now, but I will release the code when it is organized and documented.


How to add commands to Nightbot

With chat:
!commands add !command_name command_response
or
!addcom !command_name command_response

With interface:
https://nightbot.tv/commands/custom


Here’s what you need to add to a Nightbot command to get your R6 Rank (current season):

With name:
$(urlfetch https://ruioliveira.xyz/r6api/playerdata.php?p_name=YourR6NameHere&platform=YourPlatformHere&region=YourRegionHere&command=rank)

With id:
$(urlfetch https://ruioliveira.xyz/r6api/playerdata.php?p_id=YourR6IdHere&platform=YourPlatformHere&region=YourRegionHere&command=rank)

Full command example:
!commands add !r6rank $(urlfetch https://ruioliveira.xyz/r6api/playerdata.php?p_name=YourR6NameHere&platform=YourPlatformHere&region=YourRegionHere&command=rank)

Output Example:
Region: EU | Rank: Gold IV | MMR: 2686 | Platform: UPLAY, Updated 21 hours ago, more info in https://r6tab.com/fbd7856f-2210-46a8-ae49-286aff3f2849

Output preview in twitch:

rankoutput

  • Adjust the URL parameters to fit your purposes.

  • ?platform= (xbox, ps4 or uplay.)
    xbox for Xbox One,
    ps4 for PS4,
    uplay for PC.

  • &region= (eu, na, as)
    eu for Europe,
    na for America,
    as for Asia.

  • &p_name=(Your nick on the specific platform)
    or
    &p_id=(Your player ID on the specific platform)

  • Specify a command after the &command= query parameter at the end of the URL in the $(urlfetch) method.
    rank for rank and mmr info,
    stats for level, win rate and K/D (Ranked),
    time for total playtime (Casual + Ranked).


Example of the commands outputs:

rank

Input example:
$(urlfetch https://ruioliveira.xyz/r6api/playerdata.php?p_name=Hacklason&platform=uplay&region=eu&command=rank)

Output Example:
Region: EU | Rank: Gold IV | MMR: 2686 | Platform: UPLAY, Updated 21 hours ago, more info in https://r6tab.com/fbd7856f-2210-46a8-ae49-286aff3f2849

Output preview in twitch:

Check image above

stats

Input example:
$(urlfetch https://ruioliveira.xyz/r6api/playerdata.php?p_name=Hacklason&platform=uplay&region=eu&command=stats)

Output Example:
Lv. 174 | 51.43% Win Rate | 1.06 K/D

Output preview in twitch:

Click Here

time

Input example:
$(urlfetch https://ruioliveira.xyz/r6api/playerdata.php?p_name=Hacklason&platform=uplay&region=eu&command=time)

Output Example:
510 hours, 13 minutes and 35 seconds

Output preview in twitch:

Click Here


Want any new feature? Contact me in discord: Hackerino#5731

2 Likes