Alert types that work
| Type | Rule | Example |
|---|---|---|
| Absolute price | price <= X on market M | YouPin Redline FT under ¥140 |
| Cross-market spread | price_A / fx(A) - price_B / fx(B) > Y% | Skinport 8% above YouPin after fees |
| Percent move | change_24h <= -Z% | Dump alert on CSFloat |
| Phase-specific | Same as above + phase filter | Ruby Karambit only |
Architecture
┌─────────────┐ every N min ┌──────────────────┐
│ Scheduler │ ──────────────────► │ POST /v1/prices/ │
│ (cron) │ │ latest (≤100) │
└─────────────┘ └────────┬─────────┘
│
▼
┌──────────────────┐
│ State store │
│ prev price, phase│
└────────┬─────────┘
│
crossing detected ▼
┌──────────────────┐
│ Discord / TG / │
│ webhook │
└──────────────────┘
Respect plan rate limits. Batch up to 100 items per POST.
Poll example
curl -s -X POST "https://api.cspriceapi.com/v1/prices/latest" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
"AK-47 | Redline (Field-Tested)",
"M4A1-S | Printstream (Field-Tested)"
],
"markets": ["youpin", "skinport", "csfloat"]
}'Crossing logic (with hysteresis)
Avoid alert spam when price oscillates ±0.5%:
def crossed_below(prev: float | None, curr: float, threshold: float, hysteresis: float = 0.005) -> bool:
if prev is None:
return curr <= threshold
# Fire when crossing down through threshold; reset when clearly above
if prev > threshold >= curr:
return True
if curr > threshold * (1 + hysteresis):
return "reset" # allow re-arm
return False
Store armed per (name, phase, market, rule_id).
Discord webhook (minimal)
import requests
def notify_discord(webhook_url: str, content: str) -> None:
requests.post(webhook_url, json={"content": content}, timeout=10)
# Example message
msg = (
"🔔 **AK-47 | Redline (FT)** YouPin ¥138.50 "
"(crossed below ¥140)\n"
"Skinport: €17.90 | CSFloat: $124\n"
"<https://cspriceapi.com/market-hub/comparison>"
)
notify_discord("https://discord.com/api/webhooks/...", msg)Rules that prevent false alerts
| Rule | Why |
|---|---|
Match phase | Phase 4 dip ≠ Ruby dip |
count >= 5 | Ignore single-listing noise |
| Stale check | Skip if updated_at older than 15 min on fast markets |
| Fee-adjusted spread | Raw price gap ≠ profit |
| One alert per crossing | Hysteresis re-arm |
Buy-order alerts (exit price)
Monitor YouPin bids for "someone wants to buy above X":
curl -s "https://api.cspriceapi.com/v1/prices/youpin/buyorder" \
-H "x-api-key: YOUR_API_KEY"
Compare top bid movement vs your inventory fair value.
No-code alternatives
| Tool | Best for |
|---|---|
| Price Comparison | Cross-market gaps ranked by ROI, no cron |
| Price Comparison | Saved market pairs + ROI filters |
| Chrome extension Pro | Price alerts while browsing listings |
| Trending | 24h movers without custom rules |
Production checklist
- Discord testkey or dashboard API key
- Quickstart — verify auth
- Log
updated_atper row — freshness matters - Handle partial POST failures (per-item errors if returned)
- Backtest thresholds on history before live alerts