new Client(key, defaultShardopt)
The main hub for interacting with the pubg api, and starting point for any api instance
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
key |
string
|
PUBG app api token | ||
defaultShard |
string
|
<optional> |
'pc-oc' | Default shard to use if none provided in methods |
Members
Methods
getMatch(id, shardopt) → {Promise.<Match>}
Get a match from a match id
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
string
|
Id of the match to get | ||
shard |
string
|
<optional> |
this.defaultShard | The server shard to send the request to |
Returns:
- Type:
-
Promise.<Match>
getPlayer(args, shardopt) → {Promise.<Array.<Player>>|Promise.<Player>}
Get player by the given id or name
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
args |
Object
|
Specify what player to get * {id: ['id1', 'id2']} * {id: 'id'} * {name: 'name'} * {name: ['name1', 'name2']} | ||
shard |
string
|
<optional> |
this.defaultShard | The server shard to send the request to |
getPlayerSeason(player, season, shardopt) → {Promise.<PlayerSeason>}
Get a player season object
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
player |
string
|
Player
|
The player of the player season | ||
season |
string
|
Season
|
The season of the player season | ||
shard |
string
|
<optional> |
player.attributes.shardId|this.defaultShard | The server shard to send the request to |
Returns:
- Type:
-
Promise.<PlayerSeason>
getSamples(createdAtopt, shardopt) → {Promise.<Array.<Match>>}
Gets a list of all past matches from the api
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
createdAt |
Date
|
<optional> |
The starting search date for the matches | |
shard |
string
|
<optional> |
this.defaultShard | The server shard to send the request to |
Returns:
- Type:
-
Promise.<Array.<Match>>
getSeasons(shardopt) → {Promise.<Array.<Season>>}
Get an array of all seasons of the shard
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
shard |
string
|
<optional> |
this.defaultShard | The server shard to send the request to |
Returns:
- Type:
-
Promise.<Array.<Season>>
getTelemetry(url) → {Promise.<Object>}
Fetches telemetry data object
Parameters:
Name | Type | Description |
---|---|---|
url |
string
|
URL of the telemetry object |
Returns:
- Type:
-
Promise.<Object>
getTournament(id) → {Promise.<Tournament>}
Gets the tournament with the matching id
Parameters:
Name | Type | Description |
---|---|---|
id |
string
|
Tournament ID |
Returns:
- Type:
-
Promise.<Tournament>
getTournaments() → {Promise.<Array.<Tournament>>}
Gets a list of all tournaments
Returns:
- Type:
-
Promise.<Array.<Tournament>>