# How to Value a CS2 Inventory in Cash

> Value a CS2 inventory by batching `market_hash_name` values through `POST /v1/prices/latest`, matching **Doppler phases**, producing three totals (listing / sell-now / conservative), and never mixing Steam Wallet with withdrawable cash.

Unlike concept-only guides, this page includes a **copy-paste workflow** you can run today with CSPriceAPI + your inventory export.

## Three totals every report needs

| Total | Definition | Primary sources |
|---|---|---|
| **Cash listing value** | What you could list for on cash markets today | Median `price` across YouPin, BUFF, Skinport, CSFloat, … |
| **Sell-now value** | What buyers bid right now (instant exit) | YouPin [buyorder book](/docs/api/prices-youpin-buyorder), cash-market bids where available |
| **Conservative value** | Liquidity-adjusted — thin items move toward bids | Lower of listing median and bid; flag unknowns |

Keep **Steam Community Market** in a separate column. Steam Wallet is not bank cash ([Steam guide](/resources/how-to-get-steam-market-prices)).

## Step 1 — Build your asset list

Your inventory source (Steam API, CSFloat inventory export, spreadsheet) should yield:

```text
market_hash_name, quantity, doppler_phase (optional), asset_id (optional)
```

Rules:

- **Aggregate** identical commodity skins (10× Redline FT = one row, qty 10).
- **Split** Doppler/Gamma by phase — Ruby and Phase 4 are different rows.
- **Do not fuzzy-match** names. Unknown strings go to an `exceptions` table.

CSPriceAPI does not fetch Steam inventories for you — supply the names; the API supplies prices.

## Step 2 — Batch price requests (100 items max)

```bash
curl -s -X POST "https://api.cspriceapi.com/v1/prices/latest" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      "AK-47 | Redline (Field-Tested)",
      "★ Karambit | Doppler (Factory New)"
    ],
    "markets": "youpin,buff163,skinport,csfloat,steam"
  }'
```

For each `(market_hash_name, doppler_phase)`:

1. Collect non-null `price` from **cash markets** (exclude Steam for cash totals).
2. Compute **listing value** = median of cash-market asks (or trimmed mean dropping outliers).
3. Fetch **sell-now** from YouPin buyorder for CN items:

```bash
curl -s "https://api.cspriceapi.com/v1/prices/youpin/buyorder" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

4. `line_value = unit_value × quantity`

## Step 3 — Minimal Python sketch

```python
import statistics
import requests

API = "https://api.cspriceapi.com"
KEY = "YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {KEY}"}

CASH_MARKETS = ("youpin", "buff163", "skinport", "skinbaron", "csfloat", "dmarket")

def price_batch(names: list[str]) -> dict:
    r = requests.post(
        f"{API}/v1/prices/latest",
        headers=HEADERS,
        json={"items": names, "markets": ",".join(CASH_MARKETS)},
        timeout=60,
    )
    r.raise_for_status()
    return r.json()

def listing_median(rows: list[dict], name: str, phase: str | None) -> float | None:
    prices = []
    for market_block in rows if isinstance(rows, list) else [rows]:
        for item in market_block.get("items", []):
            if item.get("market_hash_name") != name:
                continue
            if (item.get("doppler_phase") or None) != (phase or None):
                continue
            p = item.get("price")
            if p is not None:
                prices.append(float(p))
    return statistics.median(prices) if prices else None

# inventory = [{"name": "...", "qty": 1, "phase": None}, ...]
```

Extend with: FX conversion (CNY→USD/EUR), fee tables, and buyorder join.

## Step 4 — Liquidity gates

| Signal | Action |
|---|---|
| `count >= 20` on ≥2 markets | Full listing median |
| `count` 1–5 everywhere | Move toward sell-now bid; lower confidence |
| No price in 24h | Mark **unpriced** — do not use zero |
| Doppler phase missing | Do not fall back to base Doppler average |

## Step 5 — Validate with sales (optional)

Listing value alone overstates items that never trade. Spot-check high-value rows:

```bash
curl -s "https://api.cspriceapi.com/v1/market-sales/search?market_hash_name=★%20Karambit%20%7C%20Doppler%20(Factory%20New)" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

See [sales data product](/sales-data) for bulk exports.

## YouPin-first valuation (market reality)

YouPin898 is the **largest CS2 marketplace by volume**. Even if you never buy on YouPin, its prices anchor:

- CN wholesale discovery
- What Western markets mean when they say "below Buff"
- Collector item reference for Doppler phases

Start valuation from YouPin + BUFF, then sanity-check Western retail ([Skinport](/resources/how-to-get-skinport-prices), [CSFloat](/resources/how-to-get-csfloat-prices)).

## No-code portfolio check

- [Browse Skins](/apps/browseskins) — search owned items, multi-market columns
- [Chrome extension](/extension) — compare while viewing listings
- Manual high-tier: cross-check [High-Tier Database](/apps/hightier) for pattern/float crafts

## Snapshot schema (store every run)

```text
valuation_id, run_at
market_hash_name, doppler_phase, quantity
listing_unit, sell_now_unit, conservative_unit
sources_json, confidence, unpriced_reason
```

Append snapshots — do not overwrite — so users see market moves vs methodology changes.

## Related

- [Calculate fair value (single item)](/resources/how-to-calculate-cs2-skin-fair-value)
- [YouPin prices & buy orders](/resources/how-to-get-youpin-prices)
- [Compare marketplaces](/resources/compare-cs2-skin-prices-across-marketplaces)
