2014-11-22 134 views
0

我正在使用Steam API獲取遊戲列表以顯示用戶,如果遊戲支持控制器,將很高興。有沒有辦法找到一個遊戲是否具有Steam API的全部或一些控制器支持?Steam API - 遊戲控制器支持

回答

1

您可以通過非官方的StoreFront API使用appdetails調用找到此信息。

http://store.steampowered.com/api/appdetails/?appids=<<APPID>>&filters=categories 

用數字應用程序ID替換<<APPID>>。這將返回類似下面的JSON對象:

{ 
    "440":{ 
     "success":true, 
     "data":{ 
      "categories":[ 
       {"id":"1","description":"Multi-player"}, 
       {"id":"27","description":"Cross-Platform Multiplayer"}, 
       {"id":"22","description":"Steam Achievements"}, 
       {"id":"14","description":"Commentary available"}, 
       {"id":"13","description":"Captions available"}, 
       {"id":"31","description":"VR Support"}, 
       {"id":"15","description":"Stats"}, 
       {"id":"8","description":"Valve Anti-Cheat enabled"}, 
       {"id":"18","description":"Partial Controller Support"}, 
       {"id":"17","description":"Includes level editor"}, 
       {"id":"29","description":"Steam Trading Cards"}, 
       {"id":"30","description":"Steam Workshop"} 
      ] 
     } 
    } 
} 

categories鍵,您將需要尋找兩個ID。如果您尋找17id,則表示「部分控制器支持」。如果你找的28id,這表示「完全支持控制器」,看起來像這樣的列表:

{"id":"28","description":"Full controller support"} 
+0

工作很漂亮,謝謝! – Kevin 2014-11-25 03:47:19