r6-data.js 1.8.3 → 2.0.1

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 CHANGED
@@ -1,100 +1,116 @@
1
- # r6-data.js — R6 Rainbow Six Siege API Wrapper
2
-
3
- **Rainbow Six Siege (R6) API wrapper** - Get player stats, operators, maps, ranks, seasons, charms and more. Full TypeScript support included. Last updated Y10S4
4
-
5
- <div align="center">
6
- <p>
7
- <a href="https://github.com/mazeor9/r6-data.js/releases/latest">
8
- <img src="https://img.shields.io/github/v/release/mazeor9/r6-data.js?style=for-the-badge" alt="GitHub release (latest SemVer)" /></a>
9
- <a href="https://github.com/mazeor9/r6-data.js/releases/latest">
10
- <img src="https://img.shields.io/github/release-date/mazeor9/r6-data.js?label=latest%20release&style=for-the-badge" alt="Latest release" /></a>
11
- <a href="https://www.npmjs.com/package/r6-data.js"><img src="https://img.shields.io/npm/v/r6-data.js.svg?logo=npm&style=for-the-badge" alt="npm version" /></a>
12
- <a href="https://www.npmjs.com/package/r6-data.js"><img src="https://img.shields.io/npm/dt/r6-data.js.svg?style=for-the-badge" alt="NPM downloads" /></a>
13
- </p>
14
- </div>
15
-
16
- ## Installation
17
-
18
- ```sh
19
- npm i r6-data.js
20
- ```
21
-
22
- ## R6Data Website for stats and API
23
-
24
- Website where you can directly track your stats and also check the all infos that gives r6-data.js. Entire website is based on r6-data.js.
25
-
26
- Visit the official website: **[r6data.eu](https://r6data.eu/)**
27
-
28
- ## TypeScript Support
29
-
30
- Full TypeScript support with complete type definitions and IntelliSense.
31
-
32
- ```typescript
33
- // ES6 imports
34
- import * as r6 from 'r6-data.js';
35
- import { getAccountInfo, AccountInfoParams, PlatformType } from 'r6-data.js';
36
-
37
- // Usage with types
38
- const params: AccountInfoParams = {
39
- nameOnPlatform: 'PlayerName',
40
- platformType: 'uplay' as PlatformType
41
- };
42
-
43
- const accountInfo = await r6.getAccountInfo(params);
44
- ```
45
-
46
- ```javascript
47
- // CommonJS (still supported)
48
- const r6 = require('r6-data.js');
49
-
50
- const accountInfo = await r6.getAccountInfo({
51
- nameOnPlatform: 'PlayerName',
52
- platformType: 'uplay'
53
- });
54
- ```
55
-
56
- ## Getting Player Account Information
57
-
58
- The `getAccountInfo()` function allows you to retrieve player profile data from the official Rainbow Six Siege API. This function is specifically designed for retrieving account information such as player level, experience, clearance level, and profile settings.
59
-
60
- ```javascript
61
- const r6Info = require('r6-data.js');
62
-
63
- async function main() {
64
- try {
65
- // Get player account information
66
- const accountInfo = await r6Info.getAccountInfo({
67
- nameOnPlatform: 'PlayerName',
68
- platformType: 'uplay'
69
- });
70
-
71
- console.log('Account information:', accountInfo);
72
- return accountInfo;
73
-
74
- } catch (error) {
75
- console.error('Error retrieving account information:', error.message);
76
- }
77
- }
78
-
79
- main();
80
- ```
81
-
82
- ### Parameters
83
-
84
- The `getAccountInfo()` function accepts an object with the following parameters:
85
-
86
- - `nameOnPlatform`: (Required) The player's name on the platform
87
- - `platformType`: (Required) The platform type - "uplay", "psn", or "xbl"
88
-
89
- ### Account Information Response
90
- When using `getAccountInfo()`, you'll receive data about the player's profile, including:
91
-
92
- - Player level and experience
93
- - Clearance level
94
- - Achievement status
95
- - Play time statistics
96
- - Player profile settings and customization
97
-
1
+ # r6-data.js — R6 Rainbow Six Siege API Wrapper
2
+
3
+ **Rainbow Six Siege (R6) API wrapper** - Get player stats, operators, maps, ranks, seasons, charms and more. Full TypeScript support included. Last updated Y10S4
4
+
5
+ <div align="center">
6
+ <p>
7
+ <a href="https://github.com/mazeor9/r6-data.js/releases/latest">
8
+ <img src="https://img.shields.io/github/v/release/mazeor9/r6-data.js?style=for-the-badge" alt="GitHub release (latest SemVer)" /></a>
9
+ <a href="https://github.com/mazeor9/r6-data.js/releases/latest">
10
+ <img src="https://img.shields.io/github/release-date/mazeor9/r6-data.js?label=latest%20release&style=for-the-badge" alt="Latest release" /></a>
11
+ <a href="https://www.npmjs.com/package/r6-data.js"><img src="https://img.shields.io/npm/v/r6-data.js.svg?logo=npm&style=for-the-badge" alt="npm version" /></a>
12
+ <a href="https://www.npmjs.com/package/r6-data.js"><img src="https://img.shields.io/npm/dt/r6-data.js.svg?style=for-the-badge" alt="NPM downloads" /></a>
13
+ </p>
14
+ </div>
15
+
16
+ ## Installation
17
+
18
+ ```sh
19
+ npm i r6-data.js
20
+ ```
21
+
22
+ ## API Key
23
+
24
+ > **Notice:** Due to the abuse of the available APIs, it has been decided that from now on, in order to use both the package and the APIs, it is necessary to register on the website and create an API key.
25
+
26
+ To use this package, you need an **API Key**.
27
+ You can obtain your API Key by registering on the official website: **[r6data.eu](https://r6data.eu/)**.
28
+ Once registered, you can generate your personal API Key from your account settings.
29
+
30
+ **Note:** This API Key must be passed as the first argument to all `get` methods.
31
+
32
+ ## R6Data Website for stats and API
33
+
34
+ Website where you can directly track your stats and also check the all infos that gives r6-data.js. Entire website is based on r6-data.js.
35
+
36
+ Visit the official website: **[r6data.eu](https://r6data.eu/)**
37
+
38
+ ## TypeScript Support
39
+
40
+ Full TypeScript support with complete type definitions and IntelliSense.
41
+
42
+ ```typescript
43
+ // ES6 imports
44
+ import * as r6 from 'r6-data.js';
45
+ import { getAccountInfo, AccountInfoParams, PlatformType } from 'r6-data.js';
46
+
47
+ const apiKey = 'YOUR_API_KEY';
48
+
49
+ // Usage with types
50
+ const params: AccountInfoParams = {
51
+ nameOnPlatform: 'PlayerName',
52
+ platformType: 'uplay' as PlatformType
53
+ };
54
+
55
+ const accountInfo = await r6.getAccountInfo(apiKey, params);
56
+ ```
57
+
58
+ ```javascript
59
+ // CommonJS (still supported)
60
+ const r6 = require('r6-data.js');
61
+ const apiKey = 'YOUR_API_KEY';
62
+
63
+ const accountInfo = await r6.getAccountInfo(apiKey, {
64
+ nameOnPlatform: 'PlayerName',
65
+ platformType: 'uplay'
66
+ });
67
+ ```
68
+
69
+ ## Getting Player Account Information
70
+
71
+ The `getAccountInfo()` function allows you to retrieve player profile data from the official Rainbow Six Siege API. This function is specifically designed for retrieving account information such as player level, experience, clearance level, and profile settings.
72
+
73
+ ```javascript
74
+ const r6Info = require('r6-data.js');
75
+
76
+ async function main() {
77
+ try {
78
+ const apiKey = 'YOUR_API_KEY';
79
+
80
+ // Get player account information
81
+ const accountInfo = await r6Info.getAccountInfo(apiKey, {
82
+ nameOnPlatform: 'PlayerName',
83
+ platformType: 'uplay'
84
+ });
85
+
86
+ console.log('Account information:', accountInfo);
87
+ return accountInfo;
88
+
89
+ } catch (error) {
90
+ console.error('Error retrieving account information:', error.message);
91
+ }
92
+ }
93
+
94
+ main();
95
+ ```
96
+
97
+ ### Parameters
98
+
99
+ The `getAccountInfo()` function accepts the API Key and an object with the following parameters:
100
+
101
+ - `apiKey`: (Required) Your API Key from r6data.eu
102
+ - `nameOnPlatform`: (Required) The player's name on the platform
103
+ - `platformType`: (Required) The platform type - "uplay", "psn", or "xbl"
104
+
105
+ ### Account Information Response
106
+ When using `getAccountInfo()`, you'll receive data about the player's profile, including:
107
+
108
+ - Player level and experience
109
+ - Clearance level
110
+ - Achievement status
111
+ - Play time statistics
112
+ - Player profile settings and customization
113
+
98
114
  ## Getting Player Ban Status
99
115
 
100
116
  The `getIsBanned()` function allows you to check if a player is currently banned from Rainbow Six Siege.
@@ -104,8 +120,10 @@ const r6Info = require('r6-data.js');
104
120
 
105
121
  async function main() {
106
122
  try {
123
+ const apiKey = 'YOUR_API_KEY';
124
+
107
125
  // Check if player is banned
108
- const banStatus = await r6Info.getIsBanned({
126
+ const banStatus = await r6Info.getIsBanned(apiKey, {
109
127
  nameOnPlatform: 'PlayerName',
110
128
  platformType: 'uplay'
111
129
  });
@@ -123,738 +141,763 @@ main();
123
141
 
124
142
  ### Parameters
125
143
 
126
- The `getIsBanned()` function accepts an object with the following parameters:
144
+ The `getIsBanned()` function accepts the API Key and an object with the following parameters:
127
145
 
146
+ - `apiKey`: (Required) Your API Key from r6data.eu
128
147
  - `nameOnPlatform`: (Required) The player's name on the platform
129
148
  - `platformType`: (Required) The platform type - "uplay", "psn", or "xbl"
130
149
 
131
150
  ### Ban Status Response
132
151
  When using `getIsBanned()`, you'll receive data indicating the player's ban status.
133
152
 
134
- ## Getting Player Statistics
135
-
136
- The `getPlayerStats()` function allows you to retrieve detailed gameplay statistics from the official Rainbow Six Siege API. This function is specifically designed for retrieving player performance data across different game modes.
137
-
138
- ```javascript
139
- const r6Info = require('r6-data.js');
140
-
141
- async function main() {
142
- try {
143
- // Get player statistics
144
- const playerStats = await r6Info.getPlayerStats({
145
- nameOnPlatform: 'PlayerName',
146
- platformType: 'uplay',
147
- platform_families: 'pc'
148
- });
149
-
150
- console.log('Player statistics:', playerStats);
151
- return playerStats;
152
-
153
- // Get player statistics for ranked mode only
154
- const rankedStats = await r6Info.getPlayerStats({
155
- nameOnPlatform: 'PlayerName',
156
- platformType: 'uplay',
157
- platform_families: 'pc',
158
- board_id: 'ranked'
159
- });
160
-
161
- console.log('Ranked statistics:', rankedStats);
162
- return rankedStats;
163
-
164
- } catch (error) {
165
- console.error('Error retrieving player statistics:', error.message);
166
- }
167
- }
168
-
169
- main();
170
- ```
171
-
172
- ### Parameters
173
-
174
- The `getPlayerStats()` function accepts an object with the following parameters:
175
-
176
- - `nameOnPlatform`: (Required) The player's name on the platform
177
- - `platformType`: (Required) The platform type - "uplay", "psn", or "xbl"
178
- - `platform_families`: (Required) The platform family - "pc" or "console"
179
- - `board_id`: (Optional) The game mode to filter statistics - "casual", "event", "warmup", "standard", or "ranked"
180
-
181
- ### Player Statistics Response
182
- When using `getPlayerStats()`, you'll receive detailed gameplay statistics, including:
183
-
184
- - Rank information
185
- - MMR (Matchmaking Rating)
186
- - Win/loss records
187
- - Seasonal performance data
188
- - Skill metrics across different gameplay modes
189
-
190
- You can filter these statistics by game mode using the `board_id` parameter:
191
-
192
- - `casual`: Statistics for casual matches
193
- - `event`: Statistics for limited-time events
194
- - `warmup`: Statistics for warmup matches
195
- - `standard`: Statistics for standard matches
196
- - `ranked`: Statistics for ranked competitive matches
197
-
198
-
199
- ## Getting Seasonal Statistics
200
-
201
- 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
202
-
203
- ```javascript
204
- const r6Info = require('r6-data.js');
205
-
206
- async function main() {
207
- try {
208
- // Get seasonal statistics for a player
209
- const seasonalStats = await r6Info.getSeasonalStats({
210
- nameOnPlatform: 'PlayerName',
211
- platformType: 'uplay'
212
- });
213
-
214
- console.log('Seasonal statistics:', seasonalStats);
215
- return seasonalStats;
216
-
217
- } catch (error) {
218
- console.error('Error retrieving seasonal statistics:', error.message);
219
- }
220
- }
221
-
222
- main();
223
- ```
224
-
225
- ### Parameters
226
-
227
- The `getSeasonalStats()` function accepts an object with the following parameters:
228
-
229
- - `nameOnPlatform`: (Required) The player's name on the platform
230
- - `platformType`: (Required) The platform type - "uplay", "psn", or "xbl"
231
-
232
- ### Seasonal Statistics Response
233
-
234
- ```javascript
235
- {
236
- "data": {
237
- "history": {
238
- "metadata": {
239
- "key": "RankPoints",
240
- "name": "Rank Points",
241
- "description": null
242
- },
243
- "data": [
244
- [
245
- "2025-10-14T21:43:27.315+00:00",
246
- {
247
- "displayName": "Rank Points",
248
- "metadata": {
249
- "rank": "PLATINUM II",
250
- "imageUrl": "https://r6data.eu/assets/img/r6_ranks_img/platinum-2.webp",
251
- "color": "#44ccc2"
252
- },
253
- "value": 3300,
254
- "displayValue": "3,300",
255
- "displayType": "Number"
256
- }
257
- ],
258
- [
259
- "2025-10-14T21:12:55.821+00:00",
260
- {
261
- "displayName": "Rank Points",
262
- "metadata": {
263
- "rank": "PLATINUM II",
264
- "imageUrl": "https://r6data.eu/assets/img/r6_ranks_img/platinum-2.webp",
265
- "color": "#44ccc2"
266
- },
267
- "value": 3302,
268
- "displayValue": "3,302",
269
- "displayType": "Number"
270
- }
271
- ]
272
- ]
273
- },
274
- "leaderboard": null,
275
- "expiryDate": "0001-01-01T00:00:00+00:00",
276
- "bestMatches": null
277
- }
278
- ```
279
-
280
- ## Getting Game Statistics
281
-
282
- 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
283
-
284
- ```javascript
285
- const r6Info = require('r6-data.js');
286
-
287
- async function main() {
288
- try {
289
- // Get general game statistics
290
- const gameStats = await r6Info.getGameStats();
291
-
292
- console.log('Game statistics:', gameStats);
293
- return gameStats;
294
-
295
- } catch (error) {
296
- console.error('Error retrieving game statistics:', error.message);
297
- }
298
- }
299
-
300
- main();
301
- ```
302
-
303
- ### Game Statistics Response
304
- ```javascript
305
- {
306
- "steam": {
307
- "concurrent": 33631,
308
- "estimate": 33631
309
- },
310
- "crossPlatform": {
311
- "totalRegistered": 85000000,
312
- "monthlyActive": 15300000,
313
- "trendsEstimate": 175666,
314
- "platforms": {
315
- "pc": 6885000,
316
- "playstation": 5355000,
317
- "xbox": 3060000
318
- }
319
- },
320
- "ubisoft": {
321
- "onlineEstimate": 127739
322
- },
323
- "lastUpdated": "2025-10-15T22:39:38.636Z"
324
- }
325
- ```
326
-
327
- ## Comparing Player Statistics
328
-
329
- The `getPlayerComparisons()` function compares Rainbow Six Siege statistics between multiple players, providing rankings and comparison metrics.
330
-
331
- ```javascript
332
- const r6Info = require('r6-data.js');
333
-
334
- async function main() {
335
- try {
336
- const comparison = await r6Info.getPlayerComparisons({
337
- players: [
338
- { nameOnPlatform: 'Player1', platformType: 'uplay' },
339
- { nameOnPlatform: 'Player2', platformType: 'uplay' }
340
- ],
341
- platform_families: 'pc',
342
- board_id: 'ranked', // Optional
343
- compareFields: ['kills', 'deaths', 'wins', 'losses'] // Optional
344
- });
345
-
346
- console.log('Comparison results:', comparison.comparison_summary.field_comparisons);
347
-
348
- } catch (error) {
349
- console.error('Error during comparison:', error.message);
350
- }
351
- }
352
-
353
- main();
354
- ```
355
-
356
- ### Parameters
357
-
358
- - `players`: (Required) Array of player objects with `nameOnPlatform` and `platformType`
359
- - `platform_families`: (Required) "pc" or "console"
360
- - `board_id`: (Optional) Game mode filter - "casual", "ranked", etc.
361
- - `compareFields`: (Optional) Specific stats to compare (default: kills, deaths, wins, losses, etc.)
362
-
363
- ### Response
364
-
365
- Returns comparison data with player stats, field rankings (highest/lowest/average), and metadata including success/failure counts.
366
-
367
- ## Creating Discord Webhooks for R6 Stats
368
-
369
- 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.
370
-
371
- ```javascript
372
- const r6Info = require('r6-data.js');
373
-
374
- async function main() {
375
- try {
376
- // First, get player statistics
377
- const playerStats = await r6Info.getPlayerStats({
378
- nameOnPlatform: 'PlayerName',
379
- platformType: 'uplay',
380
- platform_families: 'pc'
381
- });
382
-
383
- // Send stats to Discord webhook
384
- const webhookResult = await r6Info.createDiscordR6Webhook(
385
- 'https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN',
386
- playerStats,
387
- {
388
- playerName: 'PlayerName',
389
- title: 'Rainbow Six Siege Stats',
390
- message: 'Here are the latest R6 stats!',
391
- color: 0xF99E1A, // Orange color
392
- avatarUrl: 'https://example.com/avatar.png'
393
- }
394
- );
395
-
396
- console.log('Webhook sent successfully:', webhookResult);
397
-
398
- } catch (error) {
399
- console.error('Error sending webhook:', error.message);
400
- }
401
- }
402
-
403
- main();
404
- ```
405
-
406
- ### Parameters
407
- The `createDiscordR6Webhook()` function accepts the following parameters:
408
- - `webhookUrl`: (Required) The Discord webhook URL
409
- - `playerData`: (Required) Player statistics data from getPlayerStats() or getAccountInfo()
410
- - `options`: (Required) Configuration object with the following properties:
411
- - `playerName`: (Required) The player's name to display
412
- - `title`: (Optional) Custom title for the embed (default: "Rainbow Six Siege Stats")
413
- - `message`: (Optional) Custom message content above the embed
414
- - `color`: (Optional) Embed color in hexadecimal format (default: 0xF99E1A)
415
- - `avatarUrl`: (Optional) URL for the player's avatar thumbnail
416
-
417
- ### Supported Data Formats
418
- The function automatically detects and formats different data sources:
419
-
420
- `Ubisoft API data`: From getPlayerStats() - displays ranked/standard statistics
421
- `Steam data`: Custom Steam-formatted statistics
422
- `Custom data`: Any custom statistics object
423
-
424
- ### Discord Webhook Setup
425
- To use this function, you need to create a webhook in your Discord server:
426
-
427
- 1. Go to your Discord server settings
428
- 2. Navigate to Integrations → Webhooks
429
- 3. Click "New Webhook"
430
- 4. Copy the webhook URL
431
- 5. Use this URL in the `createDiscordR6Webhook()` function
432
-
433
- ## Searching Across All Entities
434
-
435
- The `getSearchAll()` function allows you to search across all Rainbow Six Siege entities (operators, weapons, maps, seasons, charms, and attachments) with a single query. This is useful for finding relevant information across multiple categories at once.
436
-
437
- ```javascript
438
- const r6Info = require('r6-data.js');
439
-
440
- async function main() {
441
- try {
442
- // Search for all entities containing "black"
443
- const searchResults = await r6Info.getSearchAll('black');
444
- console.log('Search results summary:', searchResults.summary);
445
-
446
- // Access specific result categories
447
- console.log('Operator results:', searchResults.results.operators);
448
- console.log('Weapon results:', searchResults.results.weapons);
449
- console.log('Map results:', searchResults.results.maps);
450
- console.log('Season results:', searchResults.results.seasons);
451
- console.log('Charm results:', searchResults.results.charms);
452
- console.log('Attachment results:', searchResults.results.attachments);
453
-
454
- // Search for a specific operator
455
- const operatorSearch = await r6Info.getSearchAll('ash');
456
- console.log('Ash search results:', operatorSearch);
457
-
458
- // Search for a specific map
459
- const mapSearch = await r6Info.getSearchAll('bank');
460
- console.log('Bank search results:', mapSearch);
461
-
462
- } catch (error) {
463
- console.error('Error during search:', error.message);
464
- }
465
- }
466
-
467
- main();
468
- ```
469
-
470
- ### Parameters
471
-
472
- The `getSearchAll()` function accepts a single required parameter:
473
-
474
- - `query`: (Required) The search term to query across all entities
475
-
476
- ### Search Results
477
-
478
- The function returns a structured object containing:
479
-
480
- - query: The original search term
481
- - summary: A summary object with counts of results by category and total
482
- - results: An object containing arrays of results for each entity type:
483
- - operators: Array of operator results
484
- - weapons: Array of weapon results
485
- - maps: Array of map results
486
- - seasons: Array of season results
487
- - charms: Array of charm results
488
- - attachments: Array of attachment results
489
-
490
-
491
- Each result includes an `entity_type` field indicating its category, along with relevant data fields for that entity type.
492
-
493
- ## Getting Rank Information
494
-
495
- The `getRanks()` function supports retrieving rank information across different versions of the game's ranking system, from v1 to v6. This flexibility allows users to query rank data that aligns with specific game seasons or ranking system updates. Here are examples demonstrating how to use the `getRanks()` function for each version, including filtering options for `min_mmr` and `max_mmr`.
496
-
497
- `v1: Until Y1S3 | #3 | Skull Rain`
498
-
499
- `v2: Y1S4 | #4 | Red Crow`
500
-
501
- `v3: Y2S1 - Y4S2 | #5 - #14 | Velvet Shell - Phantom Sight`
502
-
503
- `v4: Y4S3 - Y6S2 | #15 - #22 | Ember Rise - North Star`
504
-
505
- `v5: Y6S3 - Y7S3 | #23 - #27 | Crystal Guard - Brutal Swarm`
506
-
507
- `V6: Y7S4+ | #28+ | Solar Raid+ (Ranked 2.0)`
508
-
509
- ### Version 1 (v1)
510
-
511
- ```javascript
512
- const r6Info = require('r6-data.js');
513
-
514
- async function main() {
515
-
516
- try {
517
-
518
- const ranksV1 = await r6Info.getRanks({ version: 'v1' });
519
- console.log('All ranks for version v1:', ranksV1);
520
-
521
- const filteredRanksV1 = await r6Info.getRanks({ min_mmr: 2000, max_mmr: 2500, version: 'v1' });
522
- console.log('Filtered ranks for version v1:', filteredRanksV1);
523
-
524
- } catch (error) {
525
- console.error('Error while requesting ranks:', error.message);
526
- }
527
- }
528
-
529
- main();
530
- ```
531
- `getRanks()` function with the version parameter set to 'v1' to retrieve all ranks for version 1 of the ranking system. We also demonstrate filtering the ranks by specifying the min_mmr and max_mmr parameters to get ranks within a specific MMR range.
532
-
533
- For the others versions you can replace the v1 with v2, v3... and the others parameters
534
-
535
-
536
- ## Getting Service Status
537
-
538
- The `getServiceStatus()` function allows you to retrieve the current status of the Rainbow Six Siege game servers. This information can be useful for monitoring the health and availability of the game service. Here's an example of how to use the `getServiceStatus()` function:
539
-
540
- ```javascript
541
- const r6Info = require('r6-data.js');
542
-
543
- async function main() {
544
-
545
- try {
546
-
547
- const serviceStatus = await r6Info.getServiceStatus();
548
- console.log('Service status:', serviceStatus);
549
-
550
- } catch (error) {
551
- console.error('Error while requesting service status:', error.message);
552
- }
553
- }
554
-
555
- main();
556
- ```
557
-
558
- ## Getting Map Information
559
-
560
- The `getMaps()` function allows you to retrieve information about the maps available in Rainbow Six Siege. You can get a list of all maps or filter the maps based on specific criteria. Here's an example of how to use the `getMaps()` function:
561
-
562
- ```javascript
563
- const r6Info = require('r6-data.js');
564
-
565
- async function main() {
566
-
567
- try {
568
-
569
- // Get all maps
570
- const maps = await r6Info.getMaps();
571
- console.log('All maps:', maps);
572
-
573
- // Filter maps by name
574
- const filteredMapsByName = await r6Info.getMaps({ name: 'Bank' });
575
- console.log('Maps filtered by name:', filteredMapsByName);
576
-
577
- // Filter maps by location
578
- const filteredMapsByLocation = await r6Info.getMaps({ location: 'USA' });
579
- console.log('Maps filtered by location:', filteredMapsByLocation);
580
-
581
- // Filter maps by release date
582
- const filteredMapsByReleaseDate = await r6Info.getMaps({ releaseDate: '2015-12-01' });
583
- console.log('Maps filtered by release date:', filteredMapsByReleaseDate);
584
-
585
- // Filter maps by playlists
586
- const filteredMapsByPlaylists = await r6Info.getMaps({ playlists: 'ranked' });
587
- console.log('Maps filtered by playlists:', filteredMapsByPlaylists);
588
-
589
- // Filter maps by rework status
590
- const filteredMapsByRework = await r6Info.getMaps({ mapReworked: true });
591
- console.log('Maps filtered by rework status:', filteredMapsByRework);
592
-
593
- } catch (error) {
594
- console.error('Error while requesting maps:', error.message);
595
- }
596
- }
597
-
598
- main();
599
- ```
600
-
601
- Retrieving all maps by calling `getMaps()` without any parameters.
602
- Filtering maps by name using the `name` parameter.
603
- Filtering maps by location using the `location` parameter.
604
- Filtering maps by release date using the `releaseDate` parameter.
605
- Filtering maps by playlists using the `playlists` parameter.
606
- Filtering maps by rework status using the `mapReworked` parameter.
607
- You can use these filtering options individually or combine them to retrieve specific subsets of maps based on your requirements.
608
-
609
- ## Getting Operator Information
610
-
611
- The `getOperators()` function allows you to retrieve information about the operators available in Rainbow Six Siege. You can get a list of all operators or filter the operators based on specific criteria. Here's an example of how to use the `getOperators()` function:
612
-
613
- ```javascript
614
- const r6Info = require('r6-data.js');
615
-
616
- async function main() {
617
-
618
- try {
619
-
620
- // Get all operators
621
- const operators = await r6Info.getOperators();
622
- console.log('All operators:', operators);
623
-
624
- // Filter operators by name
625
- const filteredOperatorsByName = await r6Info.getOperators({ name: 'Ash' });
626
- console.log('Operators filtered by name:', filteredOperatorsByName);
627
-
628
- // Filter operators by safe name
629
- const filteredOperatorsBySafeName = await r6Info.getOperators({ safename: 'recruit' });
630
- console.log('Operators filtered by safe name:', filteredOperatorsBySafeName);
631
-
632
- // Filter operators by real name
633
- const filteredOperatorsByRealName = await r6Info.getOperators({ realname: 'Eliza Cohen' });
634
- console.log('Operators filtered by real name:', filteredOperatorsByRealName);
635
-
636
- // Filter operators by birthplace
637
- const filteredOperatorsByBirthplace = await r6Info.getOperators({ birthplace: 'Jerusalem, Israel' });
638
- console.log('Operators filtered by birthplace:', filteredOperatorsByBirthplace);
639
-
640
- // Filter operators by age
641
- const filteredOperatorsByAge = await r6Info.getOperators({ age: 33 });
642
- console.log('Operators filtered by age:', filteredOperatorsByAge);
643
-
644
- // Filter operators by date of birth
645
- const filteredOperatorsByDateOfBirth = await r6Info.getOperators({ date_of_birth: '1984-12-24' });
646
- console.log('Operators filtered by date of birth:', filteredOperatorsByDateOfBirth);
647
-
648
- // Filter operators by season introduced
649
- const filteredOperatorsBySeasonIntroduced = await r6Info.getOperators({ season_introduced: 'Y1S1' });
650
- console.log('Operators filtered by season introduced:', filteredOperatorsBySeasonIntroduced);
651
-
652
- } catch (error) {
653
- console.error('Error while requesting operators:', error.message);
654
- }
655
- }
656
-
657
- main();
658
- ```
659
-
660
- 1. Retrieving all operators by calling `getOperators()` without any parameters.
661
- 2. Filtering operators by name using the `name` parameter.
662
- 3. Filtering operators by safe name using the `safename` parameter.
663
- 4. Filtering operators by real name using the `realname` parameter.
664
- 5. Filtering operators by birthplace using the `birthplace` parameter.
665
- 6. Filtering operators by age using the `age` parameter.
666
- 7. Filtering operators by date of birth using the `date_of_birth` parameter.
667
- 8. Filtering operators by season introduced using the `season_introduced` parameter.
668
-
669
- You can get the operator url icon via r6Info.getOperators(), is in the json response.
670
-
671
- ## Getting Season Information
672
-
673
- 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:
674
-
675
- ```javascript
676
- const r6Info = require('r6-data.js');
677
-
678
- async function main() {
679
-
680
- try {
681
-
682
- // Get all seasons
683
- const seasons = await r6Info.getSeasons();
684
- console.log('All seasons:', seasons);
685
-
686
- // Filter seasons by name
687
- const filteredSeasonsByName = await r6Info.getSeasons({ name: 'Black Ice' });
688
- console.log('Seasons filtered by name:', filteredSeasonsByName);
689
-
690
- // Filter seasons by map
691
- const filteredSeasonsByMap = await r6Info.getSeasons({ map: 'Yacht' });
692
- console.log('Seasons filtered by map:', filteredSeasonsByMap);
693
-
694
- // Filter seasons by operators
695
- const filteredSeasonsByOperators = await r6Info.getSeasons({ operators: 'Buck, Frost' });
696
- console.log('Seasons filtered by operators:', filteredSeasonsByOperators);
697
-
698
- // Filter seasons by weapons
699
- const filteredSeasonsByWeapons = await r6Info.getSeasons({ weapons: 'C8-SFW, Super 90' });
700
- console.log('Seasons filtered by weapons:', filteredSeasonsByWeapons);
701
-
702
- } catch (error) {
703
- console.error('Error while requesting seasons:', error.message);
704
- }
705
- }
706
-
707
- main();
708
- ```
709
-
710
- Retrieving all seasons by calling `getSeasons()` without any parameters.
711
- - Filtering seasons by name using the `name` parameter.
712
- - Filtering seasons by map using the `map` parameter.
713
- - Filtering seasons by operators using the `operators` parameter.
714
- - Filtering seasons by weapons using the `weapons` parameter.
715
-
716
- ## Getting Attachment Information
717
-
718
- The `getAttachment()` function allows you to retrieve information about the attachments available in Rainbow Six Siege. You can get a list of all attachments or filter the attachments based on specific criteria. Here's an example of how to use the `getAttachment()` function:
719
-
720
- ```javascript
721
- const r6Info = require('r6-data.js');
722
-
723
- async function main() {
724
-
725
- try {
726
-
727
- // Get all attachments
728
- const attachments = await r6Info.getAttachment();
729
- console.log('All attachments:', attachments);
730
-
731
- // Filter attachments by name
732
- const filteredAttachmentsByName = await r6Info.getAttachment({ name: 'Red Dot Sight' });
733
- console.log('Attachments filtered by name:', filteredAttachmentsByName);
734
-
735
- // Filter attachments by style
736
- const filteredAttachmentsByStyle = await r6Info.getAttachment({ style: 'colour' });
737
- console.log('Attachments filtered by style:', filteredAttachmentsByStyle);
738
-
739
- // Filter attachments by rarity
740
- const filteredAttachmentsByRarity = await r6Info.getAttachment({ rarity: 'common' });
741
- console.log('Attachments filtered by rarity:', filteredAttachmentsByRarity);
742
-
743
- // Filter attachments by availability
744
- const filteredAttachmentsByAvailability = await r6Info.getAttachment({ availability: 'removed' });
745
- console.log('Attachments filtered by availability:', filteredAttachmentsByAvailability);
746
-
747
- } catch (error) {
748
- console.error('Error while requesting attachments:', error.message);
749
- }
750
- }
751
-
752
- main();
753
- ```
754
-
755
- Retrieving all attachments by calling `getAttachment()` without any parameters.
756
- - Filtering attachments by name using the `name` parameter.
757
- - Filtering attachments by style using the `style` parameter.
758
- - Filtering attachments by rarity using the `rarity` parameter.
759
- - Filtering attachments by availability using the `availability` parameter.
760
-
761
- ## Getting Charm Information
762
-
763
- ```javascript
764
- const r6Info = require('r6-data.js');
765
-
766
- // Get all charms
767
- const charms = await r6Info.getCharms();
768
- console.log('All charms:', charms);
769
-
770
- // Filter charms by specific criteria
771
- const filteredCharms = await r6Info.getCharms({
772
- name: 'Chibi',
773
- collection: 'Year 1',
774
- rarity: 'legendary',
775
- availability: 'available',
776
- bundle: 'Pro League Set',
777
- season: 'Burnt Horizon'
778
- });
779
- ```
780
-
781
- The `getCharms()` function allows you to retrieve information about the charms available in Rainbow Six Siege. You can get all charms or filter them based on specific criteria:
782
-
783
- - `name`: Filter by charm name
784
- - `collection`: Filter by charm collection
785
- - `rarity`: Filter by rarity level (common, uncommon, rare, epic, legendary)
786
- - `availability`: Filter by availability status
787
- - `bundle`: Filter by bundle name
788
- - `season`: Filter by season released
789
-
790
- ## Getting Weapon Information
791
-
792
- The `getWeapons()` function allows you to retrieve information about the weapons available in Rainbow Six Siege. You can get a list of all weapons or filter them by name. Here's an example of how to use the `getWeapons()` function:
793
-
794
- ```javascript
795
- const r6Info = require('r6-data.js');
796
-
797
- async function main() {
798
-
799
- try {
800
-
801
- // Get all weapons
802
- const weapons = await r6Info.getWeapons();
803
- console.log('All weapons:', weapons);
804
-
805
- // Filter weapons by name
806
- const filteredWeaponsByName = await r6Info.getWeapons({ name: 'F2' });
807
- console.log('Weapons filtered by name:', filteredWeaponsByName);
808
-
809
- } catch (error) {
810
- console.error('Error while requesting weapons:', error.message);
811
- }
812
- }
813
-
814
- main();
815
- ```
816
-
817
- The `getWeapons()` function retrieves information about the weapons in Rainbow Six Siege. You can:
818
-
819
- - Retrieve all weapons by calling `getWeapons()` without any parameters
820
- - Filter weapons by name using the `name` parameter
821
-
822
- ## Getting Universal Skin Information
823
-
824
- The `getUniversalSkins()` function allows you to retrieve information about the universal skins available in Rainbow Six Siege. You can get a list of all universal skins or filter them by name. Here's an example of how to use the `getUniversalSkins()` function:
825
-
826
- ```javascript
827
- const r6Info = require('r6-data.js');
828
-
829
- async function main() {
830
-
831
- try {
832
-
833
- // Get all universal skins
834
- const universalSkins = await r6Info.getUniversalSkins();
835
- console.log('All universal skins:', universalSkins);
836
-
837
- // Filter universal skins by name
838
- const filteredSkinsByName = await r6Info.getUniversalSkins({ name: 'Black Ice' });
839
- console.log('Universal skins filtered by name:', filteredSkinsByName);
840
-
841
- } catch (error) {
842
- console.error('Error while requesting universal skins:', error.message);
843
- }
844
- }
845
-
846
- main();
847
- ```
848
-
849
- The `getUniversalSkins()` function retrieves information about universal weapon skins in Rainbow Six Siege. You can:
850
-
851
- - Retrieve all universal skins by calling `getUniversalSkins()` without any parameters
852
- - Filter universal skins by name using the name parameter
853
-
854
- ## Error Handling
855
- The package functions throw an exception if an error occurs during API requests. Make sure to handle errors appropriately using try-catch blocks.
856
-
857
- If the access token has expired or is invalid, an exception will be thrown with the message "Token expired or invalid". In this case, you need to obtain a new token using the getToken() function.
858
-
859
- ## License
860
- This package is fan made, so it has been created for only informational purposes
153
+ ## Getting Player Statistics
154
+
155
+ The `getPlayerStats()` function allows you to retrieve detailed gameplay statistics from the official Rainbow Six Siege API. This function is specifically designed for retrieving player performance data across different game modes.
156
+
157
+ ```javascript
158
+ const r6Info = require('r6-data.js');
159
+
160
+ async function main() {
161
+ try {
162
+ const apiKey = 'YOUR_API_KEY';
163
+
164
+ // Get player statistics
165
+ const playerStats = await r6Info.getPlayerStats(apiKey, {
166
+ nameOnPlatform: 'PlayerName',
167
+ platformType: 'uplay',
168
+ platform_families: 'pc'
169
+ });
170
+
171
+ console.log('Player statistics:', playerStats);
172
+
173
+ // Get player statistics for ranked mode only
174
+ const rankedStats = await r6Info.getPlayerStats(apiKey, {
175
+ nameOnPlatform: 'PlayerName',
176
+ platformType: 'uplay',
177
+ platform_families: 'pc',
178
+ board_id: 'ranked'
179
+ });
180
+
181
+ console.log('Ranked statistics:', rankedStats);
182
+ return rankedStats;
183
+
184
+ } catch (error) {
185
+ console.error('Error retrieving player statistics:', error.message);
186
+ }
187
+ }
188
+
189
+ main();
190
+ ```
191
+
192
+ ### Parameters
193
+
194
+ The `getPlayerStats()` function accepts the API Key and an object with the following parameters:
195
+
196
+ - `apiKey`: (Required) Your API Key from r6data.eu
197
+ - `nameOnPlatform`: (Required) The player's name on the platform
198
+ - `platformType`: (Required) The platform type - "uplay", "psn", or "xbl"
199
+ - `platform_families`: (Required) The platform family - "pc" or "console"
200
+ - `board_id`: (Optional) The game mode to filter statistics - "casual", "event", "warmup", "standard", or "ranked"
201
+
202
+ ### Player Statistics Response
203
+ When using `getPlayerStats()`, you'll receive detailed gameplay statistics, including:
204
+
205
+ - Rank information
206
+ - MMR (Matchmaking Rating)
207
+ - Win/loss records
208
+ - Seasonal performance data
209
+ - Skill metrics across different gameplay modes
210
+
211
+ You can filter these statistics by game mode using the `board_id` parameter:
212
+
213
+ - `casual`: Statistics for casual matches
214
+ - `event`: Statistics for limited-time events
215
+ - `warmup`: Statistics for warmup matches
216
+ - `standard`: Statistics for standard matches
217
+ - `ranked`: Statistics for ranked competitive matches
218
+
219
+
220
+ ## Getting Seasonal Statistics
221
+
222
+ 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
223
+
224
+ ```javascript
225
+ const r6Info = require('r6-data.js');
226
+
227
+ async function main() {
228
+ try {
229
+ const apiKey = 'YOUR_API_KEY';
230
+
231
+ // Get seasonal statistics for a player
232
+ const seasonalStats = await r6Info.getSeasonalStats(apiKey, {
233
+ nameOnPlatform: 'PlayerName',
234
+ platformType: 'uplay'
235
+ });
236
+
237
+ console.log('Seasonal statistics:', seasonalStats);
238
+ return seasonalStats;
239
+
240
+ } catch (error) {
241
+ console.error('Error retrieving seasonal statistics:', error.message);
242
+ }
243
+ }
244
+
245
+ main();
246
+ ```
247
+
248
+ ### Parameters
249
+
250
+ The `getSeasonalStats()` function accepts the API Key and an object with the following parameters:
251
+
252
+ - `apiKey`: (Required) Your API Key from r6data.eu
253
+ - `nameOnPlatform`: (Required) The player's name on the platform
254
+ - `platformType`: (Required) The platform type - "uplay", "psn", or "xbl"
255
+
256
+ ### Seasonal Statistics Response
257
+
258
+ ```javascript
259
+ {
260
+ "data": {
261
+ "history": {
262
+ "metadata": {
263
+ "key": "RankPoints",
264
+ "name": "Rank Points",
265
+ "description": null
266
+ },
267
+ "data": [
268
+ [
269
+ "2025-10-14T21:43:27.315+00:00",
270
+ {
271
+ "displayName": "Rank Points",
272
+ "metadata": {
273
+ "rank": "PLATINUM II",
274
+ "imageUrl": "https://r6data.eu/assets/img/r6_ranks_img/platinum-2.webp",
275
+ "color": "#44ccc2"
276
+ },
277
+ "value": 3300,
278
+ "displayValue": "3,300",
279
+ "displayType": "Number"
280
+ }
281
+ ],
282
+ [
283
+ "2025-10-14T21:12:55.821+00:00",
284
+ {
285
+ "displayName": "Rank Points",
286
+ "metadata": {
287
+ "rank": "PLATINUM II",
288
+ "imageUrl": "https://r6data.eu/assets/img/r6_ranks_img/platinum-2.webp",
289
+ "color": "#44ccc2"
290
+ },
291
+ "value": 3302,
292
+ "displayValue": "3,302",
293
+ "displayType": "Number"
294
+ }
295
+ ]
296
+ ]
297
+ },
298
+ "leaderboard": null,
299
+ "expiryDate": "0001-01-01T00:00:00+00:00",
300
+ "bestMatches": null
301
+ }
302
+ ```
303
+
304
+ ## Getting Game Statistics
305
+
306
+ 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
307
+
308
+ ```javascript
309
+ const r6Info = require('r6-data.js');
310
+
311
+ async function main() {
312
+ try {
313
+ const apiKey = 'YOUR_API_KEY';
314
+
315
+ // Get general game statistics
316
+ const gameStats = await r6Info.getGameStats(apiKey);
317
+
318
+ console.log('Game statistics:', gameStats);
319
+ return gameStats;
320
+
321
+ } catch (error) {
322
+ console.error('Error retrieving game statistics:', error.message);
323
+ }
324
+ }
325
+
326
+ main();
327
+ ```
328
+
329
+ ### Game Statistics Response
330
+ ```javascript
331
+ {
332
+ "steam": {
333
+ "concurrent": 33631,
334
+ "estimate": 33631
335
+ },
336
+ "crossPlatform": {
337
+ "totalRegistered": 85000000,
338
+ "monthlyActive": 15300000,
339
+ "trendsEstimate": 175666,
340
+ "platforms": {
341
+ "pc": 6885000,
342
+ "playstation": 5355000,
343
+ "xbox": 3060000
344
+ }
345
+ },
346
+ "ubisoft": {
347
+ "onlineEstimate": 127739
348
+ },
349
+ "lastUpdated": "2025-10-15T22:39:38.636Z"
350
+ }
351
+ ```
352
+
353
+ ## Comparing Player Statistics
354
+
355
+ The `getPlayerComparisons()` function compares Rainbow Six Siege statistics between multiple players, providing rankings and comparison metrics.
356
+
357
+ ```javascript
358
+ const r6Info = require('r6-data.js');
359
+
360
+ async function main() {
361
+ try {
362
+ const apiKey = 'YOUR_API_KEY';
363
+
364
+ const comparison = await r6Info.getPlayerComparisons(apiKey, {
365
+ players: [
366
+ { nameOnPlatform: 'Player1', platformType: 'uplay' },
367
+ { nameOnPlatform: 'Player2', platformType: 'uplay' }
368
+ ],
369
+ platform_families: 'pc',
370
+ board_id: 'ranked', // Optional
371
+ compareFields: ['kills', 'deaths', 'wins', 'losses'] // Optional
372
+ });
373
+
374
+ console.log('Comparison results:', comparison.comparison_summary.field_comparisons);
375
+
376
+ } catch (error) {
377
+ console.error('Error during comparison:', error.message);
378
+ }
379
+ }
380
+
381
+ main();
382
+ ```
383
+
384
+ ### Parameters
385
+
386
+ - `apiKey`: (Required) Your API Key from r6data.eu
387
+ - `players`: (Required) Array of player objects with `nameOnPlatform` and `platformType`
388
+ - `platform_families`: (Required) "pc" or "console"
389
+ - `board_id`: (Optional) Game mode filter - "casual", "ranked", etc.
390
+ - `compareFields`: (Optional) Specific stats to compare (default: kills, deaths, wins, losses, etc.)
391
+
392
+ ### Response
393
+
394
+ Returns comparison data with player stats, field rankings (highest/lowest/average), and metadata including success/failure counts.
395
+
396
+ ## Creating Discord Webhooks for R6 Stats
397
+
398
+ 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.
399
+
400
+ ```javascript
401
+ const r6Info = require('r6-data.js');
402
+
403
+ async function main() {
404
+ try {
405
+ const apiKey = 'YOUR_API_KEY';
406
+
407
+ // First, get player statistics
408
+ const playerStats = await r6Info.getPlayerStats(apiKey, {
409
+ nameOnPlatform: 'PlayerName',
410
+ platformType: 'uplay',
411
+ platform_families: 'pc'
412
+ });
413
+
414
+ // Send stats to Discord webhook
415
+ const webhookResult = await r6Info.createDiscordR6Webhook(
416
+ 'https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN',
417
+ playerStats,
418
+ {
419
+ playerName: 'PlayerName',
420
+ title: 'Rainbow Six Siege Stats',
421
+ message: 'Here are the latest R6 stats!',
422
+ color: 0xF99E1A, // Orange color
423
+ avatarUrl: 'https://example.com/avatar.png'
424
+ }
425
+ );
426
+
427
+ console.log('Webhook sent successfully:', webhookResult);
428
+
429
+ } catch (error) {
430
+ console.error('Error sending webhook:', error.message);
431
+ }
432
+ }
433
+
434
+ main();
435
+ ```
436
+
437
+ ### Parameters
438
+ The `createDiscordR6Webhook()` function accepts the following parameters:
439
+ - `webhookUrl`: (Required) The Discord webhook URL
440
+ - `playerData`: (Required) Player statistics data from getPlayerStats() or getAccountInfo()
441
+ - `options`: (Required) Configuration object with the following properties:
442
+ - `playerName`: (Required) The player's name to display
443
+ - `title`: (Optional) Custom title for the embed (default: "Rainbow Six Siege Stats")
444
+ - `message`: (Optional) Custom message content above the embed
445
+ - `color`: (Optional) Embed color in hexadecimal format (default: 0xF99E1A)
446
+ - `avatarUrl`: (Optional) URL for the player's avatar thumbnail
447
+
448
+ ### Supported Data Formats
449
+ The function automatically detects and formats different data sources:
450
+
451
+ `Ubisoft API data`: From getPlayerStats() - displays ranked/standard statistics
452
+ `Steam data`: Custom Steam-formatted statistics
453
+ `Custom data`: Any custom statistics object
454
+
455
+ ### Discord Webhook Setup
456
+ To use this function, you need to create a webhook in your Discord server:
457
+
458
+ 1. Go to your Discord server settings
459
+ 2. Navigate to Integrations → Webhooks
460
+ 3. Click "New Webhook"
461
+ 4. Copy the webhook URL
462
+ 5. Use this URL in the `createDiscordR6Webhook()` function
463
+
464
+ ## Searching Across All Entities
465
+
466
+ The `getSearchAll()` function allows you to search across all Rainbow Six Siege entities (operators, weapons, maps, seasons, charms, and attachments) with a single query. This is useful for finding relevant information across multiple categories at once.
467
+
468
+ ```javascript
469
+ const r6Info = require('r6-data.js');
470
+
471
+ async function main() {
472
+ try {
473
+ const apiKey = 'YOUR_API_KEY';
474
+
475
+ // Search for all entities containing "black"
476
+ const searchResults = await r6Info.getSearchAll(apiKey, 'black');
477
+ console.log('Search results summary:', searchResults.summary);
478
+
479
+ // Access specific result categories
480
+ console.log('Operator results:', searchResults.results.operators);
481
+ console.log('Weapon results:', searchResults.results.weapons);
482
+ console.log('Map results:', searchResults.results.maps);
483
+ console.log('Season results:', searchResults.results.seasons);
484
+ console.log('Charm results:', searchResults.results.charms);
485
+ console.log('Attachment results:', searchResults.results.attachments);
486
+
487
+ // Search for a specific operator
488
+ const operatorSearch = await r6Info.getSearchAll(apiKey, 'ash');
489
+ console.log('Ash search results:', operatorSearch);
490
+
491
+ // Search for a specific map
492
+ const mapSearch = await r6Info.getSearchAll(apiKey, 'bank');
493
+ console.log('Bank search results:', mapSearch);
494
+
495
+ } catch (error) {
496
+ console.error('Error during search:', error.message);
497
+ }
498
+ }
499
+
500
+ main();
501
+ ```
502
+
503
+ ### Parameters
504
+
505
+ The `getSearchAll()` function accepts the API Key and a query:
506
+
507
+ - `apiKey`: (Required) Your API Key from r6data.eu
508
+ - `query`: (Required) The search term to query across all entities
509
+
510
+ ### Search Results
511
+
512
+ The function returns a structured object containing:
513
+
514
+ - query: The original search term
515
+ - summary: A summary object with counts of results by category and total
516
+ - results: An object containing arrays of results for each entity type:
517
+ - operators: Array of operator results
518
+ - weapons: Array of weapon results
519
+ - maps: Array of map results
520
+ - seasons: Array of season results
521
+ - charms: Array of charm results
522
+ - attachments: Array of attachment results
523
+
524
+
525
+ Each result includes an `entity_type` field indicating its category, along with relevant data fields for that entity type.
526
+
527
+ ## Getting Rank Information
528
+
529
+ The `getRanks()` function supports retrieving rank information across different versions of the game's ranking system, from v1 to v6. This flexibility allows users to query rank data that aligns with specific game seasons or ranking system updates. Here are examples demonstrating how to use the `getRanks()` function for each version, including filtering options for `min_mmr` and `max_mmr`.
530
+
531
+ `v1: Until Y1S3 | #3 | Skull Rain`
532
+
533
+ `v2: Y1S4 | #4 | Red Crow`
534
+
535
+ `v3: Y2S1 - Y4S2 | #5 - #14 | Velvet Shell - Phantom Sight`
536
+
537
+ `v4: Y4S3 - Y6S2 | #15 - #22 | Ember Rise - North Star`
538
+
539
+ `v5: Y6S3 - Y7S3 | #23 - #27 | Crystal Guard - Brutal Swarm`
540
+
541
+ `V6: Y7S4+ | #28+ | Solar Raid+ (Ranked 2.0)`
542
+
543
+ ### Version 1 (v1)
544
+
545
+ ```javascript
546
+ const r6Info = require('r6-data.js');
547
+
548
+ async function main() {
549
+
550
+ try {
551
+ const apiKey = 'YOUR_API_KEY';
552
+
553
+ const ranksV1 = await r6Info.getRanks(apiKey, { version: 'v1' });
554
+ console.log('All ranks for version v1:', ranksV1);
555
+
556
+ const filteredRanksV1 = await r6Info.getRanks(apiKey, { min_mmr: 2000, max_mmr: 2500, version: 'v1' });
557
+ console.log('Filtered ranks for version v1:', filteredRanksV1);
558
+
559
+ } catch (error) {
560
+ console.error('Error while requesting ranks:', error.message);
561
+ }
562
+ }
563
+
564
+ main();
565
+ ```
566
+ `getRanks()` function with the version parameter set to 'v1' to retrieve all ranks for version 1 of the ranking system. We also demonstrate filtering the ranks by specifying the min_mmr and max_mmr parameters to get ranks within a specific MMR range.
567
+
568
+ For the others versions you can replace the v1 with v2, v3... and the others parameters
569
+
570
+
571
+ ## Getting Service Status
572
+
573
+ The `getServiceStatus()` function allows you to retrieve the current status of the Rainbow Six Siege game servers. This information can be useful for monitoring the health and availability of the game service. Here's an example of how to use the `getServiceStatus()` function:
574
+
575
+ ```javascript
576
+ const r6Info = require('r6-data.js');
577
+
578
+ async function main() {
579
+
580
+ try {
581
+ const apiKey = 'YOUR_API_KEY';
582
+
583
+ const serviceStatus = await r6Info.getServiceStatus(apiKey);
584
+ console.log('Service status:', serviceStatus);
585
+
586
+ } catch (error) {
587
+ console.error('Error while requesting service status:', error.message);
588
+ }
589
+ }
590
+
591
+ main();
592
+ ```
593
+
594
+ ## Getting Map Information
595
+
596
+ The `getMaps()` function allows you to retrieve information about the maps available in Rainbow Six Siege. You can get a list of all maps or filter the maps based on specific criteria. Here's an example of how to use the `getMaps()` function:
597
+
598
+ ```javascript
599
+ const r6Info = require('r6-data.js');
600
+
601
+ async function main() {
602
+
603
+ try {
604
+ const apiKey = 'YOUR_API_KEY';
605
+
606
+ // Get all maps
607
+ const maps = await r6Info.getMaps(apiKey);
608
+ console.log('All maps:', maps);
609
+
610
+ // Filter maps by name
611
+ const filteredMapsByName = await r6Info.getMaps(apiKey, { name: 'Bank' });
612
+ console.log('Maps filtered by name:', filteredMapsByName);
613
+
614
+ // Filter maps by location
615
+ const filteredMapsByLocation = await r6Info.getMaps(apiKey, { location: 'USA' });
616
+ console.log('Maps filtered by location:', filteredMapsByLocation);
617
+
618
+ // Filter maps by release date
619
+ const filteredMapsByReleaseDate = await r6Info.getMaps(apiKey, { releaseDate: '2015-12-01' });
620
+ console.log('Maps filtered by release date:', filteredMapsByReleaseDate);
621
+
622
+ // Filter maps by playlists
623
+ const filteredMapsByPlaylists = await r6Info.getMaps(apiKey, { playlists: 'ranked' });
624
+ console.log('Maps filtered by playlists:', filteredMapsByPlaylists);
625
+
626
+ // Filter maps by rework status
627
+ const filteredMapsByRework = await r6Info.getMaps(apiKey, { mapReworked: true });
628
+ console.log('Maps filtered by rework status:', filteredMapsByRework);
629
+
630
+ } catch (error) {
631
+ console.error('Error while requesting maps:', error.message);
632
+ }
633
+ }
634
+
635
+ main();
636
+ ```
637
+
638
+ Retrieving all maps by calling `getMaps()` without any parameters.
639
+ Filtering maps by name using the `name` parameter.
640
+ Filtering maps by location using the `location` parameter.
641
+ Filtering maps by release date using the `releaseDate` parameter.
642
+ Filtering maps by playlists using the `playlists` parameter.
643
+ Filtering maps by rework status using the `mapReworked` parameter.
644
+ You can use these filtering options individually or combine them to retrieve specific subsets of maps based on your requirements.
645
+
646
+ ## Getting Operator Information
647
+
648
+ The `getOperators()` function allows you to retrieve information about the operators available in Rainbow Six Siege. You can get a list of all operators or filter the operators based on specific criteria. Here's an example of how to use the `getOperators()` function:
649
+
650
+ ```javascript
651
+ const r6Info = require('r6-data.js');
652
+
653
+ async function main() {
654
+
655
+ try {
656
+ const apiKey = 'YOUR_API_KEY';
657
+
658
+ // Get all operators
659
+ const operators = await r6Info.getOperators(apiKey);
660
+ console.log('All operators:', operators);
661
+
662
+ // Filter operators by name
663
+ const filteredOperatorsByName = await r6Info.getOperators(apiKey, { name: 'Ash' });
664
+ console.log('Operators filtered by name:', filteredOperatorsByName);
665
+
666
+ // Filter operators by safe name
667
+ const filteredOperatorsBySafeName = await r6Info.getOperators(apiKey, { safename: 'recruit' });
668
+ console.log('Operators filtered by safe name:', filteredOperatorsBySafeName);
669
+
670
+ // Filter operators by real name
671
+ const filteredOperatorsByRealName = await r6Info.getOperators(apiKey, { realname: 'Eliza Cohen' });
672
+ console.log('Operators filtered by real name:', filteredOperatorsByRealName);
673
+
674
+ // Filter operators by birthplace
675
+ const filteredOperatorsByBirthplace = await r6Info.getOperators(apiKey, { birthplace: 'Jerusalem, Israel' });
676
+ console.log('Operators filtered by birthplace:', filteredOperatorsByBirthplace);
677
+
678
+ // Filter operators by age
679
+ const filteredOperatorsByAge = await r6Info.getOperators(apiKey, { age: 33 });
680
+ console.log('Operators filtered by age:', filteredOperatorsByAge);
681
+
682
+ // Filter operators by date of birth
683
+ const filteredOperatorsByDateOfBirth = await r6Info.getOperators(apiKey, { date_of_birth: '1984-12-24' });
684
+ console.log('Operators filtered by date of birth:', filteredOperatorsByDateOfBirth);
685
+
686
+ // Filter operators by season introduced
687
+ const filteredOperatorsBySeasonIntroduced = await r6Info.getOperators(apiKey, { season_introduced: 'Y1S1' });
688
+ console.log('Operators filtered by season introduced:', filteredOperatorsBySeasonIntroduced);
689
+
690
+ } catch (error) {
691
+ console.error('Error while requesting operators:', error.message);
692
+ }
693
+ }
694
+
695
+ main();
696
+ ```
697
+
698
+ 1. Retrieving all operators by calling `getOperators()` without any parameters.
699
+ 2. Filtering operators by name using the `name` parameter.
700
+ 3. Filtering operators by safe name using the `safename` parameter.
701
+ 4. Filtering operators by real name using the `realname` parameter.
702
+ 5. Filtering operators by birthplace using the `birthplace` parameter.
703
+ 6. Filtering operators by age using the `age` parameter.
704
+ 7. Filtering operators by date of birth using the `date_of_birth` parameter.
705
+ 8. Filtering operators by season introduced using the `season_introduced` parameter.
706
+
707
+ You can get the operator url icon via r6Info.getOperators(), is in the json response.
708
+
709
+ ## Getting Season Information
710
+
711
+ 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:
712
+
713
+ ```javascript
714
+ const r6Info = require('r6-data.js');
715
+
716
+ async function main() {
717
+
718
+ try {
719
+ const apiKey = 'YOUR_API_KEY';
720
+
721
+ // Get all seasons
722
+ const seasons = await r6Info.getSeasons(apiKey);
723
+ console.log('All seasons:', seasons);
724
+
725
+ // Filter seasons by name
726
+ const filteredSeasonsByName = await r6Info.getSeasons(apiKey, { name: 'Black Ice' });
727
+ console.log('Seasons filtered by name:', filteredSeasonsByName);
728
+
729
+ // Filter seasons by map
730
+ const filteredSeasonsByMap = await r6Info.getSeasons(apiKey, { map: 'Yacht' });
731
+ console.log('Seasons filtered by map:', filteredSeasonsByMap);
732
+
733
+ // Filter seasons by operators
734
+ const filteredSeasonsByOperators = await r6Info.getSeasons(apiKey, { operators: 'Buck, Frost' });
735
+ console.log('Seasons filtered by operators:', filteredSeasonsByOperators);
736
+
737
+ // Filter seasons by weapons
738
+ const filteredSeasonsByWeapons = await r6Info.getSeasons(apiKey, { weapons: 'C8-SFW, Super 90' });
739
+ console.log('Seasons filtered by weapons:', filteredSeasonsByWeapons);
740
+
741
+ } catch (error) {
742
+ console.error('Error while requesting seasons:', error.message);
743
+ }
744
+ }
745
+
746
+ main();
747
+ ```
748
+
749
+ Retrieving all seasons by calling `getSeasons()` without any parameters.
750
+ - Filtering seasons by name using the `name` parameter.
751
+ - Filtering seasons by map using the `map` parameter.
752
+ - Filtering seasons by operators using the `operators` parameter.
753
+ - Filtering seasons by weapons using the `weapons` parameter.
754
+
755
+ ## Getting Attachment Information
756
+
757
+ The `getAttachment()` function allows you to retrieve information about the attachments available in Rainbow Six Siege. You can get a list of all attachments or filter the attachments based on specific criteria. Here's an example of how to use the `getAttachment()` function:
758
+
759
+ ```javascript
760
+ const r6Info = require('r6-data.js');
761
+
762
+ async function main() {
763
+
764
+ try {
765
+ const apiKey = 'YOUR_API_KEY';
766
+
767
+ // Get all attachments
768
+ const attachments = await r6Info.getAttachment(apiKey);
769
+ console.log('All attachments:', attachments);
770
+
771
+ // Filter attachments by name
772
+ const filteredAttachmentsByName = await r6Info.getAttachment(apiKey, { name: 'Red Dot Sight' });
773
+ console.log('Attachments filtered by name:', filteredAttachmentsByName);
774
+
775
+ // Filter attachments by style
776
+ const filteredAttachmentsByStyle = await r6Info.getAttachment(apiKey, { style: 'colour' });
777
+ console.log('Attachments filtered by style:', filteredAttachmentsByStyle);
778
+
779
+ // Filter attachments by rarity
780
+ const filteredAttachmentsByRarity = await r6Info.getAttachment(apiKey, { rarity: 'common' });
781
+ console.log('Attachments filtered by rarity:', filteredAttachmentsByRarity);
782
+
783
+ // Filter attachments by availability
784
+ const filteredAttachmentsByAvailability = await r6Info.getAttachment(apiKey, { availability: 'removed' });
785
+ console.log('Attachments filtered by availability:', filteredAttachmentsByAvailability);
786
+
787
+ } catch (error) {
788
+ console.error('Error while requesting attachments:', error.message);
789
+ }
790
+ }
791
+
792
+ main();
793
+ ```
794
+
795
+ Retrieving all attachments by calling `getAttachment()` without any parameters.
796
+ - Filtering attachments by name using the `name` parameter.
797
+ - Filtering attachments by style using the `style` parameter.
798
+ - Filtering attachments by rarity using the `rarity` parameter.
799
+ - Filtering attachments by availability using the `availability` parameter.
800
+
801
+ ## Getting Charm Information
802
+
803
+ ```javascript
804
+ const r6Info = require('r6-data.js');
805
+ const apiKey = 'YOUR_API_KEY';
806
+
807
+ // Get all charms
808
+ const charms = await r6Info.getCharms(apiKey);
809
+ console.log('All charms:', charms);
810
+
811
+ // Filter charms by specific criteria
812
+ const filteredCharms = await r6Info.getCharms(apiKey, {
813
+ name: 'Chibi',
814
+ collection: 'Year 1',
815
+ rarity: 'legendary',
816
+ availability: 'available',
817
+ bundle: 'Pro League Set',
818
+ season: 'Burnt Horizon'
819
+ });
820
+ ```
821
+
822
+ The `getCharms()` function allows you to retrieve information about the charms available in Rainbow Six Siege. You can get all charms or filter them based on specific criteria:
823
+
824
+ - `name`: Filter by charm name
825
+ - `collection`: Filter by charm collection
826
+ - `rarity`: Filter by rarity level (common, uncommon, rare, epic, legendary)
827
+ - `availability`: Filter by availability status
828
+ - `bundle`: Filter by bundle name
829
+ - `season`: Filter by season released
830
+
831
+ ## Getting Weapon Information
832
+
833
+ The `getWeapons()` function allows you to retrieve information about the weapons available in Rainbow Six Siege. You can get a list of all weapons or filter them by name. Here's an example of how to use the `getWeapons()` function:
834
+
835
+ ```javascript
836
+ const r6Info = require('r6-data.js');
837
+
838
+ async function main() {
839
+
840
+ try {
841
+ const apiKey = 'YOUR_API_KEY';
842
+
843
+ // Get all weapons
844
+ const weapons = await r6Info.getWeapons(apiKey);
845
+ console.log('All weapons:', weapons);
846
+
847
+ // Filter weapons by name
848
+ const filteredWeaponsByName = await r6Info.getWeapons(apiKey, { name: 'F2' });
849
+ console.log('Weapons filtered by name:', filteredWeaponsByName);
850
+
851
+ } catch (error) {
852
+ console.error('Error while requesting weapons:', error.message);
853
+ }
854
+ }
855
+
856
+ main();
857
+ ```
858
+
859
+ The `getWeapons()` function retrieves information about the weapons in Rainbow Six Siege. You can:
860
+
861
+ - Retrieve all weapons by calling `getWeapons()` without any parameters
862
+ - Filter weapons by name using the `name` parameter
863
+
864
+ ## Getting Universal Skin Information
865
+
866
+ The `getUniversalSkins()` function allows you to retrieve information about the universal skins available in Rainbow Six Siege. You can get a list of all universal skins or filter them by name. Here's an example of how to use the `getUniversalSkins()` function:
867
+
868
+ ```javascript
869
+ const r6Info = require('r6-data.js');
870
+
871
+ async function main() {
872
+
873
+ try {
874
+ const apiKey = 'YOUR_API_KEY';
875
+
876
+ // Get all universal skins
877
+ const universalSkins = await r6Info.getUniversalSkins(apiKey);
878
+ console.log('All universal skins:', universalSkins);
879
+
880
+ // Filter universal skins by name
881
+ const filteredSkinsByName = await r6Info.getUniversalSkins(apiKey, { name: 'Black Ice' });
882
+ console.log('Universal skins filtered by name:', filteredSkinsByName);
883
+
884
+ } catch (error) {
885
+ console.error('Error while requesting universal skins:', error.message);
886
+ }
887
+ }
888
+
889
+ main();
890
+ ```
891
+
892
+ The `getUniversalSkins()` function retrieves information about universal weapon skins in Rainbow Six Siege. You can:
893
+
894
+ - Retrieve all universal skins by calling `getUniversalSkins()` without any parameters
895
+ - Filter universal skins by name using the name parameter
896
+
897
+ ## Error Handling
898
+ The package functions throw an exception if an error occurs during API requests. Make sure to handle errors appropriately using try-catch blocks.
899
+
900
+ If the access token has expired or is invalid, an exception will be thrown with the message "Token expired or invalid". In this case, you need to obtain a new token using the getToken() function.
901
+
902
+ ## License
903
+ This package is fan made, so it has been created for only informational purposes