"Stats" API (Football) - Not Working / Needs Different Oauth Approval?

From the documentation page:

It looks like all the API queries are working except for the one for the following, which retrieves individual player stats for a given week:


I get an "invalid oauth signature" error:

{'status': '401', 'transfer-encoding': 'chunked', 'vary': 'Accept-Encoding', 'connection': 'close', 'cache-control': 'private', 'date': 'Sun, 27 Jan 2013 03:38:44 GMT', 'content-type': 'application/json', 'www-authenticate': 'OAuth oauth_problem="signature_invalid", realm="yahooapis.com"'}

Is this the real problem? Every other API on that page works works for me.

  • ac
  • Jan 26, 2013
3 Replies
  • So, using the same oauth signing code, I can get data I need using a YQL query. The restful API still does not work.

    This works:

    yql_query = "select * from fantasysports.teams.roster.stats where team_key='[league_key].t.7' and week=16"
    yql_endpoint = "http://query.yahooapis.com/v1/yql"
    return self.access_client.request(yql_endpoint, parameters={'format':'json', 'q':yql_query,})

    This doesn't:

    query = "http://fantasysports.yahooapis.com/fantasy/v2/team/[league_key].t.7/stats;type=week;week=16"
    return self.access_client.request(query, parameters={'format':'json'})
  • Thank you for posting this ac. fantasysports.teams.roster.stats is the correct table to get a specific weeks stats.

  • This also works for YQL syntax:

    select * from fantasysports.players.stats where team_key='[team_key]' and player_key='[player_key]/stats;type=week;week=1'

    Notice the forward-slash after the your player_key


Recent Posts

in Fantasy Sports API