ข้ามไปยังเนื้อหา

เอกสาร API

URL หลัก

URL
https://staging.satoriex.io/api/v1

การยืนยันตัวตน

จุดปลายทางส่วนใหญ่เป็นสาธารณะ จุดปลายทางที่ใช้กับผู้ใช้ต้องการ JWT Bearer token จาก POST /auth/login

จุดปลายทางหลัก

ตลาด

จุดปลายทางคำอธิบายการยืนยันตัวตน
GET/api/v1/markets
List all active marketsสาธารณะ
GET/api/v1/markets/:id
Get market details and outcomesสาธารณะ
GET/api/v1/markets/:id/trades
Recent trade history for a marketสาธารณะ
GET/api/v1/markets/:id/orderbook
Full order book for a market (all outcomes combined)สาธารณะ
GET/api/v1/orderbook/:market_id/:outcome_id
Order book for a specific outcome within a marketสาธารณะ
GET/api/v1/feed
Unified paginated feed of markets and events. Returns {items, page, size, total}.สาธารณะ

คำสั่ง

จุดปลายทางคำอธิบายการยืนยันตัวตน
POST/api/v1/orders
Place a new orderต้องการ
GET/api/v1/orders
List your active ordersต้องการ

กระเป๋า

จุดปลายทางคำอธิบายการยืนยันตัวตน
GET/api/v1/wallet/balance
Get your platform balance. Also available at /me/balance and /users/me/balance as compatibility aliases.ต้องการ
GET/api/v1/wallet/transactions
Transaction historyต้องการ

Personal Access Tokens

จุดปลายทางคำอธิบายการยืนยันตัวตน
GET/api/v1/me/personal-access-tokens
List your Personal Access Tokensต้องการ
POST/api/v1/me/personal-access-tokens
Create a new Personal Access Tokenต้องการ
DELETE/api/v1/me/personal-access-tokens/:id
Revoke a Personal Access Token by IDต้องการ

Wire format for order fields

All integer fields are JSON numbers (no string encoding). The fields below use compact integer types to minimise payload size and eliminate floating-point rounding errors.

FieldTypeDescription
sideint81 = buy, 2 = sell
priceint32Probability in basis points (BPS). 10 000 = 100%. Example: 4 200 = 42%.
quantityint64Number of shares (whole units). Minimum 1.

Example: side=1 (buy), price=4200 (42.00% probability), quantity=100 shares.

ขีดจำกัดอัตรา

Global limit: 100 requests per minute per authenticated user, scoped per endpoint path (anonymous traffic falls back to per-IP keys). Order endpoints (place / cancel) stack a 60 requests/minute per-IP cap on top of a 30 requests/minute per-user cap — whichever you hit first applies. Authentication endpoints (login / register): 10 requests per minute per identifier. Token refresh: 20 requests per minute per IP. Buckets are scoped by request path — different endpoints do not share a single bucket.

ค่าธรรมเนียมการซื้อขาย

API trades incur the same fees as the web app: 1.5% trading fee deducted from seller proceeds at match. Maker rebate is 0.05% (5 BPS) on limit fills, or 0.10% (10 BPS) for API-key authenticated trades. See the Trading Guide for the full fee schedule and a worked example.

รูปแบบการตอบกลับ

JSON — success
{"code": 0, "msg": "ok", "data": {...}}
JSON — 5xx (includes trace_id)
{"code": 50000, "msg": "internal error", "data": null, "trace_id": "abc123def456"}

On 5xx errors the envelope also includes a non-empty trace_id field (e.g. "trace_id": "abc123"). Include this value when reporting issues to support.

รหัสข้อผิดพลาด

รหัสความหมาย
0Success — request completed normally
40000Bad request — invalid or missing parameters
40100Authentication required — sign in or refresh your token
40300Forbidden — KYC tier insufficient or permission denied
4040Resource not found
42900Rate limit exceeded — slow down and retry
50000Internal server error — contact support if persistent

Versioning and breaking-change policy

The current API version is v1 (/api/v1). Breaking changes — field removals, type changes, semantic behaviour changes — will be announced on the changelog at least 30 days before taking effect and will carry a new version prefix. Non-breaking additions (new optional fields, new endpoints) may ship without notice. Deprecated endpoints return a Sunset response header (RFC 8594) indicating the removal date.