-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Vince edited this page Dec 18, 2020
·
15 revisions
A simple API that fetches player statistics from Ubisoft's Rainbow Six website. I tried to make the API as intuitive as possible; let me know if you have any questions/bugs.
All of the objects have methods that must be called sequentially. Each method builds upon the other's response. This means you have to put your code inside of an async
function and use await
.
//if you're using from github
const r6api = require('./api.js');
//if you're using from npm
const r6api = require('@vince144/r6-api');
var email = 'aValidEmail';
var password = 'aValidPassword';
var platform = 'uplay';
var username = 'aValidUsernameToLookup';
//creates an account
var account = r6api.createAccount(email, password, platform);
//Neon Dawn is technically '1' in Ubi's request structure
var season = '1';
//sequential requests
async function print() {
let session = await r6api.createSession(account).catch(e => { console.error(e) });
let player = await r6api.createPlayer(username, platform, session).catch(e => { console.error(e) });
let neonDawnStats = await r6api.getStats(player, session, season).catch(e => { console.error(e) });
console.log(neonDawnStats);
}
print();