市场数据
GET /v1/listings/availability — 批量可用性查询
在单次请求中检查最多 100 个 CSBoard 商品是否仍可购买,返回每个可用 id 的实时价格以及不可用 id 列表。
GET
/
listings
/
availability
Bulk availability check
curl --request GET \
--url https://csboard.com/v1/listings/availability \
--header 'Authorization: Bearer <token>'import requests
url = "https://csboard.com/v1/listings/availability"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://csboard.com/v1/listings/availability', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://csboard.com/v1/listings/availability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://csboard.com/v1/listings/availability"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://csboard.com/v1/listings/availability")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://csboard.com/v1/listings/availability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"available": {
"itm_8841201": 14.37,
"itm_8841340": 12.1
},
"unavailable_ids": [
"itm_8841999"
]
}
}{
"code": "unsupported_game",
"detail": "appId 440 is not available to this key. Supported: 730 (CS2), 570 (Dota 2), 252490 (Rust).",
"supported_app_ids": [
730,
570,
252490
]
}{
"code": "missing_api_key",
"detail": "Provide your API key via `Authorization: Bearer csb_pub_…`. Generate one at https://csboard.com/profile?tab=api"
}{
"code": "invalid_request",
"detail": "Provide between 1 and 100 ids in the ids parameter."
}{
"code": "rate_limit_exceeded",
"detail": "Rate limit of 100 requests/min exceeded."
}在下批量订单之前,请确认您打算购买的商品仍然可用。通过逗号分隔的
ids 参数最多传入 100 个商品 id;响应会给出每个仍可用 id 的实时价格,并列出已不再可用的 id。
需要身份验证。 请将密钥作为 Authorization: Bearer csb_pub_... 发送。
查询参数
string
必填
以逗号分隔的商品 id,例如
itm_8841201,itm_8841340。必填。 每次请求最多 100 个 id。integer
默认值:"730"
这些 id 所属的游戏:
730 = CS2,570 = Dota 2,252490 = Rust。请使用您从 GET /v1/listings 读取这些 id 时所用的同一个 appId。响应字段
示例请求
curl "https://csboard.com/v1/listings/availability?ids=itm_8841201,itm_8841340,itm_8841999" \
-H "Authorization: Bearer csb_pub_..."
示例响应
{
"data": {
"available": {
"itm_8841201": 14.37,
"itm_8841340": 12.1
},
"unavailable_ids": ["itm_8841999"]
}
}
错误代码
| HTTP 状态码 | 代码 | 含义 |
|---|---|---|
| 400 | unsupported_game | 您的密钥无法使用该 appId。supported_app_ids 列出了可用的值。 |
| 401 | missing_api_key / invalid_api_key | API 密钥缺失或无效。 |
| 422 | invalid_request | 未提供 ids,或提供了超过 100 个 id。 |
| 429 | rate_limit_exceeded | 请求过多。请按照 Retry-After 响应头中的秒数退避。 |
可用性是一个时间点快照。报告为可用的 id 仍可能在您的购买执行前售罄——请始终发送
max_price_usd,并在购买调用中处理 item_unavailable。授权
Send your key as a Bearer token on every request: Authorization: Bearer csb_pub_.... Generate keys in your CSBoard profile.
查询参数
Comma-separated listing ids. Required. Maximum 100 ids per request.
Steam appId of the game. 730 = CS2 (the default), 570 = Dota 2, 252490 = Rust. Omit it and the endpoint answers for CS2 exactly as before. An appId this key may not use answers 400 unsupported_game, whose supported_app_ids lists the ones it may — see GET /games.
可用选项:
730, 570, 252490 响应
Availability map for the requested ids.
Show child attributes
Show child attributes
⌘I
Bulk availability check
curl --request GET \
--url https://csboard.com/v1/listings/availability \
--header 'Authorization: Bearer <token>'import requests
url = "https://csboard.com/v1/listings/availability"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://csboard.com/v1/listings/availability', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://csboard.com/v1/listings/availability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://csboard.com/v1/listings/availability"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://csboard.com/v1/listings/availability")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://csboard.com/v1/listings/availability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"available": {
"itm_8841201": 14.37,
"itm_8841340": 12.1
},
"unavailable_ids": [
"itm_8841999"
]
}
}{
"code": "unsupported_game",
"detail": "appId 440 is not available to this key. Supported: 730 (CS2), 570 (Dota 2), 252490 (Rust).",
"supported_app_ids": [
730,
570,
252490
]
}{
"code": "missing_api_key",
"detail": "Provide your API key via `Authorization: Bearer csb_pub_…`. Generate one at https://csboard.com/profile?tab=api"
}{
"code": "invalid_request",
"detail": "Provide between 1 and 100 ids in the ids parameter."
}{
"code": "rate_limit_exceeded",
"detail": "Rate limit of 100 requests/min exceeded."
}