@r6stats/node
TypeScript icon, indicating that this package has built-in type declarations

4.0.0-alpha3 • Public • Published

R6Stats API Client for NodeJS

Discord npm (scoped) David

This open-source library is provided by the R6Stats team as a means of accessing the public R6Stats web API.

Installation

npm install @r6stats/node --save

If you are using an older version of the R6Stats API (v2, currently v3), you'll need to install an older version of the library.

npm install @r6stats/node@3.0.7 --save

API Key

Although the R6Stats API is currently provided free of charge, we do require an API key to maintain access control. You can obtain an API key via our Discord Server or via support@r6stats.com.

Usage

Version 3.x

import R6StatsAPI from '@r6stats/node'

// create an instance of the API client
const api = new R6StatsAPI({ apiKey: 'xxx' })
// valid platform options: pc, xbox, ps4

// get general stats (kills, deaths, etc.)
const { data: player } = await api.playerStats('KingGeorge', 'pc')
console.log(player.username, player.stats.general.kills)

// get operator stats
const { data: player } = await api.operatorStats('KingGeorge', 'pc')
console.log(player.username, player.operators[0].name, player.operators[0].kills)

// get weapon stats
const { data: player } = await api.weaponStats('KingGeorge', 'pc')
console.log(player.username, player.weapons[0].name, player.weapons[0].kills)

// get weapon category stats
const { data: player } = await api.weaponCategoryStats('KingGeorge', 'pc')
console.log(player.username, player.categories[0].category, player.categories[0].kills)

// get seasonal stats
const { data: player } = await api.seasonalStats('KingGeorge', 'pc')
// log latest season name and number of wins in the american region
console.log(player.username, player.seasons[0].name, player.seasons[0].regions.ncsa[0].wins)

License

See LICENSE

The R6Stats API Client library may be used in any project given that it does not directly compete with the R6Stats Website or its available applications. The client library is meant for individual usage only. Please direct all licensing questions to support@r6stats.com.

R6Stats is a fan-made project and is not affiliated with Ubisoft. Tom Clancy’s, Rainbow Six, The Soldier Icon, Ubisoft and the Ubisoft logo are trademarks of Ubisoft Entertainment. Google Play and the Google Play logo are trademarks of Google LLC. Apple and the Apple Logo are trademarks of Apple Inc. App Store is a service mark of Apple Inc.

Package Sidebar

Install

npm i @r6stats/node

Weekly Downloads

11

Version

4.0.0-alpha3

License

GPL-3.0

Unpacked Size

66.6 kB

Total Files

49

Last publish

Collaborators

  • jake0oo0
  • manno