# POST /v1/live/youpin/listing_detail

按 ID 获取单个 Youpin 实时挂单

按挂单 ID 返回单个 Youpin 挂单，附带 Youpin 所提供的最完整饰品数据。价格为 CNY。不分页。

## 请求

`POST https://api.cs2.sh/v1/live/youpin/listing_detail`

**curl**

```bash
curl -X POST https://api.cs2.sh/v1/live/youpin/listing_detail \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "listing": {
    "listing_id": "2108650166"
  },
  "raw_response": false
}'
```

**Python**

```python
import requests

headers = {
    "Authorization": "Bearer <<YOUR_API_KEY>>",
    "Accept-Encoding": "gzip",
    "Content-Type": "application/json",
}

payload = {
    "listing": {
        "listing_id": "2108650166",
    },
    "raw_response": False,
}

response = requests.post(
    "https://api.cs2.sh/v1/live/youpin/listing_detail",
    headers=headers,
    json=payload,
)

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

**Node**

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

const response = await fetch("https://api.cs2.sh/v1/live/youpin/listing_detail", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "listing": {
      "listing_id": "2108650166"
    },
    "raw_response": false
  }),
});

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

**Go**

```go
package main

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

func main() {
    payload := map[string]any{
        "listing": map[string]any{
            "listing_id": "2108650166",
        },
        "raw_response": false,
    }
    body, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", "https://api.cs2.sh/v1/live/youpin/listing_detail", bytes.NewReader(body))
    req.Header.Set("Content-Type", "application/json")
    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)

payload <- list(
  listing = list(
    listing_id = "2108650166"
  ),
  raw_response = FALSE
)

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

data <- resp_body_json(resp)
```

## 参数

| 字段 | 类型 | 必需 | 描述 |
| --- | --- | --- | --- |
| `market_hash_name` | `string` | 否 | 饰品完整的 `market_hash_name`，包含变体后缀，例如 ` \| Phase 2`。 |
| `item_id` | `string` | 否 | 饰品的 Youpin 模板 ID（字符串），可代替 `market_hash_name`。 |
| `listing` | `object` | 是 | 要读取的挂单，为一个对象，其 `listing_id` 为挂单响应中的 `id`。 |
| `market_parameters` | `object` | 否 | 市场自身的请求参数，由 cs2.sh 校验。不要重复 `filters` 已设置的条件。 |
| `raw_response` | `boolean` | 否 | 默认值: `true`. 为 `true`（默认）时，`data` 为市场自身的 JSON。为 `false` 时，`data` 为 cs2.sh 的结构化数据行。 |
| `cursor` | `string` | 否 | 上一页返回的 `page.next_cursor`，单独发送到同一路径以获取下一页。 |

## 响应

```json
{
  "market": "string",
  "operation": "string",
  "data": null,
  "page": {
    "page_size": 0,
    "has_next": false,
    "next_cursor": "string",
    "cursor_expires_at": "string",
    "total_count": 0,
    "total_exact": false
  },
  "warnings": [
    {
      "code": "string",
      "field": "string",
      "message": "string"
    }
  ],
  "response_time": "string"
}
```

## 响应字段

[LiveResponse](/zh-cn/docs/objects#liveresponse) 字段:

| 字段 | 类型 | 必需 | 描述 |
| --- | --- | --- | --- |
| `market` | `string` | 否 | 市场：`youpin`、`csfloat` 或 `steam`。 |
| `operation` | `string` | 否 | 所执行的操作，例如 `listings`。 |
| `data` | `object` | 否 | `raw_response: true`（默认）时为市场自身的 JSON，不做修改。`raw_response: false` 时为该操作的结构化对象，即 `LiveListingsData`、`LiveListingDetailData`、`LiveBuyOrdersData`、`SteamBuyOrderBook`、`LiveFloatRankData` 或 `LiveSearchData` 之一。 |
| `page` | [LivePage](/zh-cn/docs/objects#livepage) \| `null` | 否 | 下一次请求的分页信息。不分页的操作为 `null`。 |
| `warnings` | [LiveRequestWarning[]](/zh-cn/docs/objects#liverequestwarning) | 否 | 关于请求本身的提示。没有提示时不返回此字段。 |
| `response_time` | `string (date-time)` | 否 | cs2.sh 发送响应的时间（UTC）。 |

## POST /v1/live/youpin/listing_detail/options

挂单详情不接受筛选或排序，因此此路径没有有用的内容可列出。之所以存在，是因为每个实时操作都有可选值路径。

### 请求

`POST https://api.cs2.sh/v1/live/youpin/listing_detail/options`

**curl**

```bash
curl -X POST https://api.cs2.sh/v1/live/youpin/listing_detail/options \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "field": "string",
  "contains": "string",
  "cursor": "string"
}'
```

**Python**

```python
import requests

headers = {
    "Authorization": "Bearer <<YOUR_API_KEY>>",
    "Accept-Encoding": "gzip",
    "Content-Type": "application/json",
}

payload = {
    "field": "string",
    "contains": "string",
    "cursor": "string",
}

response = requests.post(
    "https://api.cs2.sh/v1/live/youpin/listing_detail/options",
    headers=headers,
    json=payload,
)

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

**Node**

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

const response = await fetch("https://api.cs2.sh/v1/live/youpin/listing_detail/options", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "field": "string",
    "contains": "string",
    "cursor": "string"
  }),
});

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

**Go**

```go
package main

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

func main() {
    payload := map[string]any{
        "field": "string",
        "contains": "string",
        "cursor": "string",
    }
    body, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", "https://api.cs2.sh/v1/live/youpin/listing_detail/options", bytes.NewReader(body))
    req.Header.Set("Content-Type", "application/json")
    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)

payload <- list(
  field = "string",
  contains = "string",
  cursor = "string"
)

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

data <- resp_body_json(resp)
```

### 参数

| 字段 | 类型 | 必需 | 描述 |
| --- | --- | --- | --- |
| `field` | `string` | 是 | 要列出可选值的请求字段，例如 `filters.weapon` 或 `filters.stickers.entries[].name`。 |
| `contains` | `string` | 否 | 选项标签必须包含的文本，不区分大小写。 |
| `cursor` | `string` | 否 | 上一页选项返回的 `page.next_cursor`，作为唯一字段发送。 |

### 响应

```json
{
  "market": "string",
  "operation": "string",
  "field": "string",
  "availability": "string",
  "completeness": "string",
  "options": [
    {
      "label": "string",
      "query": {
        "path": "string",
        "body": null
      }
    }
  ],
  "metadata": null,
  "page": {
    "page_size": 0,
    "has_next": false,
    "next_cursor": "string",
    "cursor_expires_at": "string",
    "total_count": 0,
    "total_exact": false
  },
  "response_time": "string"
}
```

### 响应字段

[LiveOptionsResponse](/zh-cn/docs/objects#liveoptionsresponse) 字段:

| 字段 | 类型 | 必需 | 描述 |
| --- | --- | --- | --- |
| `market` | `string` | 否 | 市场。 |
| `operation` | `string` | 否 | 可选值所适用的数据操作。 |
| `field` | `string` | 否 | 可选值所对应的请求字段。 |
| `availability` | `string` | 否 | 是否能为此请求加载可选值。 |
| `completeness` | `string` | 否 | 列表包含全部可接受值时为 `complete`。列表为建议值时为 `partial`，其他值也可能有效。 |
| `options` | [LiveOption[]](/zh-cn/docs/objects#liveoption) | 否 | 可选值。 |
| `metadata` | `object` | 否 | 关于可选值列表的信息，例如获取时间。 |
| `page` | [LivePage](/zh-cn/docs/objects#livepage) | 否 | 长列表的分页信息。 |
| `response_time` | `string (date-time)` | 否 | cs2.sh 发送响应的时间（UTC）。 |
