Class MLBClient
The MLBClient class holds all MLB Stats API endpoints that can be accessed from Baseball Sharp.
Implements
Inherited Members
Namespace: BaseballSharp
Assembly: BaseballSharp.dll
Syntax
public class MLBClient : IMLBClient
Methods
| Edit this page View SourceGetDepthChartAsync(int)
Returns a list of depth chart information for a given team. Use the GetTeamDataAsync() call to obtain the id numbers needed to satisfy the teamId parameter.
Declaration
public Task<IEnumerable<DepthChart>> GetDepthChartAsync(int teamId)
Parameters
Type | Name | Description |
---|---|---|
int | teamId | The team's ID number. |
Returns
Type | Description |
---|---|
Task<IEnumerable<DepthChart>> | A list of team objects. |
GetDivisionsAsync()
Endpoint to get the MLB divisions and associated data.
Declaration
public Task<IEnumerable<Division>> GetDivisionsAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<Division>> | A list of Division objects. |
GetLineScoreAsync(int)
Returns a list of linescore data for the game in question.
Declaration
public Task<IEnumerable<Linescore>> GetLineScoreAsync(int gameId)
Parameters
Type | Name | Description |
---|---|---|
int | gameId | The ID number of the game. |
Returns
Type | Description |
---|---|
Task<IEnumerable<Linescore>> | A list of Linescore objects. |
GetPitchingReportsAsync(DateTime)
Returns a list of pitchers and their associated game reports.
Declaration
public Task<IEnumerable<PitchingReport>> GetPitchingReportsAsync(DateTime date)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date | The date to return data for. |
Returns
Type | Description |
---|---|
Task<IEnumerable<PitchingReport>> | A list of pitching report objects |
GetScheduleAsync(DateTime)
Returns a list of the matchups and ballpark for the specified date.
Declaration
public Task<IEnumerable<Schedule>> GetScheduleAsync(DateTime date)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date | The date to return data for. |
Returns
Type | Description |
---|---|
Task<IEnumerable<Schedule>> | A list of schedule objects. |
GetTeamDataAsync()
Returns a list of all MLB teams and some associated data. The ID parameters can be used to build other queries.
Declaration
public Task<IEnumerable<Team>> GetTeamDataAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<Team>> | A list of team objects. |
GetTeamRosterAsync(int, int, DateTime, rosterType)
Returns a list of team roster data for a given season. Use the GetTeamDataAsync() call to obtain the id numbers needed to satisfy the teamId parameter.
Declaration
public Task<IEnumerable<TeamRoster>> GetTeamRosterAsync(int teamId, int season, DateTime date, rosterType roster = rosterType.rosterFull)
Parameters
Type | Name | Description |
---|---|---|
int | teamId | The team's MLB id (use enum) |
int | season | The year the season begins on |
DateTime | date | A date to use, will return the roster as of that date |
rosterType | roster | The roster type to return. Can choose either full roster, 25man or 40 man |
Returns
Type | Description |
---|---|
Task<IEnumerable<TeamRoster>> | An IEnumerable TeamRoster |