GoSports API Server
Endpoints
Schedule
url: /schedule/{sport}
- sport: [mlb, nba, nfl, nhl]
parameters:
- date (Optional): [yyyy-mm-dd]
returns:
example:
{
content: [
{
id: <string>,
date: <2006-01-02T15:04:05Z07:00>,
status: [Scheduled, Active, Complete],
statusCode: <int>,
period: <int>,
time: <string>, //Time remaining in period/quarter, or number of outs in the inning
home: {
teamId: <string>,
name: <string>,
abbr: <string>,
record: <string>,
score: <int>
},
away: {
teamId: <string>,
name: <string>,
abbr: <string>,
record: <string>,
score: <int>
},
venue: <string>
}
]
}
Play By Play
url: /playbyplay/{sport}
- sport: [mlb, nba, nfl, nhl]
parameters:
returns (internal structure changes based on sport):
-
base information (diff)
-
array of plays (diff)
example:
{
game: {
status: {},
home: {},
away: {}
},
players: {
home: [],
away: []
},
plays: [],
metadata: {
state: <int>,
lastCheck: <string>,
}
}
NHL
{
game: {
status: {
period: <int>,
periodTimeRemaining: <int>
},
home: {
name: <string>,
score: <string>,
shots: <int>
},
away: {
name: <string>,
score: <string>,
shots: <int>
}
},
players: {
home: [
{
id: <int>,
onIceDuration: <int>,
name: <string>,
number: <string>,
position: <string>
}, ...
],
away: [
{
id: <int>,
onIceDuration: <int>,
name: <string>,
number: <string>,
position: <string>
}, ...
]
}
plays: [
{
description: <string>,
typeId: <string>
periodTime: <string>
dateTime: <string>
coordinates: {
x: <int>,
y: <int>
}
}, ...
],
metadata: {
state: <int>,
lastCheck: <string>,
}
}
Official API Documentation
NHL
Base: https://statsapi.web.nhl.com/api/v1/
-
Schedule:
-
Play by Play:
-
Play by Play Diff:
NBA
Base: https://stats.nba.com/stats/
BaseV2: http://data.nba.com/data/5s/json/cms/noseason/
-
Schedule:
-
Play by Play:
-
ScheduleV2:
-
Play by Play V2:
NFL
Base: https://www.nfl.com/
MLB
Base: https://statsapi.mlb.com/api/v1.1/
-
Schedule (API v1):
-
Endpoint: schedule
-
Parameters: [scheduleType, eventTypes, hydrate (decisions, probablePitcher(note), linescore), teamId, leagueId, sportId, gamePk, gamePks, venueIds, gameTypes, date (yyyy-mm-dd), startDate, endDate, opponentId, fields]
-
Example: http://statsapi.mlb.com/api/v1/schedule/?sportId=1&date=2019-10-30&hydrate=team
-
Play by Play (API v1.1):