# Class: SportsDataService

## SportsDataService()

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

## Constructor

#### new SportsDataService()

Source:
  - app/services/sports_data.service.js, line 8

### Extends

- Service

### Methods

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

Resolves to the current week number of gameplay.

Source:
  - app/services/sports_data.service.js, line 26

##### Returns:

Type
  Promise.<number>

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

Fetches a list of all active teams from the sports data API.

Source:
  - app/services/sports_data.service.js, line 44

##### 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:
  - app/services/sports_data.service.js, line 54

##### 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:
  - app/services/sports_data.service.js, line 36

##### 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:
  - app/services/sports_data.service.js, line 64

##### Returns:

Type
  Promise.<Array.<any>>

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

Resolves true if the game is currently in the draft stage.

Source:
  - app/services/sports_data.service.js, line 17

##### 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:
  - app/services/sports_data.service.js, line 74

##### Returns:

Type
  string