yahoo fantasy api

game.meta

Retrieve basic meta information about a 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.meta(game_key);
} catch (e) {
  // handle error
}

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

Sample Response

{
  "game_key": "328",
  "game_id": "328",
  "name": "Baseball",
  "code": "mlb",
  "type": "full",
  "url": "http://baseball.fantasysports.yahoo.com/b1",
  "season": "2014"
}