0

Players by Stat Type

Simple question, is there an easy way to get players by stat PositionType, or to tell, without iterating the player's stats (I'm trying to make this flexible), to determine if a player is of a specific PositionType?

Basically, I want to be able to group the Roster into, for example, Pitchers, etc. Or say Skaters and Goalies, etc etc. in the easiest way without having to code against the specific game type (ex: hockey = P & G..) and preferably without iterating each player.

5 Replies
  • This doesn't seem to be in any of the resources returned by the API, but +1 for this being useful. So far, I've coded this specific to each game type, knowing that 1B, 2B, etc. are all Hitters and RP and SP are Pitchers. Would definitely be better to have this information provided, so that this didn't have to be hard coded and computed in every app that uses this service.
    0
  • I agree, I ended up having to just group players by their list of player stats with LINQ to get them grouped by their stat type, it would save a lot of time if I could use that flag as a comparable on a player rather than the stats list. That said, I suppose one could get the groupings the first time, then cache the mapping of player position to stat type for future use.
    0
  • QUOTE (xsicxtransitx @ Jun 27 2011, 04:22 PM) <{POST_SNAPBACK}>
    I agree, I ended up having to just group players by their list of player stats with LINQ to get them grouped by their stat type, it would save a lot of time if I could use that flag as a comparable on a player rather than the stats list. That said, I suppose one could get the groupings the first time, then cache the mapping of player position to stat type for future use.

    Ha, I was just talking about that with some of our mobile developers. Current thoughts: either add a position_type element to the player metadata for each player, or add a top level resource to describe roster positions better, including the mapping to each position type for each roster position. That would be either at the league level (league settings) or maybe a new resource at the game level. Do you guys have any preferences either way about which option is easier to use/understand? Heck, I might do both, just curious how you would prefer to see that sort of data.
    0
  • I like the idea of the position_type element on the player or the mapping of roster positions to position_type at the league level, either works for me, but the easiest to work with might be the position_type on the player, but that is strictly from my own current design since I could simply LINQ group over POSITION_TYPE on player and on stats to represent each player table.
    0
  • FYI: you should now see a <position_type> element for every player, and we've also added <position_types> and <roster_positions> subresources beneath the game resource. So you guys should be able to get all the info you need about player position type mappings. :)

    (and the docs have been updated to reflect those changes, yeah!)

    QUOTE(xsicxtransitx @ 20 Jul 2011 10:35 AM)
    I like the idea of the position_type element on the player or the mapping of roster positions to position_type at the league level, either works for me, but the easiest to work with might be the position_type on the player, but that is strictly from my own current design since I could simply LINQ group over POSITION_TYPE on player and on stats to represent each player table.
    0

Recent Posts

in Fantasy Sports API