Client

Client

new Client(key, defaultShardopt)

The main hub for interacting with the pubg api, and starting point for any api instance
Source:
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

defaultShard

The default shard for the client if none provided
Source:

key :string

The api key passed into the client
Source:
Type:
  • string

Methods

getMatch(id, shardopt) → {Promise.<Match>}

Get a match from a match id
Source:
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
Source:
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
Returns:
Type:
Promise.<Array.<Player>> | Promise.<Player>

getPlayerSeason(player, season, shardopt) → {Promise.<PlayerSeason>}

Get a player season object
Source:
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
Source:
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
Source:
Parameters:
Name Type Attributes Default Description
shard string <optional>
this.defaultShard The server shard to send the request to
Returns:
Type:
Promise.<Array.<Season>>

getStatus() → {Promise.<Status>}

Gets the status of the api
Source:
Returns:
Type:
Promise.<Status>

getTelemetry(url) → {Promise.<Object>}

Fetches telemetry data object
Source:
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
Source:
Parameters:
Name Type Description
id string Tournament ID
Returns:
Type:
Promise.<Tournament>

getTournaments() → {Promise.<Array.<Tournament>>}

Gets a list of all tournaments
Source:
Returns:
Type:
Promise.<Array.<Tournament>>