cwendt94 / espn-api

ESPN Fantasy API! (Football, Basketball)
MIT License
550 stars 184 forks source link

[hockey] get player's pro team's schedule? #248

Open erik-h opened 2 years ago

erik-h commented 2 years ago

Hello,

Thanks for creating this library! Is there currently a way to get an individual player's pro team's schedule? I want to be able to grab the goaltenders for my fantasy hockey team, check what days they're playing on, and recommend players to stream.

I see I can access the proTeam variable to get the name of the team, but I haven't found a way to grab the pro team's schedule. Is this data available from the ESPN fantasy API, or will I have to query another source for the pro team's schedule?

Thanks!

cwendt94 commented 2 years ago

Hi @erik-h, ESPN does have an API to call to get a pro team schedule however right now the League class does not have a nice interface to get the data. I could definitely add a interface, would you want to get the pro teams full schedule or just for the week or day? For right now to get the raw pro team schedule you can call this

league.espn_request.get_pro_schedule()
erik-h commented 2 years ago

Oh sweet, thanks for mentioning get_pro_schedule(), I'll check that out. If you could add support for full schedule and per-week, that would be awesome! I guess in my particular use case it'd be nice to go week-by-week, but I can see the full schedule being useful as well.