# How to Build a CS2 Skin Arbitrage Bot

A CS2 arbitrage bot finds the same skin listed cheaper on market A than the net proceeds on market B — after fees, FX and Doppler matching. CSPriceAPI gives you a **single normalized feed** for 13 listing markets so the bot compares identity, not scraped HTML.

## Architecture

1. **Poll** `GET /v1/prices/latest` on a schedule (respect your plan rate limits).
2. **Join** rows by `(market_hash_name, doppler_phase)`.
3. **Convert** currencies (CNY ↔ EUR ↔ USD) with your FX source.
4. **Subtract fees** per marketplace (seller fee, withdrawal, spread).
5. **Filter** by min listing count (liquidity) and max age (staleness).
6. **Alert** or auto-list when net ROI exceeds threshold.

## Minimal poll example

```bash
curl -s "https://api.cspriceapi.com/v1/prices/latest?markets=skinport,youpin,buff163,csfloat" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Rules that prevent false arbs

| Rule | Why |
|---|---|
| Match `doppler_phase` | Ruby ≠ Phase 4 |
| Require `count >= N` | One cheap outlier listing ≠ liquid market |
| Reject stale snapshots | Prices older than ~15 min on fast markets |
| Include withdrawal fees | CNY → bank → EUR has real cost |
| Ignore manipulated items | Cross-check [sales history](/sales-data) |

## Faster iteration without code

- [Live Deals](/apps/livedeals) — pre-computed cross-market gaps
- [Price Comparison](/apps/pricecomparison) — ROI-ranked lists with fee inputs
- [Chrome extension](/extension) — manual arb while browsing listings

## Sales confirmation

Listing-price arb is not the same as completed-sale arb. Validate with:

```bash
curl -s "https://api.cspriceapi.com/v1/market-sales/search?market_hash_name=AK-47%20%7C%20Redline%20(Field-Tested)" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Get started

1. [Discord testkey](https://discord.gg/XT3rpfH4Tx)
2. [Quickstart](/docs/quickstart)
3. [Compare marketplaces guide](/resources/compare-cs2-skin-prices-across-marketplaces)

## Related

- [Doppler phase data](/resources/how-to-get-doppler-phase-price-data)
- [Fair value calculation](/resources/how-to-calculate-cs2-skin-fair-value)
- [Sale volume filters](/resources/how-to-get-cs2-sale-volume)
- [Price alert bot](/resources/how-to-build-cs2-skin-price-alert-bot)
- [Best CS2 price APIs](/resources/best-cs2-skin-price-apis)
