0

Can you get data from archived leagues?

is it possible?

by
9 Replies
  • Yep.

    After you have gone through the authentication process for your user, you can just use a query like this:

    CODE
    http://fantasysports.yahooapis.com/fantasy/v2/users;use_login=1/games;game_keys=242/leagues


    You can swap in a different game key to get different results. The key "242" is for Fantasy Football in 2010, so that query will give back league resources for all of the Fantasy Football leagues the current logged in user was a part of during 2010. Note that you can look through the data for the league id, which can then be used in various other queries that ask for the league key as a parameter.

    If you wanted the same info for 2007, for example, you would use 175 as your game key instead of 242. There is a list of game keys and what they mean in the docs:
    http://developer.yahoo.com/fantasysports/g...e-resource.html
    0
  • QUOTE (Nicos @ Mar 18 2011, 09:47 AM) <{POST_SNAPBACK}>
    is it possible?



    how do you go thrugh and authentication process for the user...me?
    0
  • You have to authenticate with yahoo using OAuth. For security reasons it's not a one-step process, and if you're not a programmer I'm not sure what to tell you. If you are a programmer, then you should check out this tutorial I found here:

    http://programmingisart.be/internship/

    I was having a bit of trouble myself until I read through that and used the resources he links to. Made it much easier. This graph summarizes what you need to do:

    http://developer.yahoo.com/oauth/guide/ima...oauth_graph.gif

    Once you get to the "use OAuth token in API requests" step, then you can use the API to ask yahoo for data about your archived league. It won't work unless you do the other steps first though.
    0
  • thanks, i'll give this a try.
    0
  • Great answers, Mark -- thank you!
    0
  • When I log in to the fantasy sports website, I can view history for my league back to 2004. However, when I use the API calls while logged in under the same ID, I can only see back to 2006. I remember creating a new yahoo id many years ago and linking the two together somehow. Would this be the cause of the difference or is there something else I'm missing? If the difference is the change in user IDs, how can I retrieve the same history via the API that I can see while logged in to the site?
    0
  • When I look at your profile, I'm only seeing that you've personally played in games going back to 2006. Are you saying that your league has a history going back to 2004? Because you won't see that under your user unless you've personally been in those pre-2006 leagues as well. You could likely access the leagues directly based on the league IDs if you pull those from the site when you view the archive league home pages, if you constructed a league key like <old_game_id>.l.<old_league_id> -- I believe members of persistent leagues are allowed to view all previous seasons. But we don't have any facilities in the services right now to do that programatically.

    QUOTE(Garrett @ 13 Aug 2011 9:36 PM)
    When I log in to the fantasy sports website, I can view history for my league back to 2004. However, when I use the API calls while logged in under the same ID, I can only see back to 2006. I remember creating a new yahoo id many years ago and linking the two together somehow. Would this be the cause of the difference or is there something else I'm missing? If the difference is the change in user IDs, how can I retrieve the same history via the API that I can see while logged in to the site?
    0
  • I have been a part of the same league since 2004 and can view that history when I log in. However, for 2004 and 2005, I used a different Yahoo ID. At some point, I switched to a new Yahoo ID but it let me convert my Fantasy Sports history over to the new ID which is why I'm guessing I can still see '04 and '05 data. However, it's almost like programatically, the API doesn't see this same information and only sees the seasons attached to this current ID and thus shows '06-current. Does that make sense?

    In the meantime, I will try to access league history directly via the keys.

    QUOTE(Sean Montgomery @ 14 Aug 2011 9:10 PM)
    When I look at your profile, I'm only seeing that you've personally played in games going back to 2006. Are you saying that your league has a history going back to 2004? Because you won't see that under your user unless you've personally been in those pre-2006 leagues as well. You could likely access the leagues directly based on the league IDs if you pull those from the site when you view the archive league home pages, if you constructed a league key like <old_game_id>.l.<old_league_id> -- I believe members of persistent leagues are allowed to view all previous seasons. But we don't have any facilities in the services right now to do that programatically.

    QUOTE(Garrett @ 13 Aug 2011 9:36 PM)
    When I log in to the fantasy sports website, I can view history for my league back to 2004. However, when I use the API calls while logged in under the same ID, I can only see back to 2006. I remember creating a new yahoo id many years ago and linking the two together somehow. Would this be the cause of the difference or is there something else I'm missing? If the difference is the change in user IDs, how can I retrieve the same history via the API that I can see while logged in to the site?
    0
  • I don't think we have the ability to convert Fantasy Sports history from one Yahoo! ID to another unless you explicitly rename your Yahoo! ID to a new one, and I'm not sure that describes what you did. We have code in place to allow any person who was in a league for any year in its history to see all of the years in that league's history, which could explain why you're able to see the 2004 and 2005 seasons, even if your Yahoo! ID wasn't really in those leagues.

    QUOTE(Garrett @ 10 Oct 2011 12:00 PM)
    I have been a part of the same league since 2004 and can view that history when I log in. However, for 2004 and 2005, I used a different Yahoo ID. At some point, I switched to a new Yahoo ID but it let me convert my Fantasy Sports history over to the new ID which is why I'm guessing I can still see '04 and '05 data. However, it's almost like programatically, the API doesn't see this same information and only sees the seasons attached to this current ID and thus shows '06-current. Does that make sense?

    In the meantime, I will try to access league history directly via the keys.

    QUOTE(Sean Montgomery @ 14 Aug 2011 9:10 PM)
    When I look at your profile, I'm only seeing that you've personally played in games going back to 2006. Are you saying that your league has a history going back to 2004? Because you won't see that under your user unless you've personally been in those pre-2006 leagues as well. You could likely access the leagues directly based on the league IDs if you pull those from the site when you view the archive league home pages, if you constructed a league key like <old_game_id>.l.<old_league_id> -- I believe members of persistent leagues are allowed to view all previous seasons. But we don't have any facilities in the services right now to do that programatically.

    QUOTE(Garrett @ 13 Aug 2011 9:36 PM)
    When I log in to the fantasy sports website, I can view history for my league back to 2004. However, when I use the API calls while logged in under the same ID, I can only see back to 2006. I remember creating a new yahoo id many years ago and linking the two together somehow. Would this be the cause of the difference or is there something else I'm missing? If the difference is the change in user IDs, how can I retrieve the same history via the API that I can see while logged in to the site?
    0

Recent Posts

in Fantasy Sports API