Show / Hide Table of Contents

Class MLBClient

The MLBClient class holds all MLB Stats API endpoints that can be accessed from Baseball Sharp.

Inheritance
object
MLBClient
Implements
IMLBClient
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: BaseballSharp
Assembly: BaseballSharp.dll
Syntax
public class MLBClient : IMLBClient

Methods

| Edit this page View Source

GetDepthChartAsync(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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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

Implements

IMLBClient
  • Edit this page
  • View Source
In this article
  • Methods
    • GetDepthChartAsync(int)
    • GetDivisionsAsync()
    • GetLineScoreAsync(int)
    • GetPitchingReportsAsync(DateTime)
    • GetScheduleAsync(DateTime)
    • GetTeamDataAsync()
    • GetTeamRosterAsync(int, int, DateTime, rosterType)
  • Implements
Back to top Generated by DocFX