Developer API

Steam Inventory API

通过一个 REST 端点获取任意 Steam 用户的库存——免受速率限制困扰。支持每次请求最多批量获取 100 个库存。

Endpoints

All endpoints return JSON, accept the same auth header, and degrade with a normalised error envelope.

GET /steam/api/inventory
GET /steam/api/inventory/batch

Steam Inventory API — quickstart

Same auth header as every other endpoint we ship. Get an API key from the dashboard and you're querying inside two minutes.

  • Single auth header, JSON response.
  • Rate limits scale with your plan tier.
  • Full schema in the API reference.
API Request
# curl with API key
curl "https://www.steamwebapi.com/steam/api/inventory?key=$KEY"
# PHP
$res = file_get_contents('https://www.steamwebapi.com/steam/api/inventory?key=' . $KEY);
$data = json_decode($res, true);
# Node.js
const r = await fetch(`https://www.steamwebapi.com/steam/api/inventory?key=${KEY}`);
const data = await r.json();

About this API

用朴素方式获取 Steam 库存几分钟内就会撞上 429。Steam Inventory API 承担了繁重工作:请求缓冲、智能缓存、重试、响应规整。

FAQ

Inventory API 支持哪些游戏?

任何拥有公开库存的 Steam 社区游戏——CS2、Dota 2、Rust、TF2、Steam 本身等等。传入游戏的 appId 即可。

我如何进行批量获取?

向 /steam/api/inventory/batch 提交一份 SteamID 列表(每次调用最多 100 个)。响应以 SteamID 为键。

我需要自己处理 Steam 的速率限制吗?

不需要。我们在服务端处理速率限制。你的代码只会看到干净的 JSON 响应。

Start building with the Steam Inventory API

One key, every Steam endpoint.