对YQL幻想查询感到困惑

时间:2016-05-30 07:52:34

标签: json yql yahoo-api json-api

我希望使用Yahoo Fantasy API为上一季的玩家(pts,reb,ast等)获取季节性数据。我正在试验他们的YQL,但我在尝试理解如何使用它时遇到了麻烦。例如:

```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格式获取玩家统计数据吗?

1 个答案:

答案 0 :(得分:0)

尝试将stats_season='2015'和{{1}}添加到您的查询中。