# How to price an instant-sell offer or a bot listing from live market data

> Price instant-sell offers and bot listings for CS2 and Rust from one bulk snapshot: pick a reference, guard against stale quotes, apply fees, cap holdings.

*Build with the API · Advanced · Updated 2026-11-27*

An instant-sell site and a listing bot do the same job from opposite sides. The site quotes what it will pay a seller now. The bot decides what to ask on each market it sells on. Both start from a reference price, take a share of it, and refuse to price at all when the reference is old, thin, or hard to resell. Get any of those rules wrong and the mistake repeats on every trade.

This guide builds both from SkinPricer data. One bulk request, [`GET /v2/prices/latest`](/api-docs/prices-latest), returns every market's ask for every item of one game. You choose a reference from it, guard it against stale quotes, turn it into an offer or a listing price with real fee rows, and cap how many copies you hold with sales data. The same code prices Rust. All prices are integer USD cents.

> **BUFF163 data is unavailable at the moment:** SkinPricer has served no BUFF163 quote since 2026-09-25, and [`GET /v1/markets/health`](/api-docs/markets) lists BUFF163 with no live listings. A reference tied to BUFF would never update, so this guide builds its references from markets that report now and checks every quote's age. If you priced from BUFF before, the reference you choose in step 2 is a different market or a set of markets. Expect different numbers and set your shares again.

## Step 1: pull the bulk snapshot

The snapshot is rebuilt about every 30 seconds while someone reads it. Send `Accept-Encoding: gzip`: the body is about ten times smaller, and only compressed downloads are never limited. Keep the `ETag` of each 200 and send it back as `If-None-Match`. Until the next snapshot you get a `304` with no body. Each plan has a polling floor per subscription and game: on Developer one full download every 60 seconds, on Pro one every 15 seconds. A full download inside the floor answers `429` with `Retry-After`, so poll on that schedule and keep the ETag per game.

**curl**

```bash
export SKINPRICER_API_KEY="sp_live_•••"   # from your account's API keys page

# --compressed asks for gzip and unpacks it. etag.txt keeps the last ETag, so a
# repeat call before the next snapshot answers 304 and leaves cs2.json as it is.
curl -s -G "https://pricing.skinpricer.com/v2/prices/latest" \
  --data-urlencode "game=cs2" \
  -H "Authorization: ApiKey $SKINPRICER_API_KEY" \
  --compressed \
  --etag-compare etag.txt \
  --etag-save etag.txt \
  -o cs2.json \
  -w "%{http_code}\n"
```

**Node**

```ts
// Node 18+, plain fetch, so the snapshot's buyerTerms map is read straight from the JSON.
const API = "https://pricing.skinpricer.com";
const AUTH = { Authorization: `ApiKey ${process.env.SKINPRICER_API_KEY}` };

interface Ask {
  market: string;
  price: number; // USD cents
  fetchedAt: string; // last time SkinPricer confirmed the quote
  isStale: boolean;
  quoteSize: number;
  purchasable?: false;
  sourceUpdatedAt?: string; // when the market itself produced it, if it says
}

interface Item {
  name: string;
  canonicalItemId: string;
  markets: Ask[];
}

interface BuyerTerms {
  buyerCostStatus: "complete" | "partial" | "unavailable";
  payWith: "cash" | "wallet" | "site_credit" | "unknown";
}

interface Snapshot {
  generatedAt: string;
  game: "cs2" | "rust";
  itemCount: number;
  items: Item[];
  buyerTerms?: Record<string, BuyerTerms>; // CS2 only
}

const etags = new Map<string, string>();

/** One poll. Returns null when nothing changed since the last download. */
async function fetchSnapshot(game: "cs2" | "rust"): Promise<Snapshot | null> {
  const etag = etags.get(game);
  const res = await fetch(`${API}/v2/prices/latest?game=${game}`, {
    headers: { ...AUTH, "Accept-Encoding": "gzip", ...(etag ? { "If-None-Match": etag } : {}) },
  });
  if (res.status === 304) return null;
  if (res.status === 429 || res.status === 503) {
    throw new Error(`HTTP ${res.status}: retry in ${res.headers.get("Retry-After")} s`);
  }
  if (!res.ok) throw new Error(`HTTP ${res.status}`);
  const next = res.headers.get("ETag");
  if (next) etags.set(game, next);
  return (await res.json()) as Snapshot;
}

const snap = await fetchSnapshot("cs2");
if (snap) {
  const ageSeconds = Math.round((Date.now() - Date.parse(snap.generatedAt)) / 1000);
  console.log(`${snap.itemCount} items, snapshot built ${ageSeconds} s ago`);
}
```

**Python**

```python
import os
from datetime import datetime, timezone

import requests

API = "https://pricing.skinpricer.com"
AUTH = {"Authorization": f"ApiKey {os.environ['SKINPRICER_API_KEY']}"}
etags = {}


def fetch_snapshot(game):
    """One poll. Returns None when nothing changed since the last download."""
    headers = {**AUTH, "Accept-Encoding": "gzip"}
    if game in etags:
        headers["If-None-Match"] = etags[game]
    res = requests.get(f"{API}/v2/prices/latest", params={"game": game}, headers=headers, timeout=120)
    if res.status_code == 304:
        return None
    if res.status_code in (429, 503):
        raise RuntimeError(f"HTTP {res.status_code}: retry in {res.headers.get('Retry-After')} s")
    res.raise_for_status()
    if res.headers.get("ETag"):
        etags[game] = res.headers["ETag"]
    return res.json()


def parse_time(value):
    return datetime.fromisoformat(value.replace("Z", "+00:00"))


snap = fetch_snapshot("cs2")
if snap:
    age = (datetime.now(timezone.utc) - parse_time(snap["generatedAt"])).total_seconds()
    print(f"{snap['itemCount']} items, snapshot built {age:.0f} s ago")
```

*`requests` and `fetch` unpack the gzip body for you. A `503` means no fresh snapshot exists (none built yet, or the newest is more than 25 minutes old); retry after `Retry-After`.*

```ts
// Run your pricing on every new snapshot. Developer: poll every 60 s. Pro: every 15 s.
const POLL_MS = 60_000;
let current: Snapshot | null = null;

for (;;) {
  try {
    current = (await fetchSnapshot("cs2")) ?? current; // a 304 keeps the last snapshot
  } catch (err) {
    console.error(String(err)); // the stale guards in step 3 decide if the last one still counts
  }
  if (current) reprice(current); // your code: steps 2 to 5
  await new Promise((resolve) => setTimeout(resolve, POLL_MS));
}
```

*The loop keeps the previous snapshot on a 304 or an error. It never prices from it blindly: the guards below check its age on every pass.*

## Step 2: choose a reference price

Each item's `markets[]` holds one ask per market. Two references work well. The **best cash ask** is the lowest ask among markets where a buyer pays with money, which is close to what the item costs to replace. **One chosen market** is the ask on the market you resell on, or the one your users compare you against. Both come out of the same array; only the filter differs.

Do not use the snapshot's `bestAsk` as a cash reference as it stands. It is the lowest ask across every market, including Steam, where buyers pay with Steam Wallet funds, and sites whose asks are priced in site credit. On CS2, the snapshot's top-level `buyerTerms` map says how each market's buyers pay: keep markets whose `payWith` is `cash` and whose `buyerCostStatus` is not `unavailable`. Rust snapshots carry no `buyerTerms`, so on Rust name your reference markets yourself.

Then turn the reference into a price. An instant-sell offer is a share of it, rounded down. Require more than one usable market behind the reference, so you never price from the only market that happens to report. This checks that markets are available, not that their prices agree: one mispriced low ask can still be the best cash ask, so cap how far an offer may move between snapshots, or compare the lowest ask with the next one.

**Node**

```ts
// Your risk settings. These are examples, not recommendations.
const MAX_SNAPSHOT_AGE_MS = 5 * 60_000; // refuse to price from an older snapshot
const MAX_QUOTE_AGE_MS = 15 * 60_000; // and from a quote not confirmed within this window
const MIN_MARKETS = 2; // usable asks a reference needs behind it
const OFFER_SHARE = 0.9; // pay a seller at most 90% of the reference

type Reference = { kind: "best-cash-ask" } | { kind: "market"; market: string };

/** Asks a buyer could pay with money right now. */
function usableAsks(item: Item, snapshot: Snapshot, now = Date.now()): Ask[] {
  return item.markets.filter((ask) => {
    if (ask.isStale || ask.purchasable === false) return false;
    if (now - Date.parse(ask.fetchedAt) > MAX_QUOTE_AGE_MS) return false;
    if (snapshot.game !== "cs2") return true; // Rust: no buyerTerms, pick markets by name
    const terms = snapshot.buyerTerms?.[ask.market];
    return terms?.payWith === "cash" && terms.buyerCostStatus !== "unavailable";
  });
}

function referencePrice(item: Item, snapshot: Snapshot, ref: Reference): Ask | null {
  if (Date.now() - Date.parse(snapshot.generatedAt) > MAX_SNAPSHOT_AGE_MS) return null;
  const asks = usableAsks(item, snapshot);
  if (asks.length < MIN_MARKETS) return null;
  const pool = ref.kind === "market" ? asks.filter((a) => a.market === ref.market) : asks;
  return pool.length === 0 ? null : pool.reduce((a, b) => (b.price < a.price ? b : a));
}

const redline = snap?.items.find((i) => i.name === "AK-47 | Redline (Field-Tested)");
const refs: Reference[] = [{ kind: "best-cash-ask" }, { kind: "market", market: "skinport" }];
for (const ref of refs) {
  const r = redline && snap ? referencePrice(redline, snap, ref) : null;
  const label = ref.kind === "market" ? ref.market : ref.kind;
  console.log(
    r
      ? `${label}: ${r.market} asks ${r.price}, offer ${Math.floor(r.price * OFFER_SHARE)} cents`
      : `${label}: no usable reference, make no offer`,
  );
}
```

**Python**

```python
import time

MAX_SNAPSHOT_AGE_S = 5 * 60  # refuse to price from an older snapshot
MAX_QUOTE_AGE_S = 15 * 60  # and from a quote not confirmed within this window
MIN_MARKETS = 2  # usable asks a reference needs behind it
OFFER_SHARE = 0.9  # pay a seller at most 90% of the reference


def usable_asks(item, snapshot):
    now = time.time()
    out = []
    for ask in item["markets"]:
        if ask["isStale"] or ask.get("purchasable") is False:
            continue
        if now - parse_time(ask["fetchedAt"]).timestamp() > MAX_QUOTE_AGE_S:
            continue
        if snapshot["game"] == "cs2":
            terms = snapshot.get("buyerTerms", {}).get(ask["market"])
            if not terms or terms["payWith"] != "cash" or terms["buyerCostStatus"] == "unavailable":
                continue
        out.append(ask)
    return out


def reference_price(item, snapshot, market=None):
    """The best cash ask, or the ask on one chosen market. None means: do not price."""
    if time.time() - parse_time(snapshot["generatedAt"]).timestamp() > MAX_SNAPSHOT_AGE_S:
        return None
    asks = usable_asks(item, snapshot)
    if len(asks) < MIN_MARKETS:
        return None
    pool = [a for a in asks if market is None or a["market"] == market]
    return min(pool, key=lambda a: a["price"]) if pool else None


redline = next((i for i in snap["items"] if i["name"] == "AK-47 | Redline (Field-Tested)"), None)
for market in (None, "skinport"):
    ref = reference_price(redline, snap, market) if redline else None
    label = market or "best-cash-ask"
    if ref:
        print(f"{label}: {ref['market']} asks {ref['price']}, offer {int(ref['price'] * OFFER_SHARE)} cents")
    else:
        print(f"{label}: no usable reference, make no offer")
```

*Both samples continue from step 1. A null reference is an answer: stop offering on that item until a fresh, corroborated ask comes back.*

## Step 3: guard against stale quotes

Four fields decide whether a price is still safe to act on. Check all of them on every pass, not only when the download succeeds, because a poller that keeps its last snapshot after an error will otherwise price from it for hours.

| Field | Where | What it tells you |
| --- | --- | --- |
| `generatedAt` | Snapshot | When the snapshot build started; every quote in it was read at or after this time. Your snapshot age guard. The API itself answers `503` rather than serve a snapshot more than 25 minutes old. |
| `fetchedAt` | Each quote | The last time SkinPricer confirmed the quote is current. It is not the age of the market's data. Your per-quote age guard. |
| `isStale` | Each quote | True when the quote was older than 30 minutes when the snapshot was built. Never price from it. |
| `purchasable` | Asks | Present, and false, only on an ask you cannot buy now: no listing behind it, or a stale one that may already be sold. Absent means purchasable. |

Where a market states its own time, a quote also carries `sourceUpdatedAt`; a strict guard can use it too. Decide in advance what happens when a guard fails. The safe default is to make no offer and post no new listing for that item, rather than fall back to an older price. The [freshness guide](/resources/cs2-market-data-freshness) covers each market's update pattern.

## Step 4: use fee rows instead of reversing markups

Asks in the snapshot are already what a buyer pays on that market from site balance, so there is no retail markup to reverse. `buyerTerms` says how firm that is: `complete` means the market's own terms say buyers pay the listed price; `partial` means the price matches checkout, but no terms read rule out another buyer charge; `unavailable` means no money cost can be stated. Top-up and payment-processor fees are not included.

For the seller side, the keyless `GET https://pricing.skinpricer.com/v1/public/fees` returns the CS2 seller fee rows SkinPricer nets bids with, keyed by market: `commissionBps`, `minCommissionUsdCents`, `withdrawalFlatUsdCents`, a `status` of `complete` or `partial`, and a `payout` of `cash`, `wallet`, or `unknown`. A market with `seller: null` has an unknown fee, not a zero one. Use the row to gross up: the smallest list price that still nets your floor after the fee.

**curl**

```bash
curl -s "https://pricing.skinpricer.com/v1/public/fees"
```

**Node**

```ts
interface SellerFee {
  commissionBps: number;
  minCommissionUsdCents: number | null;
  withdrawalFlatUsdCents: number;
  status: "complete" | "partial";
  payout: "cash" | "wallet" | "unknown";
}

const feeRes = await fetch(`${API}/v1/public/fees`);
if (!feeRes.ok) throw new Error(`fees: HTTP ${feeRes.status}`);
const fees = (await feeRes.json()) as { markets: Record<string, { seller: SellerFee | null }> };

const LIST_FLOOR_SHARE = 1.03; // net at least 103% of the reference after fees (an example)

/** Smallest gross price that nets at least `net` cents after the market's seller fee. */
function grossUp(net: number, fee: SellerFee): number {
  const target = net + fee.withdrawalFlatUsdCents;
  const byRate = Math.ceil(target / (1 - fee.commissionBps / 10_000));
  return fee.minCommissionUsdCents === null ? byRate : Math.max(byRate, target + fee.minCommissionUsdCents);
}

/** Undercut the lowest ask on the market by 1 cent, but never below the fee-adjusted floor. */
function listingPrice(item: Item, venue: string, reference: Ask): number | null {
  const fee = fees.markets[venue]?.seller;
  if (!fee || fee.payout !== "cash") return null; // unknown fee, or proceeds you cannot withdraw
  const floor = grossUp(Math.ceil(reference.price * LIST_FLOOR_SHARE), fee);
  const now = Date.now();
  const lowest = item.markets.find(
    (a) =>
      a.market === venue &&
      !a.isStale &&
      a.purchasable !== false &&
      now - Date.parse(a.fetchedAt) <= MAX_QUOTE_AGE_MS, // the same age guard as the reference
  );
  return lowest ? Math.max(floor, lowest.price - 1) : floor;
}

const reference = redline && snap ? referencePrice(redline, snap, { kind: "best-cash-ask" }) : null;
if (redline && reference) {
  for (const venue of ["csfloat", "skinport", "dmarket"]) {
    const price = listingPrice(redline, venue, reference);
    console.log(`${venue}: ${price === null ? "no cash fee row, skip" : `list at ${price} cents`}`);
  }
} else {
  console.log("no usable reference, post no listings");
}
```

*Continues from steps 1 and 2. Treat a `partial` fee row as a lower bound: a tier or payout fee may be missing, so leave margin. The lowest ask on a market may be your own listing; skip your own listing ids before you undercut.*

## Step 5: set holding limits from liquidity

A good price on an item nobody buys is still a loss. Before you accept an offer or add stock, check how fast the item sells. [`POST /v1/liquidity/batch`](/api-docs/liquidity-batch) takes up to 100 names per call (Pro plan) and returns, per item, a `confidence`, time-to-sell estimates, and a `metrics[]` row per market with `salesPerDay`. A simple holding limit is a few days of cash-market sales. Steam pays sellers in wallet funds, so leave it out of a cash count. Items missing from `results` have no estimate: treat their limit as zero.

**curl**

```bash
curl -s -X POST "https://pricing.skinpricer.com/v1/liquidity/batch" \
  -H "Authorization: ApiKey $SKINPRICER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"marketHashNames":["AK-47 | Redline (Field-Tested)","★ Karambit | Doppler (Factory New) - Phase 2"]}'
```

**Node**

```ts
interface Liquidity {
  marketHashName: string;
  confidence: "HIGH" | "MEDIUM" | "LOW" | "CRITICAL";
  medianTimeToSellHours: number | null;
  metrics: { market: string; salesPerDay: number | null }[];
}

const HOLD_DAYS = 3; // hold at most three days of cash-market sales per item (an example)

async function holdingLimits(names: string[]): Promise<Map<string, number>> {
  const res = await fetch(`${API}/v1/liquidity/batch`, {
    method: "POST",
    headers: { ...AUTH, "Content-Type": "application/json" },
    body: JSON.stringify({ marketHashNames: names }), // up to 100 per call
  });
  if (!res.ok) throw new Error(`liquidity: HTTP ${res.status}`);
  const { results } = (await res.json()) as { results: Liquidity[] };
  const limits = new Map<string, number>(names.map((n) => [n, 0])); // no estimate: hold none
  for (const r of results) {
    const cashSalesPerDay = r.metrics
      .filter((m) => m.market !== "steamcommunity") // Steam pays in wallet funds
      .reduce((sum, m) => sum + (m.salesPerDay ?? 0), 0);
    const trusted = r.confidence === "HIGH" || r.confidence === "MEDIUM";
    limits.set(r.marketHashName, trusted ? Math.floor(cashSalesPerDay * HOLD_DAYS) : 0);
  }
  return limits;
}

const limits = await holdingLimits([
  "AK-47 | Redline (Field-Tested)",
  "★ Karambit | Doppler (Factory New) - Phase 2",
]);
for (const [name, max] of limits) console.log(`${name}: hold at most ${max}`);
```

**Python**

```python
import os

import requests

HOLD_DAYS = 3  # hold at most three days of cash-market sales per item (an example)


def holding_limits(names):
    res = requests.post(
        "https://pricing.skinpricer.com/v1/liquidity/batch",
        json={"marketHashNames": names},  # up to 100 per call
        headers={"Authorization": f"ApiKey {os.environ['SKINPRICER_API_KEY']}"},
        timeout=30,
    )
    res.raise_for_status()
    limits = {name: 0 for name in names}  # no estimate: hold none
    for r in res.json()["results"]:
        cash = sum(m["salesPerDay"] or 0 for m in r["metrics"] if m["market"] != "steamcommunity")
        trusted = r["confidence"] in ("HIGH", "MEDIUM")
        limits[r["marketHashName"]] = int(cash * HOLD_DAYS) if trusted else 0
    return limits


for name, limit in holding_limits(["AK-47 | Redline (Field-Tested)"]).items():
    print(f"{name}: hold at most {limit}")
```

*Refresh liquidity far less often than prices: it is a rolling 24-hour view, so once an hour is plenty. The [liquidity guide](/resources/cs2-skin-liquidity) explains every field.*

## Step 6: Doppler phases are their own items

A Doppler knife's market hash name is the same for every phase, yet the phases trade at very different prices. SkinPricer prices each phase and gem as its own item, named with a suffix: `★ Karambit | Doppler (Factory New) - Phase 2`, `... - Ruby`, and so on. Those names appear in the snapshot like any other item, so a phase gets its own reference, offer, and holding limit with no extra code.

What you need is the join from an inventory item to its phase name. A CS2 item reports its base market hash name and its paint index. The [item schema](/api-docs/schema) (`GET /v1/schema`, Developer plan) maps every name to its record, and a phase record carries both its `paintIndex` and a `variant` back-link to its base. One download builds the whole map, so you do not maintain your own phase table.

```ts
const schemaRes = await fetch(`${API}/v1/schema`, { headers: { ...AUTH, "Accept-Encoding": "gzip" } });
if (!schemaRes.ok) throw new Error(`schema: HTTP ${schemaRes.status}`);
const schema = (await schemaRes.json()) as {
  items: Record<string, { paintIndex: string | null; variant?: { base: string; name: string } | null }>;
};

// "<base market hash name>|<paint index>" -> the phase's own item name
const phaseByPaint = new Map<string, string>();
for (const [name, record] of Object.entries(schema.items)) {
  if (record.variant && record.paintIndex) phaseByPaint.set(`${record.variant.base}|${record.paintIndex}`, name);
}

// An inventory knife reports its base name and paint index 419, which is Phase 2.
const phase = phaseByPaint.get("★ Karambit | Doppler (Factory New)|419");
const priced = phase !== undefined && snap?.items.some((i) => i.name === phase);
console.log(`${phase ?? "no phase item"}: ${priced ? "priced in the snapshot" : "no live ask"}`);
```

*Continues from step 1. The schema changes rarely; download it once and follow [`/v1/schema/changes`](/api-docs/schema-changes) for updates. The [Doppler guide](/resources/cs2-doppler-phase-prices) goes further, down to float bands within a phase.*

## Step 7: Rust uses the same code

Pass `game=rust` to the same route and you get the Rust snapshot in the same shape, with its own ETag and its own polling floor. Two things differ. Rust snapshots carry no `buyerTerms`, and the fee rows cover CS2 only, so choose your Rust reference markets by name and take seller fees from each market's own terms. Liquidity for Rust is `POST /v2/liquidity/batch?game=rust`. The [Rust guide](/resources/rust-skin-prices-api) covers the other Rust routes.

**curl**

```bash
curl -s -G "https://pricing.skinpricer.com/v2/prices/latest" \
  --data-urlencode "game=rust" \
  -H "Authorization: ApiKey $SKINPRICER_API_KEY" \
  --compressed \
  --etag-compare etag-rust.txt \
  --etag-save etag-rust.txt \
  -o rust.json \
  -w "%{http_code}\n"
```

**Node**

```ts
const rust = await fetchSnapshot("rust");
const tempered = rust?.items.find((i) => i.name === "Tempered AK47");
const rustRef = rust && tempered ? referencePrice(tempered, rust, { kind: "market", market: "skinport" }) : null;
console.log(
  rustRef
    ? `Tempered AK47 on skinport: ${rustRef.price} cents, offer ${Math.floor(rustRef.price * OFFER_SHARE)}`
    : "Tempered AK47: no usable Rust reference",
);
```

*Continues from steps 1 and 2. Keep CS2 and Rust snapshots, ETags, and settings apart.*

## A checklist before you go live

- Poll with gzip and `If-None-Match`, at or above your plan's polling floor, with one ETag per game.
- Price from a reference you chose on purpose, and require more than one usable market behind it.
- Check `generatedAt`, `fetchedAt`, `isStale`, and `purchasable` on every pass, and make no price when a guard fails.
- Gross up listing prices with the fee rows. Treat `partial` rows and `seller: null` as uncertain, not as zero.
- Cap holdings by cash-market sales, and hold none of an item with no liquidity estimate.
- Key Doppler knives by their phase item, joined on paint index from the schema.
- Log every price you post with the snapshot's `generatedAt`, so you can explain any trade later.

## Endpoints used

- [GET /v2/prices/latest](/api-docs/prices-latest.md)
- [POST /v1/liquidity/batch](/api-docs/liquidity-batch.md)
- [GET /v1/schema](/api-docs/schema.md)
- [Games: CS2 & Rust](/api-docs/games.md)

## Related guides

- [How to check CS2 market data freshness before you trust a price](/resources/cs2-market-data-freshness.md)
- [How to check CS2 skin liquidity and time-to-sell](/resources/cs2-skin-liquidity.md)
- [How to get CS2 Doppler phase prices, from Phase 1 to Emerald](/resources/cs2-doppler-phase-prices.md)
- [How to get Rust skin prices with an API](/resources/rust-skin-prices-api.md)
