GET events/summary

Description

Returns a summary of at-bats/events that meet the search criteria.

Resource URL

http://clutchwin.com/api/v1/events/summary.json

Parameters

Field Default Description

season

optional
Only events for the specified season will be returned.

start_date

optional
Specifies the beginning of the time period for which events should be returned. Format: YYYY-MM-DD

end_date

optional
Specifies the end of the time period for which events should be returned. Format: YYYY-MM-DD

game_type

optional
regular Filters the list for a particular type of game (regular, all-star, or post-season). Valid values: asg, post, regular.

away_team_id

optional
Return only events where the specified team is the visiting team.

home_team_id

optional
Return only events where the specified team is the home team.

bat_team_id

optional
Return only events where the specified team is batting.

fld_team_id

optional
Return only events where the specified team is in the field.

bat_id

optional
Return only events where the specified player was batting.

pit_id

optional
Return only events where the specified player was pitching.

bat_hand_cd

optional
Return only events where the batter was batting from the left/right side. Valid values: r, l.

pit_hand_cd

optional
Return only events where the pitcher threw from the left/right side. Valid values: r, l.

event_cd

optional
Return only events with a specific outcome. Valid values: 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23.

include

optional
To include more details on the Game, Batter or Pitcher, specify include=batter or include=game,pitcher. You can also use the following syntax: include[]=batter&include[]=pitcher.

group

optional
Specify a field (or list of fields) in the events table to group the results by that field. For example, specify 'fld_team_id' to get a summary of a player's stats for each of the teams that he faced. For more than one field, separate the entries with a comma, or you can also specify multiple items with this syntax: group[]=fld_team_id&group[]=retro_game_id.

max_entries

optional
100 Number of entries to return per request.

start_index

optional
1 The index of the first entry to be returned (used for paging).

Example Requests

Return Chris Davis' batting totals against left-handed pitchers in 2013.

GET

http://clutchwin.com/api/v1/events/summary.json?season=2013&bat_id=davic003&pit_hand_cd=l&access_token=[token]

Response:

[
  {
    "g": 103,
    "ab": 217,
    "h": 51,
    "r": 0,
    "k": 74,
    "sb": 0,
    "di": 0,
    "cs": 2,
    "pk": 1,
    "wp": 4,
    "pb": 0,
    "bk": 1,
    "bb": 14,
    "ibb": 0,
    "hbp": 4,
    "xi": 0,
    "roe": 1,
    "h_1b": 25,
    "h_2b": 13,
    "h_3b": 0,
    "hr": 13,
    "rbi_ct": 45,
    "bat_event": 239,
    "sh": 0,
    "sf": 4,
    "dp": 4,
    "tp": 0,
    "gidp": 3
  }
]
              

Resource Information

Rate Limited? No
Requests per rate limit window N/A
Response Formats json, xml
HTTP Methods GET
Resource family events
API Version API v1.0