New: live data for Youpin, CSFloat, and Steam

Using the API

This page covers the conventions shared across cs2.sh API endpoints, including authentication, request types, items, variants, response objects, timestamps, missing data, partial success, currency, paging, errors, and limits.

  • For a guided first request, start with the Quickstart.
  • For marketplace fields, refresh rates, and historical coverage, see Data Coverage.
  • Individual endpoint pages document their exact parameters and response fields.

Authentication#

The public API base URL is https://api.cs2.sh.

All /v1 endpoints require a Bearer API key. Every /v1 request must also accept gzip compression, and POST requests should also include Content-Type: application/json:

HeaderValueRequired for
AuthorizationBearer YOUR_API_KEYAll /v1 endpoints
Accept-EncodinggzipAll /v1 endpoints
Content-Typeapplication/jsonPOST endpoints

Successful /v1 responses are gzip-encoded. Most HTTP clients decompress them automatically. Error responses are returned as plain JSON.

Rotating your API key from the dashboard generates a new key and invalidates the old one within ~10 seconds. Until then, the old key still works and the new key returns 401.

GET and POST requests#

cs2.sh uses two main request patterns:

  • GET snapshot: fetch the complete current dataset for an endpoint.
  • POST query: request data for up to 100 specific items, with endpoint-specific parameters such as dates, sources, or intervals.

For example, this fetches the complete current price snapshot:

GET /v1/prices/latest

This fetches current prices for two specific items:

POST /v1/prices/latest
Content-Type: application/json

{
  "items": [
    "USP-S | Printstream (Factory New)",
    "AK-47 | Redline (Field-Tested)"
  ]
}

GET snapshots can be large, but are useful since you can save a single response and perform future lookups locally. POST requests are better when you need a bounded response for a known set of items. These are also used for history endpoints to limit response size.

Live and individual sales requests are POST requests too. Each reads one item, listing, seller, or search on one marketplace and returns pages:

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

{
  "market_hash_name": "AK-47 | Redline (Field-Tested)"
}

Items#

POST endpoints identify items using market_hash_name:

{
  "items": [
    "USP-S | Printstream (Factory New)"
  ]
}

GET /v1/schema returns every supported item by the same market_hash_name accepted by all endpoints. It also contains item metadata, marketplace ids, images, wears, float ranges, and variants.

POST endpoints with an items list accept up to 100 items in one request. Live and individual sales requests take one market_hash_name.

Variants#

Items with supported Doppler, Gamma Doppler, or Case Hardened variants can include a variants object.

{
  "market_hash_name": "★ Karambit | Doppler (Factory New)",
  "buff": {
    "ask": 918.65,
    "bid": 863.2
  },
  "variants": {
    "Ruby": {
      "market_hash_name": "★ Karambit | Doppler (Factory New)",
      "name": "★ Karambit | Doppler (Factory New) | Ruby",
      "display_name": "Ruby",
      "version": "ruby",
      "buff": {
        "ask": 5977.67,
        "bid": 5170.22
      },
      "csfloat": {
        "ask": 5976.91,
        "bid": 5150
      }
    }
  }
}

On a variant object:

FieldMeaning
market_hash_nameThe base item's market hash name.
nameThe full cs2.sh variant name.
display_nameHuman-readable variant label.
versionStable variant code.

Live and individual sales requests take a variant's full name as market_hash_name, such as ★ Karambit | Doppler (Factory New) | Ruby. Supported variants differ by marketplace.

Version codes#

Supported version codes for variant items:

Version codeVariant familyDisplay label
p1Doppler / Gamma DopplerPhase 1
p2Doppler / Gamma DopplerPhase 2
p3Doppler / Gamma DopplerPhase 3
p4Doppler / Gamma DopplerPhase 4
rubyDopplerRuby
sapphireDopplerSapphire
blackpearlDopplerBlack Pearl
emeraldGamma DopplerEmerald
t1Case HardenedTier 1
t2Case HardenedTier 2
t3Case HardenedTier 3
t4Case HardenedTier 4
singleblueCase HardenedBlue Gem

Variant availability depends on the marketplace and endpoint. See Data Coverage for variant support and GET /v1/schema for the variants attached to each item.

Responses#

Most item endpoints return an items object keyed by market_hash_name.

{
  "response_time": "2026-07-26T18:54:04.041Z",
  "currency": "USD",
  "items": {
    "USP-S | Printstream (Factory New)": {
      "market_hash_name": "USP-S | Printstream (Factory New)",
      "buff": {
        "updated_at": "2026-07-26T18:50:53Z",
        "collected_at": "2026-07-26T18:53:10.67Z",
        "ask": 109.72,
        "ask_volume": 463,
        "bid": 106.17,
        "bid_volume": 41
      }
    }
  }
}

Common top-level fields include:

FieldMeaning
response_timeWhen the API generated the response. On /latest endpoints, it's when cs2.sh built the snapshot the response comes from.
currencyCurrency of every price in the response. USD unless another currency is requested.
itemsMap of item names to the returned data.
errorsPer-item failures returned alongside successful items on POST endpoints.

Current-price items contain one object per marketplace. Historical endpoints use the same items map, with time-series data nested inside each item.

Live and individual sales responses have no items map, and have a page object when there can be more results.

See API Objects for the complete response schemas.

Timestamps#

Current marketplace price objects can include three different timestamps:

FieldMeaning
response_timeWhen cs2.sh built the price snapshot the response comes from.
updated_atWhen the marketplace last updated the price.
collected_atWhen cs2.sh collected it.

response_time does not indicate when an individual marketplace price was collected. The timestamps inside that marketplace's object come from the newer of its ask and bid, so the other one can be older.

Refresh rates are approximate and differ by marketplace. See Data Coverage for the expected refresh rate of each endpoint and source.

Historical response buckets#

prices/history and market/buff/history return fixed, UTC-aligned OHLC buckets. Each marketplace object inside a bucket includes the following observation fields:

FieldMeaning
bucketStart of the UTC-aligned interval.
open_timeTime of the first observation inside the bucket.
close_timeTime of the last observation inside the bucket.
sample_countNumber of underlying observations represented by the bucket.

ask_volume and bid_volume are the last observed values inside the bucket.

Not every historical endpoint returns OHLC. market/csfloat/history and market/steam/history return sampled orderbook history, and each /v1/archive/ endpoint's page describes its own buckets. OHLC buckets explains how they're built.

Missing data#

A missing price is not a price of zero.

On current-price base items, marketplace objects can be present with unavailable fields set to null:

{
  "skinport": {
    "updated_at": null,
    "collected_at": null,
    "ask": null,
    "ask_volume": null
  }
}

Variant and historical response objects can be sparse. A marketplace object may be absent when that marketplace has no data for the variant or interval.

Some historical endpoints omit a valid item when no data exists inside the requested range. The relevant endpoint page documents its exact empty-data behavior.

Partial success#

POST endpoints validate requested items independently. A request can return successful items and per-item errors in the same 200 response.

{
  "items": {
    "USP-S | Printstream (Factory New)": {
      "market_hash_name": "USP-S | Printstream (Factory New)"
    }
  },
  "errors": [
    {
      "item": "Invalid Item Name",
      "code": "unknown_item",
      "message": "item not found"
    }
  ]
}

An entry in errors applies only to that requested item. It does not invalidate the items returned successfully.

Item error codes#

CodeMeaning
unknown_itemThe requested name does not match a known item.
invalid_formatThe submitted item value is not valid.
not_in_cacheThe item is valid but unavailable in the relevant current dataset.
not_in_archiveThe item is valid but has no data on the requested /v1/archive/ endpoint.
unsupported_sourceThe item has no identity on the requested marketplace.
unsupported_variantThe requested variant is not supported by that dataset.

The relevant endpoint page documents which item-error codes it can return. See ItemError for the complete object.

Item errors are different from request-level errors. Live and individual sales requests have no items list and no partial success. Each one succeeds or returns a request error.

Currency#

Prices are USD by default. To return them in another currency, set currency in the POST request body:

{
  "items": [
    "USP-S | Printstream (Factory New)"
  ],
  "currency": "CNY"
}

GET latest endpoints take the same value as a query parameter:

GET /v1/prices/latest?currency=CNY

Supported currencies are USD, EUR, GBP, CNY, JPY, CAD, AUD, CHF, NZD, and SGD. Every price in the response is converted, and the response currency field shows the currency used. Converted prices can have up to six decimal places.

DataRate used
Latest pricesThe current rate, as returned by GET /v1/fx.
Historical pricesThe rate for each observation's UTC day.

Youpin, BUFF, and C5Game prices are converted from the marketplace's own CNY price, so CNY returns that price unchanged. The exception is prices/history, which always converts from USD.

400 validation_error means the currency is not supported, or no rate is available for a requested historical date. 503 service_unavailable means exchange rates are temporarily unavailable.

Individual sales take the same currency body field. Live requests have no currency option and return prices in the marketplace's own currency.

Paging#

Live and individual sales responses are paginated, with a fixed page size per operation that the request can't change. Every paged response has a page object:

FieldMeaning
page_sizeThe operation's fixed page size. A page can hold fewer rows.
has_nextWhether another page exists.
next_cursorThe cursor for the next page, or null on the last page.
cursor_expires_atWhen the cursor stops working, or null on the last page.
total_countThe total number of results when it's known, otherwise null.
total_exactWhether total_count is exact. If it's false, follow has_next instead of total_count.

To get the next page, send next_cursor back as cursor to the same path, as the only field in the body:

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

The cursor carries the whole original request, including the item, filters, sorting, and currency. Request pages until next_cursor is null.

Cursor lifetime depends on the endpoint:

EndpointsCursor lifetime
Live15 minutes from the first request
Individual sales24 hours from the first request

Every page of a request reports the same cursor_expires_at, because more pages don't extend it. An expired cursor returns 400 with details.code set to cursor_expired, and a live cursor can occasionally expire before cursor_expires_at. A cursor sent to a different path returns cursor_mismatch, and one sent with other fields returns conflicting_fields.

In each case, send the original request again, so keep its body until you have the last page. Page sizes and the live operations without paging are on the live and individual sales pages.

Request errors#

Request-level errors use a shared JSON object:

{
  "error": "validation_error",
  "message": "items must contain at most 100 entries",
  "request_id": "550e8400-e29b-41d4-a716-446655440000"
}

request_id identifies the failed request and should be included when contacting support.

Some errors also include a details object. Every live error has details.code, except a 401 and the 400 for a request without Accept-Encoding: gzip. Individual sales errors have details.code only on a 400 about the request body. Branch on details, not on message, which is written for people and can change:

FieldMeaning
details.codeThe exact reason, such as missing_field, unsupported_field, unknown_item, cursor_expired, or live_rate_limit.
details.fieldThe request field the error is about.
details.allowed_values, required_fields, required_values, conflictsWhat the field accepts, what is missing, or which fields clash. Present when they apply.
details.retry_after_secondsSeconds to wait before retrying, on retryable live errors.
StatusMeaning
400Missing or invalid request parameters, malformed JSON, or an oversized request.
401Missing, malformed, invalid, or expired API key.
403The requested endpoint is not included in your plan, or a demo key has used all of its live requests and details.code is live_demo_exhausted.
404Unknown path, or no requested item has data in the relevant dataset. On a live request, the listing, seller, or item doesn't exist on the marketplace. On Developer and demo keys, a path outside the plan returns 403 instead, even when it doesn't exist.
405The endpoint does not support the requested HTTP method. On Developer and demo keys, a method outside the plan returns 403 instead.
429The request went over the per-second limit or a live per-minute limit.
500Internal server error.
502Live requests only. The marketplace refused the request, timed out, or returned nothing usable, and details.reason says which.
503The service, database, or requested snapshot is temporarily unavailable.
504The request or database query timed out.

Correct 400, 401, 403, 404, and 405 errors before retrying. Retry 429 and temporary 5xx errors with a bounded delay.

If a retry fails, increase the delay before each new attempt and add jitter.

A live 429 sets details.retry_after_seconds. Its details.code is live_rate_limit when the operation's per-minute limit is used up, or live_concurrency_limit when too many of your requests to that operation are running at once. For live_concurrency_limit, wait for one of them to finish.

Individual endpoint pages document any additional error behavior specific to that endpoint. Every live error is under Errors and retries.

Limits#

LimitValue
Requests10 requests per second, per user
Live requestsPer-minute limits for each operation
Items per POST request100
Request body1 MiB, or 96 KiB on live and 16 KiB on individual sales
Response compressiongzip required for /v1

No plan has a request quota. Live requests don't count toward the 10 requests per second, and each live operation has its own per-minute limit instead.

Historical endpoints also have interval-specific maximum request ranges. These are documented in Data Coverage and on the relevant endpoint page.

The complete GET snapshots can be large. Cache them when you need repeated access to the same current dataset, and use POST endpoints for smaller item-specific requests.

OpenAPI#

The complete OpenAPI 3.1 specification is available at cs2.sh/openapi.yaml.

It contains the request parameters, response schemas, enums, and examples used by the endpoint reference. GET /v1/live/capabilities returns the exact JSON schema of every live operation.