Events

Last updated April 27, 2016

This is a lightweight endpoint that returns the list of events for (usually) the current date (Eastern time). This endpoint should be used to determine whether box scores are available to download. Box scores are available to download only when their event_status is completed and the season_type is either regular or post.

Include the optional date parameter to return events for a specific date.

The earliest date for MLB events is 2008‑03‑25. The earliest date for NBA events is 2011‑12‑16. By default, all events are returned, but may be filtered by including an optional sport parameter.

URL

GET /events.format

Format

  1. json

Authorization

Required. A valid access token must be included in the header of the request.

Parameters

Name Required Description
date optional The date using yyyyMMdd format
sport optional Returns events for specified sport only. Acceptable values are nba and mlb

Returned Values

Name Type Description
events_date string Date and time representation of result using W3C's recommended ISO 8601 format yyyy‑MM‑DDTHH:mm:ss±hh:mm (e.g., 2013‑03‑18T00:00:00‑04:00).
count integer The total number of events occurring on this date. If a sport parameter is used, the total will only include events for that sport. Be aware, this number does not partition further based on season_type. It is the total of all pre, regular, and post season events scheduled for the specified date.
event array of objects Array of Event objects

Example Request

curl --compressed -H "Authorization: Bearer ACCESS_TOKEN" "https://erikberg.com/events.json?date=20130131&sport=nba"

Example Result

{
  "events_date" : "2013-01-31T00:00:00-08:00",
  "events_count" : 2,
  "event" : [ {
    "event_id" : "20130131-memphis-grizzlies-at-oklahoma-city-thunder",
    "event_status" : "completed",
    "sport" : "NBA",
    "start_date_time" : "2013-01-31T17:00:00-08:00",
    "season_type" : "regular",
    "away_team" : {
      "team_id" : "memphis-grizzlies",
      "abbreviation" : "MEM",
      "active" : true,
      "first_name" : "Memphis",
      "last_name" : "Grizzlies",
      "conference" : "West",
      "division" : "Southwest",
      "site_name" : "FedExForum",
      "city" : "Memphis",
      "state" : "Tennessee",
      "full_name" : "Memphis Grizzlies"
    },
    "home_team" : {
      "team_id" : "oklahoma-city-thunder",
      "abbreviation" : "OKC",
      "active" : true,
      "first_name" : "Oklahoma City",
      "last_name" : "Thunder",
      "conference" : "West",
      "division" : "Northwest",
      "site_name" : "Chesapeake Energy Arena",
      "city" : "Oklahoma City",
      "state" : "Oklahoma",
      "full_name" : "Oklahoma City Thunder"
    },
    "site" : {
      "capacity" : 19599,
      "surface" : "Hardwood",
      "name" : "Chesapeake Energy Arena",
      "state" : "Oklahoma",
      "city" : "Oklahoma City"
    },
    "away_period_scores" : [ 22, 12, 33, 22 ],
    "home_period_scores" : [ 32, 26, 21, 27 ],
    "away_points_scored" : 89,
    "home_points_scored" : 106
  }, {
    "event_id" : "20130131-dallas-mavericks-at-golden-state-warriors",
    "event_status" : "completed",
    "sport" : "NBA",
    "start_date_time" : "2013-01-31T19:30:00-08:00",
    "season_type" : "regular",
    "away_team" : {
      "team_id" : "dallas-mavericks",
      "abbreviation" : "DAL",
      "active" : true,
      "first_name" : "Dallas",
      "last_name" : "Mavericks",
      "conference" : "West",
      "division" : "Southwest",
      "site_name" : "American Airlines Center",
      "city" : "Dallas",
      "state" : "Texas",
      "full_name" : "Dallas Mavericks"
    },
    "home_team" : {
      "team_id" : "golden-state-warriors",
      "abbreviation" : "GS",
      "active" : true,
      "first_name" : "Golden State",
      "last_name" : "Warriors",
      "conference" : "West",
      "division" : "Pacific",
      "site_name" : "Oracle Arena",
      "city" : "Oakland",
      "state" : "California",
      "full_name" : "Golden State Warriors"
    },
    "site" : {
      "capacity" : 19596,
      "surface" : "Hardwood",
      "name" : "Oracle Arena",
      "state" : "California",
      "city" : "Oakland"
    },
    "away_period_scores" : [ 23, 30, 26, 18 ],
    "home_period_scores" : [ 28, 27, 25, 20 ],
    "away_points_scored" : 97,
    "home_points_scored" : 100
  } ]
}