Рыночные данные
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."
}Перед оформлением пакетного заказа убедитесь, что листинги, которые вы планируете купить, ещё доступны. Передайте до 100 id листингов в параметре
ids через запятую; в ответе будет актуальная цена каждого ещё доступного id и список id, которые уже недоступны.
Требуется аутентификация. Отправьте ключ как Authorization: Bearer csb_pub_....
Query-параметры
string
обязательно
ID листингов через запятую, например
itm_8841201,itm_8841340. Обязательно. Максимум 100 id за запрос.integer
по умолчанию:"730"
Игра, к которой относятся id:
730 — CS2, 570 — Dota 2, 252490 — Rust. Используйте тот же appId, с которым вы получили id из GET /v1/listings.Поля ответа
object
обязательно
Пример запроса
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."
}