0

Retrieving latest rosters with YQL

Hi everyone,
I'm trying to access the latest rosters with a YQL query,

It seems like this query returns the rosters for the current day, which don't take into consideration the latest transaction (add/drop/trades)
select * from fantasysports.teams.roster where league_key='238.l.177103'

To fix this I add the date parameter to my YQL query with a value of one week in the future.
select * from fantasysports.teams.roster where league_key='238.l.177103' and date='2010-06-19'

This work for baseball leagues, but not for football leagues.
The following query does not return any result
select * from fantasysports.teams.roster where league_key='242.l.51047' and date='2010-06-19'

Is there a way to fix this football query ?
or is there an easier to retrieve the latest rosters ?

Thanks,
Alain

2 Replies
  • QUOTE (Pickemfirst Dev @ Jun 18 2010, 08:27 PM) <{POST_SNAPBACK}>
    Hi everyone,
    I'm trying to access the latest rosters with a YQL query,

    It seems like this query returns the rosters for the current day, which don't take into consideration the latest transaction (add/drop/trades)
    select * from fantasysports.teams.roster where league_key='238.l.177103'

    To fix this I add the date parameter to my YQL query with a value of one week in the future.
    select * from fantasysports.teams.roster where league_key='238.l.177103' and date='2010-06-19'

    This work for baseball leagues, but not for football leagues.
    The following query does not return any result
    select * from fantasysports.teams.roster where league_key='242.l.51047' and date='2010-06-19'

    Is there a way to fix this football query ?
    or is there an easier to retrieve the latest rosters ?

    Thanks,
    Alain


    For football, we only support requests by week, not date. Try this:

    select * from fantasysports.teams.roster where league_key='242.l.51047' and week=1

    You're right that when you leave out the week/date parameter, it gives you this week's/today's roster by default. However, whether or not the latest transactions (add/drop/trades) are included depends on the league's settings. Most leagues, by default, apply transactions to the next week/day, but there's a league setting that makes transactions take effect immediately. The roster returned by the API will be the same as what you see on the website.
    0
  • Thanks Shane.
    This makes sense.

    even though it would be nice to be able able to specify a parameter in the YQL to get the rosters with "latest transactions processed"
    I'll specify week= (current_week +1) as a work around...
    0

Recent Posts

in Fantasy Sports API