0

Can I get Leagues related to a particular username if i have the ID and Password.

I want to access in how many leagues a user is..

so if i have the ID and password of the user .. can i access the leagues a user is in. using the fantasy sports API

more over i would also like to get
1) how many teams are there in that league
2) what is the team of that User
3) what are the players in the user team
4) what are the matches that are scheduled in that league
5) scoreboard of the latest match

Thanks

by
8 Replies
  • Yes you can access all that data. You wouldn't be using the ID and password directly though as the API uses OAuth.
    I'd suggest you play with the YQL console to see what data you can get: http://developer.yahoo.com/yql/console/?_u...key%3D%22238%22
    0
  • QUOTE (benoit808 @ Nov 12 2010, 01:01 AM) <{POST_SNAPBACK}>
    Yes you can access all that data. You wouldn't be using the ID and password directly though as the API uses OAuth.
    I'd suggest you play with the YQL console to see what data you can get: http://developer.yahoo.com/yql/console/?_u...key%3D%22238%22



    Thanks for the reply.
    I am playing with that ... but as you can see that the league key = 249.l.139470
    you can easily notice that i cannot access the leagues with the user id and game id.... i need to have the league id too.
    but what i want to do is .. i want to access all the leagues in which a user is present.

    and for accessing the games of a user below is the query
    select * from fantasysports.games where user_id='your_user_id' and game_key in ('238', '223')

    here what should i write in the user_id field..??

    same thing is applicable for the teams as mentioned below.

    team key = 249.l.139470.t.1

    249 = game key
    l = league prefix
    139470 = league key
    t = team prefix
    1 = team key in that league

    Thanks
    0
  • Thanks, benoit, for chiming in -- definitely on point about checking out YQL (as well as all of the other resources and links listed in the Welcome thread).

    I did want to specifically address a point -- you shouldn't be getting a user's Yahoo! ID and password directly, and I'd never encourage building an application around that. That's extremely private information, and you really shouldn't even want to have that level of access (and you're also not allowed to under our Terms of Service). Instead, as benoit said, you should be using OAuth to allow users to explicitly grant you certain permissions. It's all covered pretty well in the Welcome thread, I think.

    Specifically for using YQL, the user_id field won't help since we don't base it off the the Yahoo! ID, which is probably the closest thing you'd have. Use "use_login=1" to get data for the currently logged in user, which will work especially well if you're using OAuth, which lets you make requests on a user's behalf (so they'd show up as the logged in user).
    0
  • QUOTE (Sean Montgomery @ Nov 15 2010, 04:42 PM) <{POST_SNAPBACK}>
    Thanks, benoit, for chiming in -- definitely on point about checking out YQL (as well as all of the other resources and links listed in the Welcome thread).

    I did want to specifically address a point -- you shouldn't be getting a user's Yahoo! ID and password directly, and I'd never encourage building an application around that. That's extremely private information, and you really shouldn't even want to have that level of access (and you're also not allowed to under our Terms of Service). Instead, as benoit said, you should be using OAuth to allow users to explicitly grant you certain permissions. It's all covered pretty well in the Welcome thread, I think.

    Specifically for using YQL, the user_id field won't help since we don't base it off the the Yahoo! ID, which is probably the closest thing you'd have. Use "use_login=1" to get data for the currently logged in user, which will work especially well if you're using OAuth, which lets you make requests on a user's behalf (so they'd show up as the logged in user).


    Thanks for the reply.

    I forgot to mention that i am currently using oauth for this purpose.
    I just wanted to confirm that if i can get the data of the other users by using their userid.

    My idea is to build newsletter system which will automatic create news letters using the userid's (or any other possible way) for separate leagues and send them to respective users email address.

    but i guess at this point i can only get the data for currently logged in user.
    0
  • You might store the users auth token in your database, along with information you ask the user like their name and email address. Then as you process (and refresh) the tokens, you'll know where to send the newsletters and know what teams they have... all without asking them for their Yahoo username or password.
    0
  • QUOTE (Phil @ Nov 17 2010, 10:48 PM) <{POST_SNAPBACK}>
    You might store the users auth token in your database, along with information you ask the user like their name and email address. Then as you process (and refresh) the tokens, you'll know where to send the newsletters and know what teams they have... all without asking them for their Yahoo username or password.


    Thanks Phil, for the clarification.
    0
  • Hi
    I need some more clarification. Is Oauth the only way to pull this data?

    I want to extract some data about the players in my fantasy football league in order to run some comparisons which are too time consuming using the available tools in fantasy football. I am not creating an App per se.

    Do I still need to go and get a consumer key? and what App do I say I am building if I am not actually building an app, I am just pulling out some data for analisys?

    Maybe I am a little confused about the overall functionality and how all this stuff fits together...
    0
  • QUOTE (Pepebuho @ Nov 26 2010, 02:39 AM) <{POST_SNAPBACK}>
    Hi
    I need some more clarification. Is Oauth the only way to pull this data?

    I want to extract some data about the players in my fantasy football league in order to run some comparisons which are too time consuming using the available tools in fantasy football. I am not creating an App per se.

    Do I still need to go and get a consumer key? and what App do I say I am building if I am not actually building an app, I am just pulling out some data for analisys?

    Maybe I am a little confused about the overall functionality and how all this stuff fits together...

    Yeah, it is a little bit confusing. I'll try to break it down a bit.

    Yes, OAuth is the only way to pull out any data from these APIs, though there are a few wrinkles as far as that's concerned. I understand that you're not creating a full featured "App" like an iPhone application, for instance, but you're still creating a program to access data in a programmatic manner, so that's basically the application we're referring to. It doesn't even really matter how you describe it, unless you want to start having other people use it (in which case, you probably would want to have a pretty clear description of what it's supposed to do).

    So, yes, you need to get a consumer key, because we won't know who you are otherwise and thus we won't be able to authorize you as a reasonable user. If you're just pulling out some data for analysis, just say that. "Application Name: My Data Analysis Thing. Description: I'm pulling out some data for analysis." :)(also, be sure to note that we have contractual restrictions on data that goes through the APIs, so you'll run into limits like only being able to see 25 players max at once and not being able to see player stats in all contexts)
    0

Recent Posts

in Fantasy Sports API