0

YQL Player Sorting

I'm trying to use a YQL query to fetch players and have them sorted when returned.  I've been testing my queries in the console, but no matter what sort conditions I add to the where clause, the returned players are always the same and in the same order.  Here is an example of a query I have tried:

SELECT * FROM fantasysports.players WHERE league_key="<league_key>" and sort_type="AR" and sort_season="2010"

I think this should return the top 25 players from last season sorted by rank, however it does not.  Can someone help me figure out what I am doing wrong?

Thanks.

by
1 Reply
  • Slight parameter issue, which is absolutely the fault of our lack of YQL documentation and nothing I would have expected you to know. Try this instead:

    SELECT * FROM fantasysports.players WHERE league_key="[league_key]" and sort="AR" and sort_type="season" and sort_season="2010"

    The "sort_type" parameter deals with the type of coverage you're working with (season, date, week, etc), not the actual value you're sorting by. That's just "sort".
    0

Recent Posts

in Fantasy Sports API