HTML 使用 Steam API 获取价格
HTML use Steam API to get price
我想在我的主页上显示一个案例的成本。Steam API 是: http://steamcommunity.com/market/priceoverview/?currency=3&appid=730&market_hash_name=Chroma%202%20Case
如何使用此链接给出的字符串?
我尝试了这样的事情:
首先,也许你想看看这些页面:要获取包含file_get_contents的页面内容:http://php.net/manual/en/function.file-get-contents.php
并使用json_decode解码 json 数据:http://php.net/manual/en/function.json-decode.php
$json = file_get_contents("http://steamcommunity.com/market/priceoverview/?currency=3&appid=730&market_hash_name=Chroma%202%20Case");
$decode = json_decode($json,1);
echo $decode['median_price'];
相关文章:
- JavaScript嵌套获取API
- 获取 API 响应对象并替换(映射)所有键
- 是否可以覆盖本机获取 API 以使用所需的承诺库而不是本机浏览器承诺
- 成功获取 API,但没有响应
- Javascript获取api:Can't检索某些响应标头
- javascript中获取api中的Url查询字符串
- 如果我想要的URL在API中,如何获取API的URL's的JSON
- 在jQuery中简单地获取API调用
- 获取API时带有html5mode的ExpressJS无法工作
- angular试图从一个不存在的源中获取api检查
- 如何在获取 API 中处理 HTTP 代码 4xx 响应
- 获取API回调的参数
- 使用请求获取API结果,并集成到Hubot响应中
- 获取API -跨域
- 关于从DS获取api数据.RESTAdapter到模型中
- 获取api - get json主体在then和catch块为单独的状态码
- fotorama:can't获取API对象(未定义)
- 获取API返回状态代码0,需要XML响应
- 使用javascript获取api来执行POST请求
- 可以't获取API响应的特定元素[JS]