r6-data.js 1.3.5 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -0
- package/index.js +4 -0
- package/methods/getGameStats.js +29 -0
- package/methods/getSeasonalStats.js +39 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -133,6 +133,135 @@ You can filter these statistics by game mode using the `board_id` parameter:
|
|
|
133
133
|
- `standard`: Statistics for standard matches
|
|
134
134
|
- `ranked`: Statistics for ranked competitive matches
|
|
135
135
|
|
|
136
|
+
|
|
137
|
+
## Getting Seasonal Statistics
|
|
138
|
+
|
|
139
|
+
The `getSeasonalStats()` function allows you to get detailed rank points history and seasonal progression for a specific player in the current season. Includes timestamp, rank information, RP values, and rank images
|
|
140
|
+
|
|
141
|
+
```javascript
|
|
142
|
+
const r6Info = require('r6-data.js');
|
|
143
|
+
|
|
144
|
+
async function main() {
|
|
145
|
+
try {
|
|
146
|
+
// Get seasonal statistics for a player
|
|
147
|
+
const seasonalStats = await r6Info.getSeasonalStats({
|
|
148
|
+
nameOnPlatform: 'PlayerName',
|
|
149
|
+
platformType: 'uplay'
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
console.log('Seasonal statistics:', seasonalStats);
|
|
153
|
+
return seasonalStats;
|
|
154
|
+
|
|
155
|
+
} catch (error) {
|
|
156
|
+
console.error('Error retrieving seasonal statistics:', error.message);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
main();
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Parameters
|
|
164
|
+
|
|
165
|
+
The `getSeasonalStats()` function accepts an object with the following parameters:
|
|
166
|
+
|
|
167
|
+
- `nameOnPlatform`: (Required) The player's name on the platform
|
|
168
|
+
- `platformType`: (Required) The platform type - "uplay", "psn", or "xbl"
|
|
169
|
+
|
|
170
|
+
### Seasonal Statistics Response
|
|
171
|
+
|
|
172
|
+
```javascript
|
|
173
|
+
{
|
|
174
|
+
"data": {
|
|
175
|
+
"history": {
|
|
176
|
+
"metadata": {
|
|
177
|
+
"key": "RankPoints",
|
|
178
|
+
"name": "Rank Points",
|
|
179
|
+
"description": null
|
|
180
|
+
},
|
|
181
|
+
"data": [
|
|
182
|
+
[
|
|
183
|
+
"2025-10-14T21:43:27.315+00:00",
|
|
184
|
+
{
|
|
185
|
+
"displayName": "Rank Points",
|
|
186
|
+
"metadata": {
|
|
187
|
+
"rank": "PLATINUM II",
|
|
188
|
+
"imageUrl": "https://r6data.eu/assets/img/r6_ranks_img/platinum-2.webp",
|
|
189
|
+
"color": "#44ccc2"
|
|
190
|
+
},
|
|
191
|
+
"value": 3300,
|
|
192
|
+
"displayValue": "3,300",
|
|
193
|
+
"displayType": "Number"
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
[
|
|
197
|
+
"2025-10-14T21:12:55.821+00:00",
|
|
198
|
+
{
|
|
199
|
+
"displayName": "Rank Points",
|
|
200
|
+
"metadata": {
|
|
201
|
+
"rank": "PLATINUM II",
|
|
202
|
+
"imageUrl": "https://r6data.eu/assets/img/r6_ranks_img/platinum-2.webp",
|
|
203
|
+
"color": "#44ccc2"
|
|
204
|
+
},
|
|
205
|
+
"value": 3302,
|
|
206
|
+
"displayValue": "3,302",
|
|
207
|
+
"displayType": "Number"
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
]
|
|
211
|
+
},
|
|
212
|
+
"leaderboard": null,
|
|
213
|
+
"expiryDate": "0001-01-01T00:00:00+00:00",
|
|
214
|
+
"bestMatches": null
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Getting Game Statistics
|
|
219
|
+
|
|
220
|
+
The `getGameStats()` function allows you to get real-time player count statistics across all platforms including Steam, Ubisoft Connect, PlayStation, Xbox, and total player counts
|
|
221
|
+
|
|
222
|
+
```javascript
|
|
223
|
+
const r6Info = require('r6-data.js');
|
|
224
|
+
|
|
225
|
+
async function main() {
|
|
226
|
+
try {
|
|
227
|
+
// Get general game statistics
|
|
228
|
+
const gameStats = await r6Info.getGameStats();
|
|
229
|
+
|
|
230
|
+
console.log('Game statistics:', gameStats);
|
|
231
|
+
return gameStats;
|
|
232
|
+
|
|
233
|
+
} catch (error) {
|
|
234
|
+
console.error('Error retrieving game statistics:', error.message);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
main();
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Game Statistics Response
|
|
242
|
+
```javascript
|
|
243
|
+
{
|
|
244
|
+
"steam": {
|
|
245
|
+
"concurrent": 33631,
|
|
246
|
+
"estimate": 33631
|
|
247
|
+
},
|
|
248
|
+
"crossPlatform": {
|
|
249
|
+
"totalRegistered": 85000000,
|
|
250
|
+
"monthlyActive": 15300000,
|
|
251
|
+
"trendsEstimate": 175666,
|
|
252
|
+
"platforms": {
|
|
253
|
+
"pc": 6885000,
|
|
254
|
+
"playstation": 5355000,
|
|
255
|
+
"xbox": 3060000
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"ubisoft": {
|
|
259
|
+
"onlineEstimate": 127739
|
|
260
|
+
},
|
|
261
|
+
"lastUpdated": "2025-10-15T22:39:38.636Z"
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
136
265
|
## Creating Discord Webhooks for R6 Stats
|
|
137
266
|
|
|
138
267
|
The `createDiscordR6Webhook()` function allows you to send Rainbow Six Siege player statistics directly to a Discord channel using webhooks. This creates formatted embeds with player stats that can be customized with various options.
|
|
@@ -435,6 +564,8 @@ main();
|
|
|
435
564
|
7. Filtering operators by date of birth using the `date_of_birth` parameter.
|
|
436
565
|
8. Filtering operators by season introduced using the `season_introduced` parameter.
|
|
437
566
|
|
|
567
|
+
You can get the operator url icon via r6Info.getOperators(), is in the json response.
|
|
568
|
+
|
|
438
569
|
## Getting Season Information
|
|
439
570
|
|
|
440
571
|
The `getSeasons()` function allows you to retrieve information about the seasons in Rainbow Six Siege. You can get a list of all seasons or filter the seasons based on specific criteria. Here's an example of how to use the `getSeasons()` function:
|
package/index.js
CHANGED
|
@@ -11,6 +11,8 @@ const getSearchAll = require('./methods/getSearchAll');
|
|
|
11
11
|
const getAccountInfo = require('./methods/getAccountInfo');
|
|
12
12
|
const getPlayerStats = require('./methods/getPlayerStats');
|
|
13
13
|
const createDiscordR6Webhook = require('./methods/createDiscordR6Webhook');
|
|
14
|
+
const getGameStats = require('./methods/getGameStats');
|
|
15
|
+
const getSeasonalStats = require('./methods/getSeasonalStats');
|
|
14
16
|
|
|
15
17
|
const r6Data = {
|
|
16
18
|
getMaps,
|
|
@@ -26,6 +28,8 @@ const r6Data = {
|
|
|
26
28
|
getAccountInfo,
|
|
27
29
|
getPlayerStats,
|
|
28
30
|
createDiscordR6Webhook,
|
|
31
|
+
getGameStats,
|
|
32
|
+
getSeasonalStats,
|
|
29
33
|
};
|
|
30
34
|
|
|
31
35
|
module.exports = r6Data;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const axiosInstance = require('../axiosInstance/axiosInstance');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Get Rainbow Six Siege game stats for all platform
|
|
5
|
+
* @returns {Promise<Object>} - Game stats for all platform
|
|
6
|
+
*/
|
|
7
|
+
async function getGameStats() {
|
|
8
|
+
try {
|
|
9
|
+
|
|
10
|
+
// Build the URL with parameters
|
|
11
|
+
const params = {
|
|
12
|
+
type: 'gameStats'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const url = buildUrlAndParams('/stats', params);
|
|
16
|
+
|
|
17
|
+
const response = await axiosInstance.get(url);
|
|
18
|
+
|
|
19
|
+
return response.data;
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.error('Error during the game stats request:', error.message);
|
|
22
|
+
if (error.response && error.response.status === 401) {
|
|
23
|
+
throw new Error('request error');
|
|
24
|
+
}
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = getGameStats;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const axiosInstance = require('../axiosInstance/axiosInstance');
|
|
2
|
+
const buildUrlAndParams = require('./util');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Get Rainbow Six Siege player stats for current season
|
|
6
|
+
* @param {Object} params - Parameters for the request
|
|
7
|
+
* @param {string} params.nameOnPlatform - Player name on the platform
|
|
8
|
+
* @param {string} params.platformType - Platform type (uplay, psn, xbl)
|
|
9
|
+
* @returns {Promise<Object>} - Player stats for current season
|
|
10
|
+
*/
|
|
11
|
+
async function getSeasonalStats({ nameOnPlatform, platformType } = {}) {
|
|
12
|
+
try {
|
|
13
|
+
// Validate required parameters
|
|
14
|
+
if (!nameOnPlatform || !platformType) {
|
|
15
|
+
throw new Error('Missing required parameters: nameOnPlatform, platformType');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Build the URL with parameters
|
|
19
|
+
const params = {
|
|
20
|
+
type: 'seasonalStats',
|
|
21
|
+
nameOnPlatform,
|
|
22
|
+
platformType
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const url = buildUrlAndParams('/stats', params);
|
|
26
|
+
|
|
27
|
+
const response = await axiosInstance.get(url);
|
|
28
|
+
|
|
29
|
+
return response.data;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error('Error during the getSeasonalStats request:', error.message);
|
|
32
|
+
if (error.response && error.response.status === 401) {
|
|
33
|
+
throw new Error('Authentication error');
|
|
34
|
+
}
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = getSeasonalStats;
|
package/package.json
CHANGED