yahoo fantasy api

player.meta

Retrieve basic meta information about a player.

Description
Tester

Arguments

Argument
Description
player_key
The key for the player you'd like to query. Player key format: {game_key}.p.{player_id}

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.player.meta(player_key);
} catch (e) {
  // handle error
}

// callback based
yf.player.meta(player_key, callbackFn);

Sample Response

{
  "player_key": "328.p.6619",
  "player_id": "6619",
  "name": {
    "full": "Albert Pujols",
    "first": "Albert",
    "last": "Pujols",
    "ascii_first": "Albert",
    "ascii_last": "Pujols"
  },
  "editorial_player_key": "mlb.p.6619",
  "editorial_team_key": "mlb.t.3",
  "editorial_team_full_name": "Los Angeles Angels",
  "editorial_team_abbr": "LAA",
  "uniform_number": "5",
  "display_position": "1B",
  "headshot": "http://l.yimg.com/iu/api/res/1.2/iium.CfIaaN.XDy7fB4Reg--/YXBwaWQ9eXZpZGVvO…g--/http://l.yimg.com/j/assets/i/us/sp/v/mlb/players_l/20130405/6619.1.jpg",
  "is_undroppable": "0",
  "position_type": "B",
  "eligible_positions": [
    "1B",
    "CI",
    "DH",
    "IF"
  ]
}