# POST /v1/live/youpin/listings

Current Youpin (youpin898) listings for a CS2 item with float, paint seed, phase, and stickers: buy now, rental, auction, and pre-sale, in CNY.

Returns the current Youpin listings for one item, each with its price, float, paint seed, phase or tier, stickers, and seller.

Available on all plans, at [6 requests per minute on Developer and 36 on Scale](/docs/pricing#live-limits). Each request is for one item, with up to 20 listings per page.

Prices are in CNY and aren't converted. Data is real-time.

## Inputs

Send exactly one of `market_hash_name` and `item_id`. Everything else is optional.

| Field | Type | Meaning |
| --- | --- | --- |
| `market_hash_name` | `string` | The item. A phase or tier in the name returns only that variant. |
| `item_id` | `string` | The item's Youpin [template ID](/docs/live-youpin#ids). |
| `listing_type` | `string` | `buy_now`, `rental`, `auction`, or `pre_sale`. See [Listing types](/docs/live-youpin#listing-types). Without it, the request returns buy now listings. |
| `filters` | `object` | See [Filters](#filters). |
| `sort` | `object` | See [Sorting](#sorting). |
| `raw_response` | `boolean` | `false` returns [structured rows](/docs/live-overview#raw-and-structured-responses). Without it, `data` is Youpin's own JSON. |

```json
{
  "market_hash_name": "AK-47 | Redline (Field-Tested)",
  "filters": { "max_float": 0.2, "max_price": 300 },
  "sort": { "field": "price" }
}
```

## Filters

Every filter is optional. Buy now listings take all of these except the rent and deposit filters.

| Filter | Type | Meaning |
| --- | --- | --- |
| `min_price`, `max_price` | `number` | The listing price in CNY, inclusive. |
| `min_float`, `max_float` | `number` | The float, from 0 to 1, inclusive. Either can be sent alone. |
| `min_fade`, `max_fade` | `number` | The fade percentage, from 0 to 100, for items that have one. |
| `paint_seeds` | `integer[]` | The paint seed. Youpin takes exactly one per request. |
| `phase` | `string` | A Doppler phase or gem the item has, such as `Phase 2` or `Ruby`. |
| `tier` | `string` | A tier the item has, such as `Tier 1`. You can't send it with `phase`. |
| `stickers` | `object` | Stickers on the item. See [Stickers, patches, and charms](#stickers-patches-and-charms). |
| `patches` | `object` | Patches on the item. |
| `charms` | `object` | Whether a charm is attached. |
| `has_name_tag` | `boolean` | Whether the item has a name tag. |
| `charm_pattern` | `integer` | Charm items only. The exact pattern of the charm. |
| `min_charm_pattern`, `max_charm_pattern` | `integer` | Charm items only. A pattern range. Send both. |
| `pattern_preset` | `string` | Charm items only. One of Youpin's named pattern groups for the item. |
| `fast_delivery` | `true` | Only listings Youpin marks for fast delivery. |
| `group_identical` | `boolean` | Youpin merges identical listings into one row. |
| `min_short_daily_rent`, `max_short_daily_rent` | `number` | Rentals only. The short-term rent in CNY per day. |
| `min_long_daily_rent`, `max_long_daily_rent` | `number` | Rentals only. The long-term rent in CNY per day. A maximum needs a minimum above 0. |
| `min_deposit`, `max_deposit` | `number` | Rentals only. The deposit in CNY. |

The other listing types take fewer filters:

| `listing_type` | Filters |
| --- | --- |
| `rental` | Everything buy now takes except `min_price`, `max_price`, and `group_identical`, plus the rent and deposit filters. |
| `auction` | `min_price`, `max_price`, `min_float`, `max_float`, `paint_seeds`, `has_name_tag`, `charms`, and `stickers` by `name` only. |
| `pre_sale` | `min_price`, `max_price`, `min_float`, `max_float`, `paint_seeds`, `phase`, `has_name_tag`, `charms`, and `stickers` by `presence` only. |

`weapon`, `finish`, `wear`, and `quality` are accepted, but cs2.sh only checks them against the item, and a mismatch returns `400`.

Youpin's own request parameters go in [`market_parameters`](/docs/live-overview#filters-and-sorting).

### Stickers, patches, and charms

`filters.stickers` takes one of three forms:

| Form | Meaning |
| --- | --- |
| `entries` | Up to 5 stickers, each by `name`, such as `Sticker \| Crown (Foil)`, or by `category`. The listing must have all of them. |
| `preset` | One of Youpin's sticker sets: `four_holo`, `four_foil`, `four_gold`, `four_shining`, `five_holographic`, `five_gold_sticker`, `five_bright`, or `five_shining`. |
| `presence` | `present` for any sticker, `absent` for none. |

An entry can have a `count`, the number of copies of that sticker, or a `slot` from 0 to 4, its position, but not both. Give a `slot` on every entry or on none. `"unscraped": true` requires every sticker on the item to be unscraped.

A preset matches four or five stickers of that finish, not necessarily the same sticker.

`filters.patches` takes `presence`, or up to 5 `entries` by `name` with an optional `count`. `filters.charms` takes only `presence`, because Youpin can't filter by which charm is attached.

```json
{
  "market_hash_name": "AK-47 | Redline (Field-Tested)",
  "filters": {
    "stickers": { "entries": [{ "name": "Sticker | Crown (Foil)", "slot": 0 }] },
    "charms": { "presence": "absent" }
  }
}
```

## Sorting

`sort.direction` reverses a field's default direction. Without `sort`, listings come in Youpin's default order.

| `listing_type` | `sort.field` |
| --- | --- |
| `buy_now` | `price`, `float`, `charm_pattern` (ascending by default), `created_at` and `heat` (descending only) |
| `rental` | `short_daily_rent`, `long_daily_rent`, `deposit`, `float` (ascending by default), `heat` (descending only) |
| `auction` | `bid_count` (descending by default), `expires_at` (ascending by default) |
| `pre_sale` | `price`, `float`, `delivery_time`, `compensation` (ascending by default) |

`heat` is Youpin's popularity order. `charm_pattern` needs a charm item, and not every item offers `float` for rentals. A sort the item doesn't have returns `400`.

## Request

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

**curl**

```bash
curl -X POST https://api.cs2.sh/v1/live/youpin/listings \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "market_hash_name": "AK-47 | Redline (Field-Tested)",
  "filters": {
    "max_float": 0.2,
    "max_price": 300
  },
  "sort": {
    "field": "price"
  },
  "raw_response": false
}'
```

**Python**

```python
import requests

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

payload = {
    "market_hash_name": "AK-47 | Redline (Field-Tested)",
    "filters": {
        "max_float": 0.2,
        "max_price": 300,
    },
    "sort": {
        "field": "price",
    },
    "raw_response": False,
}

response = requests.post(
    "https://api.cs2.sh/v1/live/youpin/listings",
    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/listings", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "market_hash_name": "AK-47 | Redline (Field-Tested)",
    "filters": {
      "max_float": 0.2,
      "max_price": 300
    },
    "sort": {
      "field": "price"
    },
    "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{
        "market_hash_name": "AK-47 | Redline (Field-Tested)",
        "filters": map[string]any{
            "max_float": 0.2,
            "max_price": 300,
        },
        "sort": map[string]any{
            "field": "price",
        },
        "raw_response": false,
    }
    body, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", "https://api.cs2.sh/v1/live/youpin/listings", 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(
  market_hash_name = "AK-47 | Redline (Field-Tested)",
  filters = list(
    max_float = 0.2,
    max_price = 300
  ),
  sort = list(
    field = "price"
  ),
  raw_response = FALSE
)

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

data <- resp_body_json(resp)
```

## Response

```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"
}
```

## Response fields

[LiveResponse](/docs/objects#liveresponse) fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `market` | `string` | No | The marketplace: `youpin`, `csfloat`, or `steam`. |
| `operation` | `string` | No | The operation that ran, such as `listings`. |
| `data` | `object` | No | With `raw_response: true`, the default, the marketplace's own JSON, unchanged. With `raw_response: false`, the operation's structured object, which is one of `LiveListingsData`, `LiveListingDetailData`, `LiveBuyOrdersData`, `SteamBuyOrderBook`, `LiveFloatRankData`, or `LiveSearchData`. |
| `page` | [LivePage](/docs/objects#livepage) \| `null` | No | Paging for the next request. `null` on operations that aren't paged. |
| `warnings` | [LiveRequestWarning[]](/docs/objects#liverequestwarning) | No | Notes about the request itself. Absent when there are none. |
| `response_time` | `string (date-time)` | No | When cs2.sh sent the response (UTC). |

## Response data

With `raw_response: false`, `data.listings[]` holds one [LiveListing](/docs/objects#livelisting) per listing:

| Field | Description |
| --- | --- |
| `id` | The listing ID. |
| `listing_type` | `buy_now`, `rental`, `auction`, or `pre_sale`. |
| `price`, `currency` | The price in CNY, or `null` for a rental. |
| `seller_id` | The seller's Youpin user ID. |
| `item` | The item as a [LiveItem](/docs/objects#liveitem): `market_hash_name`, `variant`, `float`, `paint_seed`, `paint_index`, `stickers[]`, `charms[]`, `patches[]`, `name_tag`, and more. |
| `rental` | Rentals only: `short_daily_rent`, `long_daily_rent`, `deposit`, `max_days`. |
| `auction` | Auctions only: `starting_price`, `current_bid`, `buyout_price`, `bid_count`, `expires_at`. |
| `pre_sale` | Pre-sales only: `delivery_time`, `compensation`. |
| `detail_query` | The [listing detail](/docs/live-youpin-listing-detail) request for this listing. |
| `store_query` | The [store](/docs/live-youpin-store) request for its seller. |

## Notes

A listing row is Youpin's short form of the item. Its `detail_query` returns the full listing.

Auction rows have no listing detail, so their `detail_query` is `null`. Their `id` is the auction's ID, and their sticker `slot` is `null`. An auction's `price` is the higher of its starting price and its current bid, and its buyout is `auction.buyout_price`.

A rental gives daily rates, and cs2.sh doesn't compute a total for a rental length.

`pre_sale.delivery_time` is in UTC. Youpin shows it in China time without a year, so cs2.sh takes the year closest to now.

The last page can be short, or empty.

## Errors

A request returns `400` with `details.code` set to `unknown_value` when the name isn't in the [schema](/docs/schema), or the item doesn't have the phase, tier, or preset you sent. `details.allowed_values` lists the item's values when cs2.sh knows them. Other errors are the [shared live errors](/docs/live-overview#errors-and-retries).

## POST /v1/live/youpin/listings/options

Returns the valid [choices](/docs/live-overview#filter-options) for one field of a listings request. These fields have choices:

| `field` | Choices | Needs an item |
| --- | --- | --- |
| `filters.phase`, `filters.tier` | The phases, gems, or tiers the item has | Yes |
| `filters.pattern_preset` | The pattern groups Youpin offers for a charm item | Yes |
| `filters.stickers.entries[].name` | Sticker names | No |
| `filters.stickers.entries[].category` | Sticker categories | No |
| `filters.stickers.preset` | The sticker sets the item has | Yes |
| `filters.patches.entries[].name` | Patch names | Yes |
| `sort` | The sorts available | No |
| `listing_type` | The listing types | No |

To get one listing type's choices, send `listing_type` with `field`. Each option's `query` is a complete listings request with the choice applied, and a sticker choice is added to the stickers already in your request.

```json
{
  "market_hash_name": "★ Karambit | Doppler (Factory New)",
  "field": "filters.phase"
}
```

Sticker name choices are suggestions, so `completeness` is `partial`. Youpin matches a sticker by its full English name, including names that aren't in the list.

### Request

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

**curl**

```bash
curl -X POST https://api.cs2.sh/v1/live/youpin/listings/options \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "market_hash_name": "★ Karambit | Doppler (Factory New)",
  "field": "filters.phase"
}'
```

**Python**

```python
import requests

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

payload = {
    "market_hash_name": "★ Karambit | Doppler (Factory New)",
    "field": "filters.phase",
}

response = requests.post(
    "https://api.cs2.sh/v1/live/youpin/listings/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/listings/options", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "market_hash_name": "★ Karambit | Doppler (Factory New)",
    "field": "filters.phase"
  }),
});

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{
        "market_hash_name": "★ Karambit | Doppler (Factory New)",
        "field": "filters.phase",
    }
    body, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", "https://api.cs2.sh/v1/live/youpin/listings/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(
  market_hash_name = "★ Karambit | Doppler (Factory New)",
  field = "filters.phase"
)

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

data <- resp_body_json(resp)
```

### Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `field` | `string` | Yes | The request field to list choices for, such as `filters.weapon` or `filters.stickers.entries[].name`. |
| `contains` | `string` | No | Text that a choice's label must contain, matched without regard to case. |
| `cursor` | `string` | No | The `page.next_cursor` from the previous page of choices, sent as the only field. |

### Response

```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"
}
```

### Response fields

[LiveOptionsResponse](/docs/objects#liveoptionsresponse) fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `market` | `string` | No | The marketplace. |
| `operation` | `string` | No | The data operation the choices apply to. |
| `field` | `string` | No | The request field the choices are for. |
| `availability` | `string` | No | Whether choices could be loaded for this request. |
| `completeness` | `string` | No | `complete` when the list holds every accepted value. `partial` when it holds suggestions, and other values may also work. |
| `options` | [LiveOption[]](/docs/objects#liveoption) | No | The choices. |
| `metadata` | `object` | No | Information about the choice list, such as when it was fetched. |
| `page` | [LivePage](/docs/objects#livepage) | No | Paging for long choice lists. |
| `response_time` | `string (date-time)` | No | When cs2.sh sent the response (UTC). |
