Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q: Current Team Roster #27

Closed
jethrolam opened this issue Apr 2, 2017 · 6 comments
Closed

Q: Current Team Roster #27

jethrolam opened this issue Apr 2, 2017 · 6 comments

Comments

@jethrolam
Copy link

I am wondering how to retrieve the current roster for each team? This information is not related to any stat or game, and I also can't find such information from mlbgame.teams().

I believe I can estimate the current roster by looking at the player_stats() of the most recent played game. But again, that will be an estimate.

Thank you for creating this wonderful API.

@panzarino
Copy link
Owner

panzarino commented Apr 2, 2017

I'm not sure if there is a way to get this information, but I will look around to see if mlb has the data somewhere

@trevor-viljoen
Copy link
Contributor

Looks like players.xml in the game directory contains the coaching staff, bullpen catchers, 25-man roster plus anyone on the DL.

Here's an example: http://gd2.mlb.com/components/game/mlb/year_2017/month_04/day_15/gid_2017_04_15_houmlb_oakmlb_1/players.xml

http://mlb.mlb.com/mlb/fantasy/injuries/#team117
http://mlb.mlb.com/mlb/fantasy/injuries/#team133

I haven't found a simple way to get the 40-man roster yet.

@panzarino
Copy link
Owner

That's on a per game basis, but I guess mlb.com must just use the data from the most recent game, so they keep creating a new xml file for each game rather than update a centralized one (I assume). That makes it a lot harder to consistently be able to get the most up to date roster, as the only way to get it would be that 25-man roster from the most recent game.

Not sure how I should go about implementing this feature, any thoughts? Looks like the only way to do it now is on a per game basis, where the user could get the player information by passing a game id as a parameter.

@panzarino
Copy link
Owner

@DigitalSaint very interesting... I will definitely work on implementing that relatively soon.

@panzarino
Copy link
Owner

Closing since this has been implemented into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants