API reference https://rankade.com/api
yarn add rankade-js-api
In order to use API for your group you need to obtain API credentials by following that instructions https://rankade.com/api#intro
'use strict'
const Rankade = require('rankade-js-lib')
// obtain credentials from group's API setting page
const rankade = new Rankade(
'https://api.endpoint',
'key',
'secret',
1500 // timeout
)
rankade.auth.auth()
.then(success => {
rankade.quota.quota()
.then(success => {
let quota = success.data.success
console.log(quota)
}).catch(error => {
let errorFound = rankade.errors.parse(error)
console.log(errorFound)
})
}).catch(error => {
let errorFound = rankade.errors.parse(error)
console.log(errorFound)
})
rankade.auth.auth()
perform authentication and obtain the JWT token used for other API callsrankade.auth.getAccessToken()
retrieve the JWT token stringrankade.auth.setAccessToken(token)
set the JWT token stringrankade.auth.isExpired()
check if the token provided with therankade.auth.auth()
method is expired or not
rankade.games.popular()
retrieve rankade's popular gamesrankade.games.list()
retrieve group's gamesrankade.games.search(name)
search a game by giving a name or part ofrankade.games.create(name)
create a game by name and retrieve it
rankade.matches.create(matches, dryrun)
create matches by giving an array of objects accordant to specifications https://rankade.com/api#post-matches-match (see below the Match's object properties detail captcher)rankade.matches.exists(id)
check if a match already existsrankade.matches.status()
retrieve matches' queue/elaboration statusrankade.matches.list(subset = 'main', page = 1)
retrieve group's matches
rankade.players.players(page)
retrieve group's playersrankade.players.player(name)
create a ghost player
rankade.subsets.list()
retrieve group's subsets
rankade.rankings.list(subset = 'main', match = 'last', page = 1)
retrieve group's rankings
rankade.quota.quota()
retrieve group's API quota usage
- 2022-06-03 dependencies packages upgrade to latest version
- 2021-09-29 dependencies packages upgrade
- 2020-12-15 error object check in parse() function, readme edits
- 2020-07-18 reformat code
- 2020-04-01 added the
rankade.matches.list
method - 2019-08-21 added the
rankade.rankings.list and rankade.subsets.list
methods - 2019-08-08 added the
rankade.players.player(name)
method - 2019-06-26 added the
rankade.auth.setAccessToken(token)
method and updated the readme file - 2019-06-18 added the
rankade.setKey(key)
,rankade.setSecret(secret)
methods and players pagination - 2019-05-29 added the
rankade.auth.isExpired()
method and updated the readme file - 2019-05-23 api errors parsing
- 2019-05-22 started implementation of basic calls