# How to Get Youpin Price History for CS2

> Youpin history has three forms: intraday ask and bid OHLC from December 24, 2025, long-term archive prices from 2023, and sampled completed-sale prices at `1h`, `4h`, and `12h`. The first two are listings; the third is sales, and it is sampled rather than complete.

## Choose the series from the question

| Question | Endpoint | Coverage |
| --- | --- | --- |
| How did Youpin sell listings or buy orders move recently? | `POST /v1/prices/history` | From December 24, 2025 |
| What was the longer Youpin price trend? | `POST /v1/archive/history` | From 2023 |
| What prices appeared in Youpin's sale graph? | `POST /v1/archive/youpin` | `12h` from November 12, 2025 |

All three require a Scale or Enterprise API key and accept up to 100 items per request.

## Request intraday candles

```bash
curl -X POST https://api.cs2.sh/v1/prices/history \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "items": ["USP-S | Printstream (Factory New)"],
  "start": "2026-07-20",
  "sources": ["youpin"],
  "interval": "1h"
}'
```

Youpin publishes both order counts, so each bucket carries ask OHLC, bid OHLC, `ask_volume`, `bid_volume`, `sample_count`, `open_time`, and `close_time`. Maximum request ranges are 14 days at `5m`, 90 at `30m`, 365 at `1h`, and unlimited at `1d`.

## Request sampled sale prices

```bash
curl -X POST https://api.cs2.sh/v1/archive/youpin \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "items": ["★ Karambit | Doppler (Factory New)"],
  "start": "2026-01-29"
}'
```

```json
"intervals": {
  "1h": {
    "count": 120,
    "data": [
      {
        "bucket": "2026-07-21T16:00:00Z",
        "time": "2026-07-21T16:52:38.307Z",
        "price": 1314.88
      }
    ]
  }
}
```

| Field | Type | Description |
| --- | --- | --- |
| `intervals` | `object` | Keyed `1h`, `4h`, `12h`. Each is an independent series. |
| `intervals.<width>.count` | `integer` | Number of sale points in the window. |
| `data[].bucket` | `string (date-time)` | Sampling bucket boundary. |
| `data[].time` | `string (date-time)` | The actual sale time. |
| `data[].price` | `number` | Sale price in USD, converted at the sale date's rate. |
| `items.<name>.variants` | `object` | The same shape per variant. |

Coverage differs per width: `12h` from November 12, 2025, `4h` from June 27, 2026, `1h` from July 20, 2026. `start` defaults to 180 days ago and is floored to the hour; `end` defaults to now and is ceiled to the hour.

## Understand the sampling model

Youpin publishes **one sale per sampling bucket** and provides no sale volume. A `1h` series therefore holds at most 24 points per day, `4h` at most 6, and `12h` at most 2.

The same sale appears in more than one series. A sale at 12:42 lands in the `1h` bucket at 12:00, the `4h` bucket at 12:00, and the `12h` bucket at 12:00. Treat the three widths as separate views of the same underlying data rather than as a hierarchy to combine.

This has a direct consequence: `count` is the number of points in that one series, not sale volume. Counting points measures how often Youpin published a sample, not how many items traded. If you combine widths to extend historical coverage, deduplicate on matching `time` and `price` first.

About 16,000 liquid items are collected, plus mapped Doppler, Gamma Doppler, and Case Hardened variants. Data updates about 1-2x per day.

## Reading the data correctly

An ask candle is not a sale candle. The intraday and archive series follow active orders; only `archive/youpin` reports prices at which something changed hands, and even then as samples.

Archive history updates about 1-2x per day, so hourly archive buckets do not imply hourly collection.

Prices are converted to USD at the sale date's exchange rate, so a historical Youpin series already carries whatever currency movement happened over the window. That is usually what you want for cross-market comparison, but it means a flat local-currency price can appear to move.

An interval key appears only when that width was observed in the window. `count: 0` means the width was observed with no sales, which is different information from the key being absent.

## When items are missing or fail

| Code | Meaning |
| --- | --- |
| `not_in_archive` | A valid item has no Youpin sale history in the window. |
| `unsupported_variant` | The requested variant is not mapped for Youpin. |
| `unsupported_source` | The source is not available for that item. |
| `unknown_item` | The name does not resolve. |
| `404 not_found` | No requested valid item has Youpin history in the window. |

Partial results return `200` with both `items` and `errors[]`.

## Worked example: a Doppler phase sale series

Request the base Doppler item from `POST /v1/archive/youpin` and read the phase you need under `variants`. Choose one width and stay on it: `12h` for the longest history, `1h` where recent detail matters more than depth.

Use `time` rather than `bucket` when placing a point on a chart, since `bucket` is the sampling boundary and `time` is when the sale happened. Label the series as sampled sale prices, and do not put a count of points on a volume axis.

Full references: [POST /v1/archive/youpin](/docs/archive-youpin), [POST /v1/prices/history](/docs/prices-history), [POST /v1/archive/history](/docs/archive-history). All need a [Scale or Enterprise key](/pricing).
