New: live data for Youpin, CSFloat, and Steam

POST /v1/live/youpin/search

Returns the Youpin items that match a search, each with its lowest price and its number of listings.

Available on all plans, at 6 requests per minute on Developer and 36 on Scale. Each request is for one search, with up to 20 items per page.

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

Inputs#

Every field is optional. Send search, filters, or both.

FieldTypeMeaning
searchstringText that Youpin matches against its Chinese item names.
listing_typestringbuy_now, rental, or auction. Without it, the search covers buy now listings.
filtersobjectSee Filters.
sortobjectSee Sorting.
raw_responsebooleanfalse returns structured rows. Without it, data is Youpin's own JSON.

An auction search can also take a market_hash_name or an item_id, to return one item's auctions.

{
  "filters": {
    "weapon": "AK-47",
    "collection": "The Gallery Collection",
    "max_price": 500
  },
  "sort": { "field": "price" }
}

Filters#

Filters search Youpin in English. Each takes a single value or a list of up to 50.

FilterTypeMeaning
weaponstring or string[]The weapon, such as AK-47. You can't send it with item_type.
item_typestring or string[]The kind of item, for items that aren't weapons.
qualitystring or string[]The quality, such as normal or stattrak. Both include ★ items.
raritystring or string[]The item's rarity.
wearstring or string[]The wear, such as Field-Tested.
collectionstring or string[]The collection's English name, such as The Gallery Collection.
colorstring or string[]Youpin's own color grouping for the item.
knife_finishstring or string[]The finish of a knife.
sticker_slabstring or string[]Sticker slab items. It doesn't filter the stickers on weapons.
min_price, max_pricenumberThe item's lowest listing price in CNY, inclusive.
stickersobjectItems with listings that carry these stickers, in the same forms as on listings.
min_short_daily_rent, max_short_daily_rentnumberRentals only. The short-term rent in CNY per day.
min_long_daily_rent, max_long_daily_rentnumberRentals only. The long-term rent in CNY per day. A maximum needs a minimum above 0.
min_deposit, max_depositnumberRentals only. The deposit in CNY.

Buy now search takes all of these except the rent and deposit filters. The other listing types take fewer:

listing_typeFilters
rentalEverything buy now takes except min_price, max_price, and stickers, plus the rent and deposit filters.
auctionweapon, min_price, max_price, and stickers with one sticker by name.

The options path lists each filter's accepted values. Youpin's own request parameters go in market_parameters.

Sorting#

listing_typesort.field
buy_nowprice, listing_count (ascending by default), ranking (descending only)
rentalshort_daily_rent, long_daily_rent, deposit (ascending by default), ranking (descending only)
auctionprice, watcher_count (ascending by default), bid_count (descending by default)

ranking is Youpin's own order, and the default without sort.

Request#

POSTapi.cs2.sh/v1/live/youpin/search
curl -X POST https://api.cs2.sh/v1/live/youpin/search \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "filters": {
    "weapon": "AK-47",
    "collection": "The Gallery Collection",
    "max_price": 500
  },
  "sort": {
    "field": "price"
  },
  "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:

FieldTypeRequiredDescription
marketstringNoThe marketplace: youpin, csfloat, or steam.
operationstringNoThe operation that ran, such as listings.
dataobjectNoWith 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.
pageLivePage | nullNoPaging for the next request. null on operations that aren't paged.
warningsLiveRequestWarning[]NoNotes about the request itself. Absent when there are none.
response_timestring (date-time)NoWhen cs2.sh sent the response (UTC).

Response data#

With raw_response: false, data.items[] holds one LiveSearchItem per item:

FieldDescription
market_hash_nameThe item's name, valid in any other request.
item_idThe item's Youpin template ID.
lowest_price, listing_countThe cheapest listing's price in CNY, and the number of listings.
highest_buy_order, buy_order_quantityThe best buy order, and how many units buyers want.
rentalRental search only: short_daily_rent, long_daily_rent, deposit, listing_count.
listings_queryThe listings request for this item.

An auction search returns auctions instead of items, in data.listings[]. Each one is a LiveListing with an auction object.

Notes#

A stickers filter with min_price, max_price, or sort returns 400, because Youpin applies price and order before the sticker filter and the combined result would be wrong. To filter by stickers and price together, use listings on one item.

An auction search reads Youpin's list of ending auctions, not every auction on Youpin. Listings with "listing_type": "auction" can return auctions for an item that the search doesn't.

Pre-sales can't be searched. Read them per item with listings, or per seller with store.

page.total_count isn't exact here, and page.total_exact is false.

Errors#

A filter value that Youpin doesn't have returns 400 with details.code set to unknown_value. Other errors are the shared live errors.

POST /v1/live/youpin/search/options#

Returns the valid choices for one field of a search request, and needs no item. These fields have choices:

fieldChoices
filters.weapon, filters.item_type, filters.quality, filters.rarity, filters.wearYoupin's categories, in English
filters.collection, filters.color, filters.knife_finish, filters.sticker_slabYoupin's groupings, in English
filters.stickers.entries[].name, filters.stickers.entries[].categorySticker names and sticker categories
filters.stickers.presetYoupin's sticker sets
sortThe sorts available
listing_typeThe listing types

To get one listing type's choices, send listing_type with field. Each option's query is a complete search request with the choice applied.

{
  "field": "filters.collection",
  "contains": "Gallery"
}

Request#

POSTapi.cs2.sh/v1/live/youpin/search/options
curl -X POST https://api.cs2.sh/v1/live/youpin/search/options \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "field": "filters.collection",
  "contains": "Gallery"
}'

Parameters#

FieldTypeRequiredDescription
fieldstringYesThe request field to list choices for, such as filters.weapon or filters.stickers.entries[].name.
containsstringNoText that a choice's label must contain, matched without regard to case.
cursorstringNoThe 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:

FieldTypeRequiredDescription
marketstringNoThe marketplace.
operationstringNoThe data operation the choices apply to.
fieldstringNoThe request field the choices are for.
availabilitystringNoWhether choices could be loaded for this request.
completenessstringNocomplete when the list holds every accepted value. partial when it holds suggestions, and other values may also work.
optionsLiveOption[]NoThe choices.
metadataobjectNoInformation about the choice list, such as when it was fetched.
pageLivePageNoPaging for long choice lists.
response_timestring (date-time)NoWhen cs2.sh sent the response (UTC).