yahoo fantasy api

team.stats

Retrieve a teams statistics. Users must be authenticated and a member of the league to query against teams of private leagues.

Description
Tester

Arguments

Argument
Description
team_key
The key for the team you'd like to query. Team key format: {game_key}.l.{league_id}.t.{team_id}
week / date
The week number or date (YYYY-MM-DD) you'd like the stats for, if nothing specified you'll get the full season statistical information.

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 stats = await yf.team.stats(team_key);
} catch (e) {
  // handle error
}

// callback based
yf.team.stats(team_key, callbackFn);

Sample Response

{
  "team_key": "328.l.34014.t.1",
  "team_id": "1",
  "name": "ChicksDigTheLongBall",
  "url": "http://baseball.fantasysports.yahoo.com/b1/34014/1",
  "team_logo": "http://l.yimg.com/dh/ap/fantasy/img/mlb/icon_6_lg.gif",
  "waiver_priority": 4,
  "number_of_moves": "19",
  "number_of_trades": 0,
  "clinched_playoffs": 1,
  "managers": [
    {
      "manager_id": "1",
      "nickname": "--hidden--",
      "guid": "RYWP7M53IC626MGOX36ZWCM4FA",
      "is_commissioner": "1"
    }
  ]
}