# Live listings, buy orders, & more

Real-time Youpin, CSFloat, and Steam data: listings with float, paint seed, and stickers, buy orders, seller stores, and market search.

Live endpoints fetch real-time data from Youpin, CSFloat, and Steam: listings with float, paint seed, and stickers, buy orders, seller stores, and market search. Each request covers one item, listing, seller, or search on one marketplace. For prices across many items, use [prices](/docs/prices-overview), which returns every item on six marketplaces, refreshed every ~5 minutes.

```http
POST /v1/live/csfloat/listings
Content-Type: application/json

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

Every plan includes live, and so does a [demo key](#demo-keys).

## Operations

Each operation has its own path, `POST /v1/live/{market}/{operation}`.

| Operation | Returns | [Youpin](/docs/live-youpin) | [CSFloat](/docs/live-csfloat) | [Steam](/docs/live-steam) |
| --- | --- | --- | --- | --- |
| `listings` | Listings for one item | [Yes](/docs/live-youpin-listings) | [Yes](/docs/live-csfloat-listings) | [Yes](/docs/live-steam-listings) |
| `search` | Items matching text or filters | [Yes](/docs/live-youpin-search) | [Through `listings`](/docs/live-csfloat-listings) | [Yes](/docs/live-steam-search) |
| `buy_orders` | Buy orders for one item | [Yes](/docs/live-youpin-buy-orders) | [Yes](/docs/live-csfloat-buy-orders) | [Yes](/docs/live-steam-buy-orders) |
| `float_rank` | The marketplace's float ranking for one item | [Yes](/docs/live-youpin-float-rank) | - | - |
| `listing_detail` | One listing, by its ID | [Yes](/docs/live-youpin-listing-detail) | [Yes](/docs/live-csfloat-listing-detail) | [In `listings`](/docs/live-steam-listings) |
| `store` | One seller's listings | [Yes](/docs/live-youpin-store) | [Yes](/docs/live-csfloat-store) | - |

CSFloat has no separate `search` operation. A CSFloat `listings` request without `market_hash_name` searches the whole market by filters. Steam has no separate `listing_detail` operation, because every Steam `listings` row already has the listing's full detail.

Each operation also has `POST /v1/live/{market}/{operation}/options`, which lists the [valid choices](#filter-options) for one request field. [GET /v1/live/capabilities](/docs/live-capabilities) returns the JSON schema of every live request and response.

In a [structured response](#raw-and-structured-responses), rows carry the follow-up request:

| Row | Field | Request it holds |
| --- | --- | --- |
| Search item | `listings_query` | That item's `listings` |
| Listing | `detail_query` | That listing's `listing_detail` |
| Listing | `store_query` | Its seller's `store` |

Each holds a `path` and a `body` to POST unchanged. A `null` means the marketplace has no such request, as with `detail_query` and `store_query` on Steam rows.

## Requests

The request body is one JSON object. The path names the marketplace and operation, and the body never does.

| Field | Type | Meaning |
| --- | --- | --- |
| `market_hash_name` | `string` | The item, by the same name every other endpoint uses. |
| `item_id` | `string` | The marketplace's own item ID, such as a Youpin template ID or a Steam group ID. Send it instead of `market_hash_name`, never with it. |
| `search` | `string` | Text for the marketplace's text search, on the operations that have one. |
| `seller_id` | `string` | The seller, for `store`. |
| `listing` | `object` | The listing, for `listing_detail`, in `listing.listing_id`. |
| `listing_type` | `string` | `buy_now`, `auction`, `rental`, or `pre_sale`, where the marketplace has them. Without it, the request reads `buy_now` listings. |
| `filters` | `object` | Readable filters, such as price, float, paint seed, phase, and stickers. |
| `sort` | `object` | `field` and an optional `direction`, `asc` or `desc`. |
| `market_parameters` | `object` | The marketplace's own request parameters, for controls with no readable filter. See [Filters and sorting](#filters-and-sorting). |
| `raw_response` | `boolean` | `true` returns the marketplace's own JSON, and `false` returns [structured rows](#raw-and-structured-responses). Without it, the response is raw. |
| `cursor` | `string` | The next page, sent as the only field. See [Paging](#paging). |

A field the operation doesn't take returns `400` instead of being ignored.

A Doppler phase or another variant goes in the name, as in `★ Karambit | Doppler (Factory New) | Phase 4`, the same `name` that [variants](/docs/using-the-api#variants) carry on the price endpoints.

Numbers can be JSON numbers or numeric strings. IDs are always strings.

Requests take no page size or offset, and can't be batched.

## Filters and sorting

cs2.sh sends `filters` to the marketplace with the request and doesn't remove rows afterward, so a filter means what the marketplace means by it.

Filters combine with AND. A filter that takes a list matches any value in it, so `"weapon": ["AK-47", "M4A1-S"]` returns both. Every range is inclusive:

| Range | Unit |
| --- | --- |
| `min_float`, `max_float` | Float, from 0 to 1 |
| `min_fade`, `max_fade` | Fade percentage |
| `min_price`, `max_price` | The [marketplace's currency](#currency) |

A full item name already fixes the weapon, finish, wear, and quality.

Stickers, patches, and charms use one shape on every marketplace:

```json
{
  "market_hash_name": "AK-47 | Redline (Field-Tested)",
  "filters": {
    "stickers": {
      "entries": [{ "name": "Sticker | Crown (Foil)", "count": 2 }]
    }
  }
}
```

Without a `slot`, a sticker matches in any position. Several entries combine differently per marketplace:

| Marketplace | Several entries | `count` and `slot` |
| --- | --- | --- |
| Youpin | The listing must have all of them | Both supported for stickers |
| CSFloat | The listing must have all of them | Both supported for stickers and patches |
| Steam | The listing must have any of them. Send `"match": "any"` with more than one entry. | Not supported |

Without `sort.direction`, `price`, `float`, and other numeric fields sort ascending, and `created_at`, `best_deal`, `discount`, `bid_count`, `heat`, and `ranking` sort descending. Without `sort`, rows come in the marketplace's default order.

`market_parameters` takes the marketplace's own request parameters under the marketplace's own names, and only those that [capabilities](/docs/live-capabilities) lists for the operation. Sending the same control as both a filter and a parameter returns `400`.

## Filter options

Filters such as sticker names, collections, and phases accept only values the marketplace knows, and the options path lists them. Send the `field` and as much of the request as you have:

```http
POST /v1/live/csfloat/listings/options
Content-Type: application/json

{
  "market_hash_name": "AK-47 | Redline (Field-Tested)",
  "field": "filters.stickers.entries[].name",
  "contains": "Crown"
}
```

| Field | Meaning |
| --- | --- |
| `field` | Required. The request field to list choices for, as a path, such as `filters.weapon`, `filters.stickers.entries[].name`, `sort`, or `listing_type`. |
| `contains` | Optional. Keeps only labels that contain this text, ignoring case. |
| Anything else | The rest of the request, such as the item, listing type, and filters. Some choices depend on the item. |

The response is a [LiveOptionsResponse](/docs/objects#liveoptionsresponse). Each entry in `options` has a display `label` and a `query` whose `body`, POSTed to its `path`, runs your request with that choice applied. Take the value from `query.body`, not from `label`.

`completeness` is `complete` when the list holds every valid value, and `partial` when it holds suggestions and other values can be valid. Long lists are [paged](#paging) like data.

A free-input field, such as a price or a float bound, has no choices and returns `400` with `details.code` set to `free_input_field` and the field's `constraints`. An unknown `field` returns `400` with `details.code` set to `unsupported_filter`, and `details.allowed_values` lists the operation's fields that have choices.

Options requests aren't data requests. They have their own [limit](#limits) and don't use a [demo key's](#demo-keys) live requests.

## Raw and structured responses

Every live response is a [LiveResponse](/docs/objects#liveresponse):

| Field | Meaning |
| --- | --- |
| `market`, `operation` | The marketplace and operation you requested. |
| `data` | The result, shaped by `raw_response`. |
| `page` | Paging state, or `null` when the operation isn't paged. |
| `response_time` | When cs2.sh generated the response. |
| `warnings` | Notes about the request, present only when there are any. |

By default, with `raw_response: true`, `data` is the marketplace's own JSON exactly as it responded. Its shape differs by marketplace and changes when the marketplace changes it.

With `raw_response: false`, `data` has one shape per operation, the same on every marketplace:

| Operation | `data` |
| --- | --- |
| `listings`, `store` | `listings[]` of [LiveListing](/docs/objects#livelisting) |
| `listing_detail` | `listing`, one [LiveListing](/docs/objects#livelisting) |
| `buy_orders` | `buy_orders[]` of [LiveBuyOrder](/docs/objects#livebuyorder). Steam returns its orderbook instead: [SteamBuyOrderBook](/docs/objects#steambuyorderbook). |
| `float_rank` | `rankings[]` of [LiveFloatRanking](/docs/objects#livefloatranking) |
| `search` | `items[]` of [LiveSearchItem](/docs/objects#livesearchitem) |

In structured rows, prices are numbers in the [marketplace's currency](#currency), and every row with a price has its own `currency`. Times are RFC 3339 in UTC. IDs are strings, because CSFloat IDs are too large for a JSON number.

`item` is a [LiveItem](/docs/objects#liveitem). Its `market_hash_name` is the item name without a variant, and `item.variant` is the phase, gem, or tier, such as `Phase 2`, `Ruby`, or `Tier 1`.

A `null` means the marketplace didn't report the value, and `[]` means it reported none.

Auction, rental, and pre-sale listings carry an `auction`, `rental`, or `pre_sale` object with their terms. A rental listing's `price` is `null`, because its rates are in `rental`.

`data.warnings` lists each value cs2.sh couldn't map, with the row's `index`, the `field`, and a `code`: `unparsed_value`, `unknown_currency`, `unknown_variant`, `unmapped_condition`, or `unmapped_row`. A row cs2.sh can't map at all is left out and reported as `unmapped_row`.

If cs2.sh can't map the marketplace's response, the request returns `502` with `details.reason` set to `structure_unavailable`. Send it again with `raw_response: true` instead of waiting.

## Paging

Page sizes are fixed, and the marketplace can return fewer rows than a full page.

| Marketplace | Page sizes |
| --- | --- |
| Youpin | `listings`, `search`, and `float_rank`: 20. `buy_orders` and `store`: 100. |
| CSFloat | `listings` and `store`: 50. |
| Steam | `listings`: 20 for an item, 30 without one. `search`: 30. |

`listing_detail` on every marketplace, and `buy_orders` on CSFloat and Steam, aren't paged. Every paged response has a [LivePage](/docs/objects#livepage) in `page`.

When `page.next_cursor` isn't `null`, send it to the same path as the only field:

```json
{ "cursor": "<page.next_cursor>" }
```

The cursor carries the whole original request, including `raw_response`, and works only on the path that returned it.

A cursor expires 15 minutes after the first page, at `page.cursor_expires_at`, and reading more pages doesn't extend it. An expired cursor returns `400` with `details.code` set to `cursor_expired`.

Each page is one request against your [limit](#limits).

`page.total_count` is `null` when the marketplace gives no total, and `page.total_exact` is `false` when its total isn't reliable. To read every row, page until `next_cursor` is `null`.

## Currency

cs2.sh never converts live prices, and live requests have no `currency` parameter.

| Marketplace | Currency |
| --- | --- |
| Youpin | CNY |
| CSFloat | USD |
| Steam | USD, as the total the buyer pays with Steam's fee included |

A Steam `listings` request [without an item](/docs/live-steam-listings#requests-without-an-item) can return rows in other currencies, so check each row's `currency`.

Price filters and price sorting use the same currency. To convert, use the rates from [GET /v1/fx](/docs/fx).

## Limits

Live has per-minute limits instead of the 10 requests per second on the other endpoints. Each operation has its own limit, shared by every key on your account, and the options paths of one marketplace share one more. The numbers for every plan are under [Live limits](/docs/pricing#live-limits).

## Demo keys

A [demo key](/docs/pricing#demo-key) gets 100 live data requests for its lifetime instead of the plan limits. A request that never reaches the marketplace doesn't use one.

## Latency

cs2.sh adds ~20 ms or less to a live request. The rest is the marketplace's response time, listed for [Youpin](/docs/live-youpin#latency), [CSFloat](/docs/live-csfloat#latency), and [Steam](/docs/live-steam#latency).

## Errors and retries

Live errors use the [shared error object](/docs/using-the-api#request-errors) and always include `details`. Branch on `details.code`, because `message` is written for people and can change.

| Status | `details.code` | Meaning |
| --- | --- | --- |
| `400` | `missing_field`, `invalid_field`, `unknown_value`, `unsupported_field`, `unsupported_filter`, `invalid_range`, `conflicting_fields`, `conflicting_filters`, and others | The request is invalid. Fix it before you send it again. |
| `400` | `cursor_expired`, `invalid_cursor`, `cursor_mismatch` | The cursor can't be used. Send the original request again, to the path that returned the cursor. |
| `403` | `live_not_enabled` | Your account can't call this operation. |
| `403` | `live_demo_exhausted` | The demo key has used all its live requests. |
| `404` | `unsupported_market`, `unsupported_operation` | The path isn't a live operation. `details.allowed_values` lists the ones that exist. |
| `404` | - | The listing, seller, or item doesn't exist on the marketplace. `details.field` names which. |
| `429` | `live_rate_limit` | You're over this operation's per-minute limit. |
| `429` | `live_concurrency_limit` | Too many of your requests to this operation are in flight. |
| `502` | - | The marketplace returned nothing usable. `details.reason` is `timeout`, `refused`, `empty_response`, `invalid_response`, `server_error`, `connection_failed`, or `structure_unavailable`. |
| `503` | - | cs2.sh can't send the request right now. |
| `504` | - | The request ran out of time. |

A `400` names the field at fault in `details.field`, and one of these says how to fix it:

| `details` field | Meaning |
| --- | --- |
| `required_fields`, `required_any_of` | The missing fields. `required_any_of` lists groups where you must send exactly one. |
| `allowed_values` | The values the field accepts. |
| `required_values` | For each field you sent whose value can't be combined with the rest, the values that would work. |
| `conflicts` | The fields that can't be sent together. |
| `candidates` | The things the name matches, each with a corrected `query`. |

After a `429`, wait `details.retry_after_seconds` before you send the request again. After a `502`, `503`, or `504`, retry after a short wait with backoff, except a `502` with [`structure_unavailable`](#raw-and-structured-responses).

A request counts against your [limit](/docs/pricing#what-counts-against-a-limit) when the marketplace responds, even with a `404` or no rows, and when you cancel it by disconnecting. Rejected and failed requests don't count.
