# GET /v1/live/capabilities

JSON schemas of every live Youpin, CSFloat, and Steam operation: paths, request and response schemas, filters, sort fields, and example requests.

Returns a machine-readable description of every [live](/docs/live-overview) operation: its path, the JSON schemas of its request and structured response, its filters, sort fields, listing types, and page size, and example requests.

Available on all plans, at [10 requests per second](/docs/using-the-api#limits).

It lists every operation, whether or not your plan includes it.

It isn't a live request. It doesn't count toward the [live limits](/docs/pricing#live-limits) or use a demo key's live requests.

## Query parameters

| Parameter | Description |
| --- | --- |
| `market` | Returns only this marketplace: `youpin`, `csfloat`, or `steam`. |
| `operation` | Returns only this operation, such as `listings` or `buy_orders`. |

Both are optional and can be combined, as in `?market=youpin&operation=listings`. The full document is ~450 KB before compression.

## Request

`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)
```

## Response

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

## Response fields

[LiveCapabilitiesResponse](/docs/objects#livecapabilitiesresponse) fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contract_version` | `integer` | No | The version of this document's format. |
| `markets` | [LiveCapabilitiesMarket[]](/docs/objects#livecapabilitiesmarket) | No | One entry per marketplace. |
| `continuation_schema` | `object` | No | The JSON Schema of a next-page body that holds only `cursor`. |
| `response_contract` | `object` | No | Short rules every live response follows. |

## Response data

`contract_version` is currently `1`. Each entry in `markets[]` has the marketplace's `market`, `currency`, and `operations`, keyed by operation name.

Each operation lists:

| Field | Meaning |
| --- | --- |
| `path`, `options_path` | Where to POST the request, and where to POST its [options](/docs/live-overview#filter-options) request. |
| `request_schema` | JSON Schema for the request body, with one variant per `listing_type` where the operation has listing types. |
| `options_schema` | JSON Schema for the options request body. |
| `response_schema` | JSON Schema for `data` with `raw_response: false`. |
| `required_fields`, `required_any_of` | The fields a request must have. `required_any_of` lists groups where exactly one is needed. |
| `default_listing_type`, `listing_modes` | The operation's listing types and the page size of each. Empty when it has none. |
| `page_size` | Rows per page, or `null` when the operation isn't paged. |
| `common_filters` | The names accepted in `filters`. |
| `sort_fields` | The values accepted in `sort.field`. |
| `market_parameters` | The names accepted in `market_parameters`. |
| `semantics` | The marketplace's `currency`, what `price` means for each listing type, and how several stickers, patches, or charms combine. |
| `examples` | Valid request bodies for `path`. |

## Using the schemas

The schemas are JSON Schema, Draft 2020-12. `request_schema` is the complete truth for field names, types, allowed values, and bounds, and `common_filters`, `sort_fields`, and `market_parameters` summarize it.

A schema can't express three checks, which cs2.sh makes when you send the request:

- whether the item exists;
- whether a minimum is below its maximum;
- whether a phase or sticker belongs to the item you named.

A failed check returns a `400` [live error](/docs/live-overview#errors-and-retries) with `details.code` and `details.field`. Values from the marketplace's catalog, such as sticker names, collections, and phases, come from the operation's [options path](/docs/live-overview#filter-options).

## Errors

The request returns `400 validation_error` in three cases:

- an unknown `market` or `operation`, with the valid ones in `details.allowed_values`;
- a repeated parameter;
- a parameter other than `market` and `operation`.

Other errors are the [shared request errors](/docs/using-the-api#request-errors).
