Class: hw2/stats

hw2/stats


new hw2/stats()

Creates a stats object

Members


_http

Initializes a new HttpWrapper with API Key

Methods


matchEvents(ID)

Parameters:
Name Type Description
ID Number of match
Returns:
Promise of JSON from API
Type
Promise
Example
halo.hw2.stats.matchEvents(ID).then( (events) => {
  //Do code here
});

matchResult(ID)

Parameters:
Name Type Description
ID Number of match
Returns:
Promise of JSON from API
Type
Promise
Example
halo.hw2.stats.matchResults(ID).then( (results) => {
  //Do code here
});

playerCampaignProgress(Name)

Parameters:
Name Type Description
Name String of player
Returns:
Promise of JSON from API
Type
Promise
Example
halo.hw2.stats.playerCampaignProgress('player').then( (progress) => {
  //Do code here
});

playerMatchHistory(Name, Match, Index, Count)

Parameters:
Name Type Description
Name String of player
Match String Type (default all)
Index number of match to start on (default 0)
Count number of items to return (default 25)
Returns:
Promise of JSON from API
Type
Promise
Example
halo.hw2.stats.playerMatchHistory('player', 'matchmaking', 0, 10).then( (matches) => {
  //Do code here
});

playerPlaylistRatings(ID, Comma-separated)

Returns Player Playlist Ratings
The ID that this wants can be obtained throuth the 'metadata' and then 'playlists'
In the metadata JSON the ID is referred to as 'Identity' (NOT 'ID') and looks like a177b19a32164962abdc4653dfb7911b
https://developer.haloapi.com/docs/services/58acdf27e2f7f71ad0dad84b/operations/Halo-Wars-2-Player-Playlist-Ratings?
Parameters:
Name Type Description
ID String of playlist
Comma-separated String list of players
Returns:
Promise of JSON from API
Type
Promise
Example
halo.hw2.stats.playerPlaylistRatings('a177b19a32164962abdc4653dfb7911b', 'player1,player2').then( (ratings) => {
  //Do code here
});

playerSeasonStatsSummary(Name, ID)

Parameters:
Name Type Description
Name String of player
ID String of season
Returns:
Promise of JSON from API
Type
Promise
Example
halo.hw2.stats.playerSeasonStatsSummary(ID, players).then( (stats) => {
  //Do code here
});

playerStatsSummary(Name)

Parameters:
Name Type Description
Name String of player
Returns:
Promise of JSON from API
Type
Promise
Example
halo.hw2.stats.playerStatsSummary(player).then( (stats) => {
  //Do code here
});

playerXPs(Name)

Parameters:
Name Type Description
Name String of player
Returns:
Promise of JSON from API
Type
Promise
Example
halo.hw2.stats.playerXPs(player).then( (xps) => {
  //Do code here
});