【问题标题】:How to get the steam AppID by AppName in Steam WebAPI如何在 Steam WebAPI 中通过 AppName 获取 Steam AppID
【发布时间】:2019-12-17 21:03:18
【问题描述】:

所以我正在尝试通过输入游戏名称来启动 Steam 游戏。出于这个原因,我问自己是否可以通过输入的名称找出 Steam AppID。

所以我尝试通过我的 steamApps 文件夹收集 ID,但没有成功。 我还找到了一个网站,您可以在其中搜索特定游戏的名称。

例如“https://www.steamgriddb.com/api/v2/search/autocomplete/grandtheftautov”返回一个带有 gtaIV 和 gtaV 的 json

问题在于,在检索到的数据中找不到 stamAppID。

我还找到了一个 SQL 数据库 (https://steam.internet.byu.edu/),其中找到了 Steam 名称和 appID。 但这不是我喜欢的方式,因为数据库有 17GB 大。

【问题讨论】:

    标签: steam steam-web-api


    【解决方案1】:

    您使用此 API 调用:https://api.steampowered.com/ISteamApps/GetAppList/v2/

    {
        "applist": {
            "apps": [
                {
                    "appid": 946180,
                    "name": "The Gardens Between Soundtrack"
                },
                {
                    "appid": 946190,
                    "name": "Loveless cat"
                },
                ...
    

    更多信息here。 名单很大。使用可以处理大文件的编辑器打开它。您可以按名称搜索 JSON。

    【讨论】:

      【解决方案2】:

      如果你将它保存到一个名为 playercount.sh 的文件中并从 Linux 终端运行它,你就可以完全做到这一点。

      #!/bin/bash    
      #Example Usage:  ./playercount.sh "Left 4 Dead 2"    
      appid=$(curl -s https://api.steampowered.com/ISteamApps/GetAppList/v0002/ | jq ".applist.apps[] | select(.name==\"$1\")" | jq '.appid')    
      curl -s https://api.steampowered.com/ISteamUserStats/GetNumberOfCurrentPlayers/v1/?appid="$appid" | jq '.response.player_count'
      

      【讨论】:

        猜你喜欢
        • 2019-11-23
        • 2021-04-14
        • 1970-01-01
        • 1970-01-01
        • 2021-10-21
        • 2012-11-26
        • 2021-02-23
        • 1970-01-01
        • 2017-07-15
        相关资源
        最近更新 更多