Class: SportsDataService

SportsDataService()

A service class for interacting with data from the SportsDataIO API.

Constructor

new SportsDataService()

Source:

Extends

  • Service

Methods

(async) current_play_week() → {Promise.<number>}

Resolves to the current week number of gameplay.
Source:
Returns:
Type
Promise.<number>

(async) get_active_teams() → {Promise.<Array.<any>>}

Fetches a list of all active teams from the sports data API.
Source:
Returns:
Type
Promise.<Array.<any>>

(async) get_request(path, baseopt) → {Promise.<any>}

Make a get request to the sports data API.
Parameters:
Name Type Attributes Default Description
path string
base string <optional>
'scores' the API domain (scores, projections, &c.)
Source:
Returns:
Type
Promise.<any>

(async) get_team_players(team_key) → {Promise.<Array.<any>>}

Fetches a list of all players on the given team from the sports data API.
Parameters:
Name Type Description
team_key string
Source:
Returns:
Type
Promise.<Array.<any>>

(async) get_week_player_stats(week_num) → {Promise.<Array.<any>>}

Fetches a list of player stats for all players in the league for the given week.
Parameters:
Name Type Description
week_num number
Source:
Returns:
Type
Promise.<Array.<any>>

(async) is_draft_stage() → {Promise.<boolean>}

Resolves true if the game is currently in the draft stage.
Source:
Returns:
Type
Promise.<boolean>

url(path, baseopt) → {string}

Resolve an endpoint and an API domain to a fully-qualified URL to the sports data API.
Parameters:
Name Type Attributes Default Description
path string
base string <optional>
'scores' the API domain (scores, projections, &c.)
Source:
Returns:
Type
string