2016-05-30 86 views
0

我正在寻找使用Yahoo Fantasy API来获取上季(pts,reb,ast等)玩家的季节性数据。我正在尝试使用他们的YQL,但我无法理解如何使用它。例如:关于YQL Fantasy查询的困惑

```select * from fantasysports.players.stats where league_key='238.l.627060' and player_key='238.p.6619'``` 

给出的输出:

{ 
 
"query": { 
 
    "count": 1, 
 
    "created": "2016-05-30T07:46:12Z", 
 
    "lang": "en-US", 
 
    "diagnostics": { 
 
    "publiclyCallable": "true", 
 
    "url": { 
 
    "execution-start-time": "2", 
 
    "execution-stop-time": "1643", 
 
    "execution-time": "1641", 
 
    "content": "http://fantasysports.yahooapis.com/fantasy/v2/leagues;league_keys=238.l.627060/players;player_keys=238.p.6619/stats" 
 
    }, 
 
    "javascript": { 
 
    "execution-start-time": "0", 
 
    "execution-stop-time": "1645", 
 
    "execution-time": "1644", 
 
    "instructions-used": "257", 
 
    "table-name": "fantasysports.players.stats" 
 
    }, 
 
    "user-time": "1646", 
 
    "service-time": "1641", 
 
    "build-version": "0.2.998" 
 
    }, 
 
    "results": { 
 
    "player": { 
 
    "player_key": "238.p.6619", 
 
    "player_id": "6619", 
 
    "name": { 
 
    "full": "Albert Pujols", 
 
    "first": "Albert", 
 
    "last": "Pujols", 
 
    "ascii_first": "Albert", 
 
    "ascii_last": "Pujols" 
 
    }, 
 
    "editorial_player_key": "mlb.p.6619", 
 
    "editorial_team_key": "mlb.t.3", 
 
    "editorial_team_full_name": "Los Angeles Angels", 
 
    "editorial_team_abbr": "LAA", 
 
    "uniform_number": "5", 
 
    "display_position": "1B", 
 
    "headshot": { 
 
    "url": "http://l.yimg.com/iu/api/res/1.2/tEqcQTL99PN5L26BdMaRiA--/YXBwaWQ9c2hhcmVkO2NoPTIzMzY7Y3I9MTtjdz0xNzkwO2R4PTg1NztkeT0wO2ZpPXVsY3JvcDtoPTYwO3E9MTAwO3c9NDY-/https://s.yimg.com/xe/i/us/sp/v/mlb_cutout/players_l/20160401/6619.png", 
 
    "size": "small" 
 
    }, 
 
    "image_url": "http://l.yimg.com/iu/api/res/1.2/tEqcQTL99PN5L26BdMaRiA--/YXBwaWQ9c2hhcmVkO2NoPTIzMzY7Y3I9MTtjdz0xNzkwO2R4PTg1NztkeT0wO2ZpPXVsY3JvcDtoPTYwO3E9MTAwO3c9NDY-/https://s.yimg.com/xe/i/us/sp/v/mlb_cutout/players_l/20160401/6619.png", 
 
    "is_undroppable": "0", 
 
    "position_type": "B", 
 
    "eligible_positions": { 
 
    "position": [ 
 
     "1B", 
 
     "Util" 
 
    ] 
 
    }, 
 
    "has_player_notes": "1", 
 
    "player_stats": { 
 
    "coverage_type": "season", 
 
    "season": "2010", 
 
    "stats": { 
 
     "stat": [ 
 
     { 
 
     "stat_id": "60", 
 
     "value": "183/587" 
 
     }, 
 
     { 
 
     "stat_id": "7", 
 
     "value": "115" 
 
     }, 
 
     { 
 
     "stat_id": "12", 
 
     "value": "42" 
 
     }, 
 
     { 
 
     "stat_id": "13", 
 
     "value": "118" 
 
     }, 
 
     { 
 
     "stat_id": "16", 
 
     "value": "14" 
 
     }, 
 
     { 
 
     "stat_id": "3", 
 
     "value": ".312" 
 
     } 
 
     ] 
 
    } 
 
    } 
 
    } 
 
    } 
 
} 
 
}

,而我已经试过,没有运气的其他选项玩耍。任何想法如何获得与此JSON格式的球员统计?

回答

0

尝试将stats_type='season'stats_season='2015'添加到您的查询中。

+0

@JKW - 做了这项工作? – MMMdata