php Steam 市场 API?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26170185/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 18:12:38  来源:igfitidea点击:

Steam Market API?

phpsteamsteam-web-api

提问by Ariel Weinberger

I know that there's a Steam API allowing me to use data from Steam Community.
My question is, does anyone know if there's a Steam Market API?
For example, I want to get the current price of an item in the Steam Market.

我知道有一个 Steam API 允许我使用来自 Steam 社区的数据。
我的问题是,有谁知道是否有 Steam 市场 API?
例如,我想获取 Steam 市场中某件物品的当前价格。

I've googled and haven't found anything yet.
I'd be glad to have your help.

我用谷歌搜索过,还没有找到任何东西。
我很乐意得到你的帮助。

回答by kiwixz

I could not find any documentation, but I use:

我找不到任何文档,但我使用:

http://steamcommunity.com/market/priceoverview/?appid=730&currency=3&market_hash_name=StatTrak%E2%84%A2 M4A1-S | Hyper Beast (Minimal Wear)

to return a JSON. At time of writing, it returns:

返回一个 JSON。在撰写本文时,它返回:

{"success":true,"lowest_price":"261,35€ ","volume":"11","median_price":"269,52€ "}

You can change the currency. 1 is USD, 3 is euro but there are probably others.

您可以更改货币。1 是美元,3 是欧元,但可能还有其他的。

回答by Captnwalker1

A better search api that can give you all the results for a game, example using pubg which only has 272 items, if your game has more try changing the count parameter at the end

一个更好的搜索 api,可以为您提供游戏的所有结果,例如使用只有 272 个项目的 pubg,如果您的游戏有更多尝试在最后更改计数参数

https://steamcommunity.com/market/search/render/?search_descriptions=0&sort_column=default&sort_dir=desc&appid=578080&norender=1&count=500

回答by OrderFromChaos

To add to what the other people have said, the temporary ban on the JSON site happens if you try and request 20 items within a minute's time from the server. If you're creating a script to request those links, add a three second delay between each script. Also, the ban only lasts for the remaining server-side minute (which may not be 60 seconds).

补充一下其他人所说的,如果您尝试在 1 分钟内从服务器请求 20 个项目,就会发生对 JSON 站点的临时禁止。如果您正在创建一个脚本来请求这些链接,请在每个脚本之间添加三秒的延迟。此外,禁令仅持续剩余的服务器端分钟(可能不是 60 秒)。

回答by ClemSndr

There is not such API for now. But this link may help you: Get the price of an item on Steam Community Market with PHP and RegexIt's basically what you want with pure php DOM parsing instead of an API. The main drawback is that you may have to change your code if Steam update their html markup.

目前没有这样的 API。但此链接可能对您有所帮助: 使用 PHP 和 Regex 在 Steam 社区市场上获取物品的价格这基本上是您想要的纯 php DOM 解析而不是 API。主要缺点是,如果 Steam 更新其 html 标记,您可能需要更改代码。

回答by Kristjan Kirpu

You can use SteamApis.comto acquire Steam market prices and item information. The data is returned in JSON. The service is not free but also not that expensive.

您可以通过SteamApis.com获取 Steam 市场价格和物品信息。数据以 JSON 格式返回。该服务不是免费的,但也不贵。

The documentation is available to view here.It has detailed information on what endpoints are available and what data is returned.

该文档可在此处查看。它包含有关哪些端点可用以及返回哪些数据的详细信息。