Tank01 MLB Live In-Game Real Time Statistics

FREEMIUM
Verified
By tank01 | Updated hace un día | Sports
Popularity

9.8 / 10

Latency

171ms

Service Level

100%

Health Check

N/A

Back to All Discussions

Starting lineup data

Rapid account: Torielstrom
torielstrom
hace 2 meses

What is the best way to call the starting lineup for a given day.

Rapid account: Tank 01
tank01 Commented hace 2 meses

hey thanks for finding that bug! I fixed that so now it is back to normal… However, what is “normal” here is probably not going to work for you.

I can’t do exactly what you’re asking here because there are a lot of users currently calling the APIs minute by minute and they are expecting an empty body element if the game hasn’t started yet. If I add anything to that element before the game starts, then that could potentially crash production apps that my users have built.

What you can do though, is call the “Get General Game Information” endpoint as that returns a “probableStartingPitchers” element which gives you that info. Typically this is good for games that start within the next 3-4 days. And often it will be empty for one of the games in a double header, since there usually is one game where the pitcher is called up from the minors that day to fill that spot.

Hope this helps!

Rapid account: Torielstrom
torielstrom Commented hace 2 meses

This is working great if the game is in the past, but doesn’t seem to work for upcoming games. Unless this is the TBD games https://www.mlb.com/starting-lineups in which case could it return the projected starting pitchers and TBD for players?

Btw, thanks for the quick response!

20240402_SF@LAD gameID
true startingLineups

{
“errorMessage”: “‘away’”,
“errorType”: “KeyError”,
“requestId”: “fd957a62-936c-49eb-ac6b-97834e147570”,
“stackTrace”: [
" File “/var/task/lambda_function.py”, line 126, in lambda_handler\n boxScore=doStartingLineups(boxScore)\n",
" File “/var/task/lambda_function.py”, line 73, in doStartingLineups\n startingLineups[item][“team”]=bs[item]\n"
]
}

Rapid account: Tank 01
tank01 Commented hace 2 meses

Hi Torielstrom,

I just realized now that there wasn’t an easy way to determine starters/starting lineup, so I created a new parameter in getMLBBoxScore called startingLineups.
Just add startingLineups=true to your call. I’ve also added this to the example response. Let me know what you think! Thanks

Join in the discussion - add comment below:

Login / Signup to post new comments