Replies: 5 comments 4 replies
-
Yes you can! After initializing the league you can get each teams player season stats.
The stats is broken down by scoring period where |
Beta Was this translation helpful? Give feedback.
-
Thanks for this! I was building something similar without the API and it is
a pain so thankful that this works.
Last question... is there a way to check my teams watchlist?
…On Fri, Apr 26, 2024 at 7:54 AM Christian Wendt ***@***.***> wrote:
Yes you can! After initializing the league you can get each teams player
season stats.
>>> from espn_api.baseball import League
>>> league = League(247106405, 2024)
>>> league.teams
[Team(awesome football team), Team(Italian Stallions), Team(What Team Is It ?), Team(Ghost), Team(Boston Bombers), Team(RiverTown Rats), Team(Christian 's Competitive Team), Team(3 Amigos), Team(brody's Beastly Team), Team(Team 10)]
>>> league.teams[6]
Team(Christian 's Competitive Team)
>>> league.teams[6].roster
[Player(Ronald Acuna Jr.), Player(Yordan Alvarez), Player(Rafael Devers), Player(George Kirby), Player(Ketel Marte), Player(Luis Arraez), Player(Logan Gilbert), Player(Raisel Iglesias), Player(Dylan Cease), Player(Jordan Montgomery), Player(Andres Munoz), Player(Paul Sewald), Player(Clay Holmes), Player(Gabriel Moreno), Player(Nick Castellanos), Player(Salvador Perez), Player(Yu Darvish), Player(Carlos Correa), Player(Carlos Rodon)]
>>> league.teams[6].roster[0]
Player(Ronald Acuna Jr.)
>>> league.teams[6].roster[0].stats
{0: {'points': 39.0, 'breakdown': {'AB': 50.0, 'H': 15.0, 'AVG': 0.3, '2B': 3.0, 'TC': 18.0, '3B': 0.0, 'PO': 18.0, 'HR': 1.0, 'A': 0.0, 'XBH': 4.0, 'OFA': 0.0, '1B': 11.0, 'FPCT': 1.0, 'TB': 21.0, 'E': 0.0, 'SLG': 0.42, 'DP': 0.0, 'B_BB': 9.0, 'B_G_W': 10.0, 'B_IBB': 0.0, 'B_G_L': 3.0, 'HBP': 2.0, 'P_G_W': 0.0, 'SF': 0.0, 'P_G_L': 0.0, 'SH': 0.0, 'PA': 61.0, 'OBP': 0.42622951, 'G': 13.0, 'OPS': 0.84622951, 'RC': 10.20946084, 'R': 11.0, 'RBI': 2.0, '22': 0.0, 'SB': 7.0, 'CS': 1.0, 'SB-CS': 6.0, 'GDP': 2.0, 'B_SO': 11.0, 'PS': 238.0, 'PPA': 3.90163934, 'CYC': 0.0},
'projected_points': 446.0, 'projected_breakdown': {'AB': 496.0, 'H': 155.0, 'AVG': 0.313, '2B': 27.0, '3B': 2.0, 'HR': 26.0, 'XBH': 55.0, '1B': 100.0, 'TB': 264.0, 'SLG': 0.532, 'B_BB': 65.0, 'B_IBB': 3.0, 'HBP': 10.0, 'SF': 3.0, 'SAC': 3.0, 'PA': 574.0, 'OBP': 0.401, 'OPS': 0.933, 'R': 104.0, 'RBI': 70.0, 'SB': 45.0, 'CS': 11.0, 'SB-CS': 34.0, 'GDP': 9.0, 'B_SO': 102.0, 'G': 124.0}}}
The stats is broken down by scoring period where 0 is the whole season.
When getting the player stats from the team class it only has the full
season. If you use box_score each player will have more in depth stats on
that matchup. I haven't had the time to create the base ball docs but the Football
Wiki <https://github.com/cwendt94/espn-api/wiki/Football-Intro> is a
close comparison.
—
Reply to this email directly, view it on GitHub
<#541 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIJAF2TBLFTTTED73TJ7MYDY7JTBVAVCNFSM6AAAAABGZFPHL2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TEMZYGM2TE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
where do you see this API data? it's something that i could potentially
help build.
…On Fri, Apr 26, 2024 at 11:15 AM Christian Wendt ***@***.***> wrote:
Great question, not currently but definitely something I could add. I see
in the API data they have a watchList field that has the playerId. What I
could probably add is a watch list field to the team class that would be a
list of player classes.
—
Reply to this email directly, view it on GitHub
<#541 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIJAF2WJEJEASHBL5K4ZURLY7KKSXAVCNFSM6AAAAABGZFPHL2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TENBQGM3DK>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
hey i noticed when pulling player stats for my own team, i'm actually not seeing the most up to date data. any thoughts why i'm only seeing ~13 games in? also player position isn't correct |
Beta Was this translation helpful? Give feedback.
-
league = League(league_id=38069, year = 2024, espn_s2=espn_s2, swid=swid)
league.teams[6].roster[0].stats
For ronald acuna, it is only showing 50 AB's.
…On Fri, Apr 26, 2024 at 2:54 PM Christian Wendt ***@***.***> wrote:
Hmm could you give me an example for both the issues. Make it easier to
debug and see whats going on.
Baseball functionality is one of the newer additions so definitely could
be some values off/bugs
—
Reply to this email directly, view it on GitHub
<#541 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIJAF2RBUPBAFW2STYQE5UTY7LEH5AVCNFSM6AAAAABGZFPHL2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TENBRG44DI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
hey, is it possible to use this API to find the stats of players for the season along with their projected stats?
Beta Was this translation helpful? Give feedback.
All reactions