0

stats resource

In regards to getting stats, how could I go about getting stats for a particular day or time frame. Say, for example, I want the stats for the last 3 days for a particular player?

by
10 Replies
  • QUOTE (Unknown @ Jun 10 2010, 11:34 AM) <{POST_SNAPBACK}>
    In regards to getting stats, how could I go about getting stats for a particular day or time frame. Say, for example, I want the stats for the last 3 days for a particular player?


    Well you will need to pay for this info...
    I recommand buying box scores from xmlteam.com
    I evaluated a couple other companies, and they were the cheapest, plus it's easy to setup, reliable and they have great customer service.
    so I use them for my own app.
    they charge 25c per MLB box scores.
    0
  • Er, so, I guess there's that option that Pickemfirst Dev mentioned. Or alternately, you should be able to formulate a request like:

    CODE
    http://fantasysports.yahooapis.com/fantasy/v2/league/mlb.l.627060;out=settings/players;player_keys=mlb.p.6619/stats;type=date;date=2010-05-14

    If I'm not mistaken, that'll get you the stats for Albert Pujols within a particular league on May 14th, 2010. We don't currently support requesting multiple stat views in a single request, so you can't, for instance, get the last three days in one big chunk. You could make multiple requests for each day you want, but it won't be very efficient and adding composite stats (like ERA) isn't necessarily straightforward if you only have day-by-day granularity. We do have a couple other aggregation views, though -- you can use "type=lastweek" to get the stats summed over the last week, or "type=lastmonth" for the stats summed over the last month.

    A couple notes:
    • I added the league resource to the above request so you could pull out the settings object, which is currently where we store the descriptions of the stats. We'll probably need to add the ability to request that stats info resource on its own down the line.
    • The types we support for baseball are date, lastweek, lastmonth, and season (you can also get a weekly view in the context of a team in a head-to-head league). For football, the supported types are week, lastmonth, and season.
    • The maximum number of players that you can get back in a single collection is 25. Legal restrictions and whatnot.

    Does that answer your question?
    0
  • That's very cool that the information is available in the API even though it requires a few queries...

    but I'm guessing the stats provider are going to be less than happy if everybody starts to get their precious data for free
    and soon they will be the one enforcing the strict "non commercial clause" that comes with the Yahoo API...

    What do you think, Sean ?
    0
  • QUOTE (Pickemfirst Dev @ Jun 10 2010, 09:48 PM) <{POST_SNAPBACK}>
    but I'm guessing the stats provider are going to be less than happy if everybody starts to get their precious data for free
    and soon they will be the one enforcing the strict "non commercial clause" that comes with the Yahoo API...

    Oh, absolutely. Yes, we have statistical data available for general use, but that's the part that's very strictly bound to the non-commercial clause. Until/unless we're able to offer commercial licenses, you're correct that this data won't be very useful for a commercial application and that you'd probably have to go to another stat provider with existing commercial licenses in place for that. Sorry for missing that perspective there!

    If you're building a non-commercial application, though, we do have a pretty decent set of player-based stats available. :)
    0
  • QUOTE (Sean Montgomery @ Jun 13 2010, 09:20 AM) <{POST_SNAPBACK}>
    Oh, absolutely. Yes, we have statistical data available for general use, but that's the part that's very strictly bound to the non-commercial clause. Until/unless we're able to offer commercial licenses, you're correct that this data won't be very useful for a commercial application and that you'd probably have to go to another stat provider with existing commercial licenses in place for that. Sorry for missing that perspective there!

    If you're building a non-commercial application, though, we do have a pretty decent set of player-based stats available. :)Could we build commercial apps leveraging the api and simply not use any stats queries? Since I'll be pulling stats from another provider anyway and this seems to be the reason the api is non-commercial use right now.
    0
  • QUOTE (Max @ Jun 13 2010, 10:04 AM) <{POST_SNAPBACK}>
    Could we build commercial apps leveraging the api and simply not use any stats queries? Since I'll be pulling stats from another provider anyway and this seems to be the reason the api is non-commercial use right now.

    +1
    I'm in the exact same situation.
    0
  • :D I've passed the question on to the people who can make those sorts of decisions. Basically, as it stands right now, the services as a whole (not just the statistical data) are intended for non-commercial use, so I don't think that building a commercial application that doesn't use any statistical data would be a valid loophole. It definitely seems like an interesting model for permitting commercial applications, which is why I passed it on, but I don't know that I'd expect to hear any decision about it very soon. I'll do my best to let you guys know if I hear any word back.
    0
  • QUOTE (Sean Montgomery @ Jun 10 2010, 02:25 PM) <{POST_SNAPBACK}>
    Er, so, I guess there's that option that Pickemfirst Dev mentioned. Or alternately, you should be able to formulate a request like:

    CODE
    http://fantasysports.yahooapis.com/fantasy/v2/league/mlb.l.627060;out=settings/players;player_keys=mlb.p.6619/stats;type=date;date=2010-05-14

    If I'm not mistaken, that'll get you the stats for Albert Pujols within a particular league on May 14th, 2010. We don't currently support requesting multiple stat views in a single request, so you can't, for instance, get the last three days in one big chunk. You could make multiple requests for each day you want, but it won't be very efficient and adding composite stats (like ERA) isn't necessarily straightforward if you only have day-by-day granularity. We do have a couple other aggregation views, though -- you can use "type=lastweek" to get the stats summed over the last week, or "type=lastmonth" for the stats summed over the last month.


    In regards to this URI to get this data, could you guide me on how to do this using YQL? I've been having trouble getting stats - when I do a select * from fantasysports.players where player_key='whatever' I don't seem to get the stats column. I've tried select stats, nothing in the results. Any idea on how to tweak this to use YQL?

    Thanks,
    Lewis
    0
  • QUOTE (Lewis @ Jun 16 2010, 12:07 AM) <{POST_SNAPBACK}>
    In regards to this URI to get this data, could you guide me on how to do this using YQL? I've been having trouble getting stats - when I do a select * from fantasysports.players where player_key='whatever' I don't seem to get the stats column. I've tried select stats, nothing in the results. Any idea on how to tweak this to use YQL?

    Thanks,
    Lewis


    That's not available through YQL. On the bottom right of the YQL Console, it lists everything that's available, and it's only a small subset of what's available through the API.
    0
  • To expand upon what Shane mentioned, we actually do have some extra tables on the way that should expose a bit more statistical information, but in general we have much, much better coverage on the full webservices as compared to the YQL tables. We will likely be trying to improve the YQL tables over time to at least cover most of the basic tasks, but that's a bit down the road and it still may be more effective to make requests to the full webservices (as you have greater control over what resources you pull down, and access to all of the resources that we have available instead of just the ones we've thought to so far port over to YQL).
    0

Recent Posts

in Fantasy Sports API