# GET /v1/live/capabilities

获取所有实时操作的 JSON schema

返回 Youpin、CSFloat 和 Steam 上每个实时操作的机器可读说明：路径、请求与响应 JSON schema、筛选条件、排序字段、挂单类型、每页行数和示例请求。任何有效密钥均可调用。可用 market 和 operation 查询参数筛选。

## 请求

`GET https://api.cs2.sh/v1/live/capabilities`

**curl**

```bash
curl https://api.cs2.sh/v1/live/capabilities \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed
```

**Python**

```python
import requests

headers = {
    "Authorization": "Bearer <<YOUR_API_KEY>>",
    "Accept-Encoding": "gzip",
}

response = requests.get(
    "https://api.cs2.sh/v1/live/capabilities",
    headers=headers,
)

response.raise_for_status()
data = response.json()
```

**Node**

```javascript
const headers = {
  "Authorization": "Bearer <<YOUR_API_KEY>>",
  "Accept-Encoding": "gzip",
};

const response = await fetch("https://api.cs2.sh/v1/live/capabilities", { headers });

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
```

**Go**

```go
package main

import (
    "compress/gzip"
    "encoding/json"
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://api.cs2.sh/v1/live/capabilities", nil)
    req.Header.Set("Authorization", "Bearer <<YOUR_API_KEY>>")
    req.Header.Set("Accept-Encoding", "gzip")

    resp, err := http.DefaultClient.Do(req)
    if err != nil { panic(err) }
    defer resp.Body.Close()

    if resp.StatusCode < 200 || resp.StatusCode >= 300 {
        body, _ := io.ReadAll(resp.Body)
        panic(fmt.Sprintf("HTTP %d: %s", resp.StatusCode, body))
    }

    var reader io.Reader = resp.Body
    if resp.Header.Get("Content-Encoding") == "gzip" {
        gz, err := gzip.NewReader(resp.Body)
        if err != nil { panic(err) }
        defer gz.Close()
        reader = gz
    }

    var data any
    if err := json.NewDecoder(reader).Decode(&data); err != nil { panic(err) }
    fmt.Printf("%#v\n", data)
}
```

**R**

```r
library(httr2)

resp <- request("https://api.cs2.sh/v1/live/capabilities") |>
  req_headers(
    Authorization = "Bearer <<YOUR_API_KEY>>",
    `Accept-Encoding` = "gzip"
  ) |>
  req_perform()

data <- resp_body_json(resp)
```

## 响应

```json
{
  "contract_version": 0,
  "markets": [
    {
      "market": "string",
      "currency": "string",
      "operations": null
    }
  ],
  "continuation_schema": null,
  "response_contract": null
}
```

## 响应字段

[LiveCapabilitiesResponse](/zh-cn/docs/objects#livecapabilitiesresponse) 字段:

| 字段 | 类型 | 必需 | 描述 |
| --- | --- | --- | --- |
| `contract_version` | `integer` | 否 | 此文档格式的版本。 |
| `markets` | [LiveCapabilitiesMarket[]](/zh-cn/docs/objects#livecapabilitiesmarket) | 否 | 每个市场一项。 |
| `continuation_schema` | `object` | 否 | 仅含 `cursor` 的下一页请求体的 JSON Schema。 |
| `response_contract` | `object` | 否 | 所有实时响应遵循的简要规则。 |
