yahoo fantasy api

game.roster_positions

Retrieve a detailed description of all roster positions in specified game.

Description
Tester

Arguments

Argument
Description
game_key
Key for the game you want to query. You can find a list of common game_ids in the official Yahoo! Fantasy Sports documentation for the game resource. Game key examples: 'mlb', 'nfl', 328 (2014 MLB season), 242 (2010 NFL season)

How to use

const YahooFantasy = require('yahoo-fantasy');
const yf = new YahooFantasy(
  Y!APPLICATION_KEY,
  Y!APPLICATION_SECRET,
  tokenCallbackFn, // optional
  redirectUri // optional
);

yf.setUserToken(
  Y!OAuthAccessToken
);

// promise based
try {
  const meta = await yf.game.roster_positions(game_key);
} catch (e) {
  // handle error
}

// callback based
yf.game.roster_positions(game_key, callbackFn);

Sample Response

{
  "game_key": "341",
  "game_id": "341",
  "name": "Hockey",
  "code": "nhl",
  "type": "full",
  "url": "http://hockey.fantasysports.yahoo.com/hockey",
  "season": "2014",
  "roster_positions": [
    {
      "position": "C",
      "abbreviation": "C",
      "display_name": "Center",
      "position_type": "P"
    },
    {
      "position": "LW",
      "abbreviation": "LW",
      "display_name": "Left Winger",
      "position_type": "P"
    },
    {
      "position": "RW",
      "abbreviation": "RW",
      "display_name": "Right Winger",
      "position_type": "P"
    },
    {
      "position": "W",
      "abbreviation": "W",
      "display_name": "Winger",
      "position_type": "P"
    },
    {
      "position": "F",
      "abbreviation": "F",
      "display_name": "Forward",
      "position_type": "P"
    },
    {
      "position": "D",
      "abbreviation": "D",
      "display_name": "Defenseman",
      "position_type": "P"
    },
    {
      "position": "Util",
      "abbreviation": "Util",
      "display_name": "Utility",
      "position_type": "P"
    },
    {
      "position": "G",
      "abbreviation": "G",
      "display_name": "Goalie",
      "position_type": "G"
    },
    {
      "position": "BN",
      "abbreviation": "BN",
      "display_name": "Bench",
      "is_bench": 1
    },
    {
      "position": "IR",
      "abbreviation": "IR",
      "display_name": "Injured Reserve",
      "is_disabled_list": 1
    },
    {
      "position": "IR+",
      "abbreviation": "IR+",
      "display_name": "IR or Day-to-Day"
    },
    {
      "position": "NA",
      "abbreviation": "NA",
      "display_name": "Not Active"
    }
  ]
}