0

Players Collection

This is pertaining to the football game resource.

I'm trying to grab all the players within the league in order to store them in a database for a personal website. Then I can pull the rosters on an interval and link the two in order to calculate weekly stats.

I'm using the following URI in order to pull all players.

http://fantasysports.yahooapis.com/fantasy...ue_key}/players

For some reason, I am being limited to 25 results. I would like to capture all the players in one query. Is there any way to lift the limit?

Perhaps there is a better way to accomplish this?

by
3 Replies
  • Wooooo legal constraints! Correct, we are not allowed to present more than 25 players to you at a time. For your specific use case, is there a reason why you don't just pull the rosters and ask for the weekly stats at the same time? We do have the ability to ask for both team stats over certain intervals and player stats within teams over certain intervals. Kind of like...

    CODE
    http://fantasysports.yahooapis.com/fantasy/v2/team/223.l.21821.t.9;out=stats;stats.type=week;stats.week=10/roster;week=10/players/stats;type=week;week=10


    (one of my teams from last year, but hopefully you get the idea)

    It seems much more straightforward to let us do the work for you instead of having you pull down an entire database of players and stats for all of them.
    0
  • Hey Troy,

    I was trying to do something similar (for my Android app actually), and couldn't figure out a single query. What I had to do was loop and change the query using the "start" and "count" properties.

    Here's an example:
    http://fantasysports.yahooapis.com/fantasy...art=25;count=50

    That should give you players 25-50. I'm not sure why they limit it to 25 (hopefully someone else knows), but that is also the number of players you see when you look through them on your fantasy league page.

    - Josh
    0
  • Sean,

    That makes much more sense. Thank you.

    I recently created a new post on this, so sorry to duplicate.

    I like how the roster and stats have been embedded into one URI. Is there a URI that would get both the roster and stats for all teams?

    Thanks,
    Troy

    MODERATOR EDIT: See response in other post.
    0

Recent Posts

in Fantasy Sports API