0

NFL Fantasy League {league_key}

I'm very new, and just getting started...But I don't get what the {league_key} is?
Is this the league_id combined with the game format? And if so, where do you find these things?

Thanks!

by
5 Replies
  • The format of the league key is described here in the documentation: http://developer.yahoo.com/fantasysports/g...urce-key_format

    Basically, it's just a unique way of identifying a league, which means that it combines the game ID with the league ID. For most applications, I would think that you'd be getting leagues in the context of some user who's using your application, so you'd most often be asking for that user's leagues and teams and getting the appropriate keys from that XML response.
    0
  • QUOTE (Sean Montgomery @ Jul 30 2010, 09:02 PM) <{POST_SNAPBACK}>
    The format of the league key is described here in the documentation: http://developer.yahoo.com/fantasysports/g...urce-key_format

    Basically, it's just a unique way of identifying a league, which means that it combines the game ID with the league ID. For most applications, I would think that you'd be getting leagues in the context of some user who's using your application, so you'd most often be asking for that user's leagues and teams and getting the appropriate keys from that XML response.



    What I guess I'm really asking though is...
    Where do you FIND the {league_key}? I'm guessing it's the league id, but how does one know what the league id is?
    0
  • I only do fantasy football, so it might be different for another sport, but in FF, just go to the "Settings" page for your league. It is the first item in the list. Put that number at the end of the "key" (for current FF it would be):

    242.l.LeagueId

    Hope that helps,
    C
    0
  • QUOTE (Christian @ Aug 2 2010, 03:09 PM) <{POST_SNAPBACK}>
    I only do fantasy football, so it might be different for another sport, but in FF, just go to the "Settings" page for your league. It is the first item in the list. Put that number at the end of the "key" (for current FF it would be):

    242.l.LeagueId

    Hope that helps,
    C

    Yup, definitely agreed with Christian if you're trying to figure out the league ID for your own league, ie, if you're just building an application to grab your own data. If you're trying to actually build an application for random people on the internet to use, you'd want to use the user-based webservice requests that I mentioned in my first reply, which would return back the league key as part of the response. Example:

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


    Will give you all the NFL leagues that the logged-in user is playing in.
    0
  • QUOTE (Sean Montgomery @ Aug 3 2010, 09:45 PM) <{POST_SNAPBACK}>
    Yup, definitely agreed with Christian if you're trying to figure out the league ID for your own league, ie, if you're just building an application to grab your own data. If you're trying to actually build an application for random people on the internet to use, you'd want to use the user-based webservice requests that I mentioned in my first reply, which would return back the league key as part of the response. Example:

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


    Will give you all the NFL leagues that the logged-in user is playing in.


    Gotcha! Thanks so much!
    0

Recent Posts

in Fantasy Sports API