【问题标题】:Getting all reviews from a steam game using Steamworks?使用 Steamworks 从 Steam 游戏中获取所有评论?
【发布时间】:2018-05-16 00:20:54
【问题描述】:

目前,我正在尝试使用 Steamworks 文档中描述的方法从特定游戏中获取所有 Steam 评论: https://partner.steamgames.com/doc/store/getreviews

但是,当我尝试使用以下方法获取诸如 Team Fortress 2 之类的游戏的评论时: http://store.steampowered.com/appreviews/440?json=1 由于 start_offset 参数,我总是得到 20 条评论。

有没有办法在一个方法命令中获得所有评论,还是我必须创建一个具有不同 start_offset 的循环?

【问题讨论】:

  • start_offset - reviews are returned in batches of 20, so pass 0 for the first set, then 20 for the next set, etc. 看起来你必须循环

标签: json steam steam-web-api steamworks-api


【解决方案1】:

看起来 Steam 更改了 API,现在 start_offset 不起作用,他们将其更改为 cursor。 这里有更多信息: https://partner.steamgames.com/doc/store/getreviews

简单来说:您发送例如。 http://store.steampowered.com/appreviews/10?json=1&cursor=* 作为回报,您将获得带有下一个光标的 JSON,您需要在下一个 URL 中解析和使用它。

例如。 "cursor": "AoIIPwYYanDTv+QB"

您还需要记住对光标进行编码,以便下次调用就像 http://store.steampowered.com/appreviews/10?json=1&cursor=AoIIPwYYanDTv%2BQB

【讨论】:

  • 大家好,感谢您的回复。我尝试了上述方法,它采用生成的“光标”并将其连接到您的 url 示例。它有效,但我得到了重复。有什么想法吗?(我的代码 - pastebin.com/QiqzZnwR
  • 查看文档中的filter。下面引用:If paging through the reviews with cursor then choose either the recent option or the updated option to eventually receive an empty response list.
【解决方案2】:

Taplar 在他的评论中正确地提到了它。 start_offset - reviews are returned in batches of 20, so pass 0 for the first set, then 20 for the next set, etc. 你需要像这样使用偏移量:

对于像 DOTA 2 这样的游戏,大约有 650,000 多条评论。如果您想象自己处于 Valve 的位置,那么限制 API 调用将是有意义的。因此,我认为可以肯定地说,没有适用于所有评论的 API。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-05-14
    • 2018-02-11
    • 2018-03-02
    • 2020-10-21
    • 2021-03-20
    • 2021-11-29
    • 1970-01-01
    相关资源
    最近更新 更多