Tank01 MLB Live In-Game Real Time Statistics

פרמיום
Verified
על ידי tank01 | מְעוּדכָּן 2 giorni fa | Sports
פּוֹפּוּלָרִיוּת

9.8 / 10

חֶבִיוֹן

168ms

רמת שירות

100%

Health Check

N/A

חזרה לכל הדיונים

Starting lineup data

Rapid account: Torielstrom
torielstrom
2 mesi fa

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

Rapid account: Tank 01
tank01 Commented 2 mesi fa

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 2 mesi fa

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 2 mesi fa

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

הצטרף לדיון - הוסף תגובה למטה:

התחבר / הירשם כדי לפרסם תגובות חדשות