POST /v1/live/youpin/buy_orders
Returns the open Youpin buy orders for one item, each with its price, its quantity, and the conditions it puts on the item, such as a float range, a phase, or a fade range.
Available on all plans, at 4 requests per minute on Developer and 20 on Scale. Each request is for one item, with up to 100 orders 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. |
item_id | string | The item's Youpin template ID. |
filters | object | See Filters. |
raw_response | boolean | false returns structured rows. Without it, data is Youpin's own JSON. |
{
"market_hash_name": "AWP | Asiimov (Field-Tested)"
}Buy orders have no listing types and no sorting, and come back in Youpin's order.
Filters
| Filter | Type | Meaning |
|---|---|---|
min_float, max_float | number | Orders whose float condition is exactly this range, from 0 to 1. Send both. |
fade_bucket | object | Orders for exactly this fade range, as min and max from 0 to 100. The range must be one Youpin offers for the item. |
phase | string | Orders for one Doppler phase or gem, such as Ruby. The response can also include orders that accept any phase. |
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.
Request
curl -X POST https://api.cs2.sh/v1/live/youpin/buy_orders \
-H "Authorization: Bearer <<YOUR_API_KEY>>" \
-H "Accept-Encoding: gzip" --compressed \
-H "Content-Type: application/json" \
-d '{
"market_hash_name": "AWP | Asiimov (Field-Tested)",
"raw_response": false
}'Response
{
"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 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 | null | No | Paging for the next request. null on operations that aren't paged. |
warnings | 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.buy_orders[] holds one LiveBuyOrder per order:
| Field | Description |
|---|---|
id | The order ID. |
price, currency | What the buyer pays per item, in CNY. |
quantity | How many the buyer wants. |
market_hash_name | The item the order is for. |
conditions | What the order requires of the item: min_float and max_float, min_fade and max_fade, or variant. null means the order takes any copy of the item. |
created_at | When the buyer placed the order. |
An order with conditions set to {} and an unmapped_condition entry in data.warnings has a condition cs2.sh couldn't read. Treat it as a restricted order, not one that takes any copy.
In a phase request, an order that accepts any phase has no variant in its conditions.
Float filters match exact ranges
min_float and max_float return the orders whose float condition is exactly that range, not every order that would accept a float in it. An order that accepts floats from 0.06 to 0.07 is returned for this request:
{
"market_hash_name": "AK-47 | Red Laminate (Factory New)",
"filters": { "min_float": 0.06, "max_float": 0.07 }
}It isn't returned for 0.063 to 0.067, even though that range sits inside it. A float filter can also leave out orders with no float condition.
On CSFloat, a float range returns every order that would accept it. The float ranges buyers use on an item come from the options path below, or from each order's conditions in a request without a float filter.
Errors
A request returns 400 when it sends only one of min_float and max_float, or a fade_bucket that Youpin doesn't offer for the item. Other errors are the shared live errors.
POST /v1/live/youpin/buy_orders/options
Returns the valid choices for one field of a buy orders request. Every field needs an item:
field | Choices |
|---|---|
filters.min_float, filters.max_float | The float ranges Youpin suggests for the item, as pairs |
filters.fade_bucket | The fade ranges Youpin offers for the item |
filters.phase | The phases and gems the item has |
Each option's query is a complete buy orders request with the choice applied.
{
"market_hash_name": "AK-47 | Red Laminate (Factory New)",
"field": "filters.min_float"
}The float ranges are suggestions, so completeness is partial. Any valid pair works, and some items have no suggestions. The listed fade ranges are the only ones the filter accepts.
Request
curl -X POST https://api.cs2.sh/v1/live/youpin/buy_orders/options \
-H "Authorization: Bearer <<YOUR_API_KEY>>" \
-H "Accept-Encoding: gzip" --compressed \
-H "Content-Type: application/json" \
-d '{
"market_hash_name": "AK-47 | Red Laminate (Factory New)",
"field": "filters.min_float"
}'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
{
"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 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[] | No | The choices. |
metadata | object | No | Information about the choice list, such as when it was fetched. |
page | LivePage | No | Paging for long choice lists. |
response_time | string (date-time) | No | When cs2.sh sent the response (UTC). |