1.0.0 • Published 3 years ago

r6s-api v1.0.0

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
3 years ago

Ubi Siege API Wrapper

https://www.npmjs.com/package/r6s-api

notes:

  • user defined params are prefixed with an @
  • CSL means comma-seperated list
    • Example: "4bf2232d-7e8e-4454-a781-b6e48d1b1d56,24476c3c-cf5b-43ee-9a52-e9b7b0588b9a"
      • Or: "shroud,MacieJay"
  • xbl is XBL with lowercase like XBOX Live, not XB1 like XBOX One

Example:

var r6api = require('r6s-api');


var email = "@user_email";
var password = "@password";


UbiAPI.login(email, password, function(res){
  //console.log(res);
});


var usernames, platform, mode, ids, season, stats;


//Search users by nick
usernames = "shroud,Maciejay";
platform = "uplay"; // uplay, psn, xbl
mode = "bynick"; // OR 1

UbiAPI.searchUser(email, password, usernames, platform, mode, function(res){
  console.log("Bynick: \n", res);
})


//Search users by id
ids = "4bf2232d-7e8e-4454-a781-b6e48d1b1d56,24476c3c-cf5b-43ee-9a52-e9b7b0588b9a";
platform = "uplay"; // uplay, psn, xbl
mode = "byid"; // OR 2

UbiAPI.searchUser(email, password, ids, platform, mode, function(res){
  console.log("Byid: \n", res);
})



//getRanking
ids = "4bf2232d-7e8e-4454-a781-b6e48d1b1d56,24476c3c-cf5b-43ee-9a52-e9b7b0588b9a";
platform = "uplay"; // uplay, psn, xbl
region = "emea"; // emea, ncsa, apac
season = -1; // őő fasztudja még

UbiAPI.getRanking(email, password, ids, platform, region, season, function(res){
  console.log("getRanking: \n", res);
})



//getStats
ids = "4bf2232d-7e8e-4454-a781-b6e48d1b1d56,24476c3c-cf5b-43ee-9a52-e9b7b0588b9a";
//ids = "shroud";
platform = "uplay"; // uplay, psn, xbl
stats = "rankedpvp_death,rankedpvp_kills,rankedpvp_kdratio,rankedpvp_matchlost,rankedpvp_matchplayed,rankedpvp_matchwlratio,rankedpvp_matchwon";

UbiAPI.getStats(email, password, ids, platform, stats, function(res){
  console.log("getStats: \n", res);
})



//getLevel
ids = "4bf2232d-7e8e-4454-a781-b6e48d1b1d56,24476c3c-cf5b-43ee-9a52-e9b7b0588b9a";
platform = "uplay"; // uplay, psn, xbl

UbiAPI.getLevel(email, password, ids, platform, function(res){
  console.log("getLevel: \n", res);
})

Explanation:

var email = "@user_email";
var password = "@password";
  • @user_email: uplay account
  • @password: uplay password

There is no practical use for the login() function, can only be used to verify the login informations.

searchUser()

  • params:
    • userIdList: could be a CLS of player ids or a CLS of usernames
    • platform: uplay, psn and xbl
    • mode: 1 or bynick for usernames, 2 or byid for player ids
    • uTicket: the ubisoft ticket that the login() function returns
  • example response:
{
     "profiles": [
         {
             "profileId": "ccd28cc4-845e-4726-8cf8-e2cac4de82a2",
             "userId": "ccd28cc4-845e-4726-8cf8-e2cac4de82a2",
             "platformType": "uplay",
             "idOnPlatform": "CCD28CC4-845E-4726-8CF8-E2CAC4DE82A2",
             "nameOnPlatform": "NaughtyMuppet"
         }
     ]
 }
  • notes:
    • userId is unique per account
    • when getting a profile by userId it also returns connected accounts

getStats()

  • params:
    • userIdList: could be a CLS of player ids or a CLS of usernames
    • platform: uplay, psn and xbl
    • stats: stats CSL of stats (you can also find these in the statistics.json)
  • example response:
{
    "results": {
        "1b50085a-8a20-4ce6-b75f-db6a00e4d718": {
            "casualpvp_matchwon": 1477,
            "rankedpvp_timeplayed": 496448,
            "rankedpvp_matchlost": 92,
            "casualpvp_matchlost": 491,
            "rankedpvp_death": 1447,
            "casualpvp_timeplayed": 1516832,
            "rankedpvp_matchwon": 322,
            "rankedpvp_kills": 1405,
            "casualpvp_matchplayed": 1968,
            "casualpvp_death": 4378,
            "rankedpvp_matchplayed": 414,
            "casualpvp_kills": 5621
        }
    }
}

getRanking()

  • params:
    • userIdList: could be a CLS of player ids or a CLS of usernames
    • platform: uplay, psn and xbl
    • region: emea, ncsa or apac
    • season: -1 for current season, -2 for the previous, -3 for before the previous etc. You can also use an incrementing integer (y2s2 is 5)
  • example response:
{
    "players": {
        "1b50085a-8a20-4ce6-b75f-db6a00e4d718": {
            "board_id": "pvp_ranked",
            "past_seasons_abandons": 0,
            "update_time": "2018-01-21T19:26:44.440000+00:00",
            "skill_mean": 43.1754432515,
            "abandons": 0,
            "season": 8,
            "region": "emea",
            "profile_id": "1b50085a-8a20-4ce6-b75f-db6a00e4d718",
            "past_seasons_losses": 21,
            "max_mmr": 4387.00039284,
            "mmr": 4317.54432515,
            "wins": 23,
            "skill_stdev": 6.44806717385,
            "rank": 19,
            "losses": 6,
            "next_rank_mmr": 4500.0,
            "past_seasons_wins": 53,
            "previous_rank_mmr": 4100.0,
            "max_rank": 19
        }
    }
}

getLevel()

  • params:
    • userIdList: could be a CLS of player ids or a CLS of usernames
    • platform: uplay, psn and xbl
  • example response:
{
    "player_profiles": [
        {
            "xp": 5858,
            "profile_id": "09ef2790-ee5a-4909-b9dc-4e4042dbed7d",
            "lootbox_probability": 4150,
            "level": 284
        }
    ]
}

The 'assets' endpoints do not require any session or authentication.

This is kinda weird, but I don't know if Ubi will change the endpoints because 'operators.a45bd7c1.json' endpoints look like some kind of version or commit ids, so these are not hard coded instead stored in the 'config.js' file thereby it's easy to change it anytime.

assets.operators()

  • no params
  • example response:
  You can find it in responses/operators.json

assets.weapons()

  • no params
  • example response:
  You can find it in responses/weapons.json

assets.ranks()

  • no params
  • example response:
  You can find it in responses/ranks.json

assets.seasons()

  • no params
  • example response:
  You can find it in responses/seasons.json
0.0.5

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

2.1.4

4 years ago

2.1.3

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

5 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

3 years ago