The SDK is organized in resources. Each method below includes a copy-paste example.
Base Setup
const { R6Client } = require('r6-data.js'); const r6 = new R6Client({ apiKey: process.env.R6DATA_API_KEY }); Players Resource (r6.players) METHOD r6.players.getAccountInfo(params) Retrieve player profile data.
const accountInfo = await r6.players.getAccountInfo({ nameOnPlatform: 'PlayerName', platformType: 'uplay' }); METHOD r6.players.getIsBanned(params) Check if a player is currently banned.
const banStatus = await r6.players.getIsBanned({ nameOnPlatform: 'PlayerName', platformType: 'uplay' }); METHOD r6.players.getPlayerStats(params) Retrieve detailed gameplay statistics (optionally filtered by board).
const rankedStats = await r6.players.getPlayerStats({ nameOnPlatform: 'PlayerName', platformType: 'uplay', platform_families: 'pc', board_id: 'ranked' }); METHOD r6.players.getPlayerComparisons(params) Compare statistics between multiple players.
const comparison = await r6.players.getPlayerComparisons({ players: [ { nameOnPlatform: 'Player1', platformType: 'uplay' }, { nameOnPlatform: 'Player2', platformType: 'uplay' } ], platform_families: 'pc', board_id: 'ranked' }); METHOD r6.players.getSeasonalStats(params) Get rank points history and seasonal progression for a player.
const seasonalStats = await r6.players.getSeasonalStats({ nameOnPlatform: 'PlayerName', platformType: 'uplay' }); METHOD r6.players.getOperatorStats(params) Get detailed operator statistics for a player.
const operatorStats = await r6.players.getOperatorStats({ nameOnPlatform: 'PlayerName', platformType: 'uplay', seasonYear: 'Y9S4', modes: 'ranked' }); Game Resource (r6.game) METHOD r6.game.getGameStats() Real-time player count statistics across platforms.
const gameStats = await r6.game.getGameStats(); METHOD r6.game.getMaps(params?) Retrieve maps list and optionally filter by parameters.
const maps = await r6.game.getMaps(); const mapsByName = await r6.game.getMaps({ name: 'Bank' }); const mapsByPlaylist = await r6.game.getMaps({ playlists: 'ranked' }); METHOD r6.game.getOperators(params?) Retrieve operators list and optionally filter by parameters.
const operators = await r6.game.getOperators(); const ash = await r6.game.getOperators({ name: 'Ash' }); const recruit = await r6.game.getOperators({ safename: 'recruit' }); METHOD r6.game.getSeasons(params?) Retrieve seasons list and optionally filter by parameters.
const seasons = await r6.game.getSeasons(); const blackIce = await r6.game.getSeasons({ name: 'Black Ice' }); const byMap = await r6.game.getSeasons({ map: 'Yacht' }); METHOD r6.game.getWeapons(params?) Retrieve weapons list and optionally filter by parameters.
const weapons = await r6.game.getWeapons(); const weaponByName = await r6.game.getWeapons({ name: 'AK-12' }); METHOD r6.game.getCharms(params?) Retrieve charms list and optionally filter by parameters.
const charms = await r6.game.getCharms(); const charmByName = await r6.game.getCharms({ name: 'Pro League' }); METHOD r6.game.getUniversalSkins(params?) Retrieve universal weapon skins list and optionally filter by parameters.
const skins = await r6.game.getUniversalSkins(); const skinByName = await r6.game.getUniversalSkins({ name: 'Black Ice' }); METHOD r6.game.getAttachment(params?) Retrieve weapon attachments list and optionally filter by parameters.
const attachments = await r6.game.getAttachment(); const attachmentByName = await r6.game.getAttachment({ name: 'Holo' }); METHOD r6.game.getRanks(params) Retrieve rank images and MMR boundaries for a ranked system version.
const ranksV7 = await r6.game.getRanks({ version: 'v7' }); const filteredRanks = await r6.game.getRanks({ min_mmr: 2000, max_mmr: 2500, version: 'v7' }); METHOD r6.game.getSearchAll(query) Search across all R6 entities simultaneously.
const searchResults = await r6.game.getSearchAll('black ice'); METHOD r6.game.getServiceStatus() Retrieve the current status of Rainbow Six Siege game servers.
const status = await r6.game.getServiceStatus(); Webhooks Resource (r6.webhooks) METHOD r6.webhooks.createDiscordR6Webhook(webhookUrl, playerStats, options) Send player statistics to a Discord webhook as a rich embed.
const playerStats = await r6.players.getPlayerStats({
nameOnPlatform: 'PlayerName',
platformType: 'uplay',
platform_families: 'pc'
});
const webhookResult = await r6.webhooks.createDiscordR6Webhook(
'https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN',
playerStats,
{
playerName: 'PlayerName',
title: 'Rainbow Six Siege Stats',
message: 'Here are the latest R6 stats!',
color: 0xF99E1A
}
);