toddrob99/MLB-StatsAPI

[QUESTION] Is it possible to display the innings with the StatsAPI?

ABUCKY0 opened this issue · 1 comments

[QUESTION] Is it possible to display the innings with the StatsAPI?

You can find inning data (e.g. to build a linescore) in the game endpoint. You'll find it in the response under game["liveData"]["linescore"].

game = statsapi.get("game", {"gamePk": 719124})
linescore_data = game["liveData"]["linescore"]

If linescore is what you're after, you can also get a formatted linescore using this library's linescore method. You can see how this method retrieves and parses the data here