Fantasy Points v2.0

Summary
Fantasy Points
Resource
Fantasy PointsFantasy Points for players by timeframe and period based on a league’s scoring system
Change Log
January 15, 2013
HTTP Methods
GETRetrieve fantasy points for players by timeframe and period
Exceptions
Following list of exceptions will be returned.
Example
Retrieve Fantasy Points for 2012 Projections
XML field definitions
/fantasy_pointsA container element for the fantasy points.
/fantasy_points/playersA container element for the players.
/fantasy_points/players/playerA containter element for the player whose fantasy points are displayed.
/fantasy_points/players/player/@idThe ID of the player.
/fantasy_points/players/FPTSThe Fantasy Points for the player.

Resource

Fantasy Points

Description

Fantasy Points for players by timeframe and period based on a league’s scoring system

Change Log

January 15, 2013

  • Renamed param playerid to player_id
  • Added exceptions

HTTP Methods

GET

Retrieve fantasy points for players by timeframe and period

URL

http://api.cbssports.com/fantasy/league/fantasy-points?version=2.0

Parameters

response_format(optional) Specifies the format in which the requested resource should be returned.  Valid values are XML and JSON.  The default is XML.
timeframeYear for which fantasy points are being requested.  Timeframe can be any of the past 10 years including current in YYYY format.
periodPeriod for which fantasy points are being requested Period can be one of the following values.
  • ytd (Year-to-Date)
  • 3yr (Last 3 Years Average)
  • any period number for current year
  • projections
  • any date in YYYYMMDD format
player_id(optional, multiple allowed and can be passed as comma-delimited list - defaults to all players) Limit the result set to players with ids specified in this param

Exceptions

Following list of exceptions will be returned.

  • type: required_parameter, msg: Missing required param: timeframe
  • type: required_parameter, msg: Missing required param: period
  • type: invalid_player_id, msg: Invalid player_id <player_id>

Example

Retrieve Fantasy Points for 2012 Projections

Sample URL

http://api.cbssports.com/fantasy/league/fantasy-points?version=2.0&period=projections&timeframe=2012

XML Response

Note: Not all players are shown in the sample below.

<?xml version="1.0"?>
<result uriAlias="/league/fantasy-points" uri="/league/fantasy-points" statusCode="200" statusMessage="OK">
    <body>
    <fantasy_points>
        <players>
        <player id="223571">
            <FPTS>699</FPTS>
        </player>
        <player id="477983">
            <FPTS>331</FPTS>
        </player>
        </players>
    </fantasy_points>
    </body>
</result>

JSON Response

Note: Not all players are shown in the sample below.

{
    "body": {
        "fantasy_points": {
            "350": "2865",
            "7652": 23,
            "11412": 9,
            "29429": 0,
            "136232": "182",
            "292036": 12,
            "292182": 56,
            "387401": 3,
            "392080": "445",
            "392915": 0,
            "393372": "150",
            "393412": 0,
            "477983": "331",
            "489802": 0,
            "548280": 0,
            "593273": 0,
            "1098957": 12,
            "1098985": 3,
            "1104370": 0,
            "1104951": 36,
            "1208748": "316",
            "1209001": 0,
            "1225749": "144",
            "1392902": 0,
            "1531181": 0,
            "1603008": 0,
            "1603347": 0,
            "1647773": 0,
            "1654375": 0,
            "1669884": 0,
            "1725414": -1,
            "1740961": 0,
            "1741002": 0,
            "1804330": 0
        }
    },
    "uriAlias": "/league/fantasy-points",
    "statusMessage": "OK",
    "uri": "/league/fantasy-points",
    "statusCode": 200
}

XML field definitions

/fantasy_points

A container element for the fantasy points.

/fantasy_points/players

A container element for the players.

/fantasy_points/players/player

A containter element for the player whose fantasy points are displayed.

/fantasy_points/players/player/@id

The ID of the player.  You can use this ID to get more information about the player by requesting the Player Outlook resource or the Player Updates resource.

/fantasy_points/players/FPTS

The Fantasy Points for the player.