yahoo fantasy api

league.meta

Retrieve basic meta information about a league. Users must be authenticated and a member of the league to query against private leagues.

Description
Tester

Arguments

Argument
Description
league_key
The key for the league you'd like to query. League key format: {game_key}.l.{league_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.league.meta(league_key);
} catch (e) {
  // handle error
}

// callback based
yf.league.meta(league_key, callbackFn);

Sample Response

{
  "league_key": "328.l.34014",
  "league_id": "34014",
  "name": "Freddy Beach Baseball",
  "url": "http://baseball.fantasysports.yahoo.com/b1/34014",
  "draft_status": "postdraft",
  "num_teams": 12,
  "edit_key": "2014-11-13",
  "weekly_deadline": "intraday",
  "league_update_timestamp": "1411979069",
  "scoring_type": "head",
  "league_type": "private",
  "renew": "308_51222",
  "renewed": "",
  "short_invitation_url": "https://yho.com/mlb?l=34014&k=0a2bf56970bb200c",
  "is_pro_league": "0",
  "current_week": "25",
  "start_week": "1",
  "start_date": "2014-03-22",
  "end_week": "25",
  "end_date": "2014-09-28",
  "is_finished": 1
}