toddrob99 / MLB-StatsAPI

Python wrapper for MLB Stats API
GNU General Public License v3.0
513 stars 98 forks source link

team stats #113

Closed gjj07 closed 1 year ago

gjj07 commented 1 year ago

is there a function to get pitcher stats and team stats by year? Thank you

toddrob99 commented 1 year ago

For team stats, use statsapi.get() with the stats endpoint. The available statTypes are available with statsapi.meta("statTypes") -- you may be interested in season. There are examples on reddit and probably in the closed issues in this repo.

For player stats, you can use statsapi.player_stat_data().