API PHÁT TRIỂN · v2.5.0

Xây dựng trên thị trường dự đoán Web3-native

REST + WebSocket · Định dạng phản hồi thống nhất · ID thị trường xác định · Bearer sk_live_* + OAuth 2.1 · Cấp sandbox ẩn danh · Quy định OpenAPI 3.1 + AsyncAPI 2.6

Bắt đầuTham khảo RESTĐăng nhập để nhận keys
Định dạng phản hồi thống nhất
Top-level fields are a single canonical envelope across product surfaces. { data, meta: { ts_ms, trace_id, is_simulated? } }.
ID thị trường xác định
Idempotent create — network retries never double-book. IDs are unforgeable without server-side inputs.
Ưu tiên quyền riêng tư Web3
Email, phone, IP stripped from external responses by default. Self-view paths preserve. X-PII-Redacted header on every reply.
Tiền dưới dạng chuỗi thập phân
USDT 6dp, BTC 8dp, ETH 18dp — never JavaScript numbers. Zero precision loss on client parse.
Gói Sandbox ẩn danh
Same host, no email required. self_serve tier caps orders at 10 USDT / 100 USDT daily notional. Simulated fills at mid-price. Promote to production by upgrading the key's tier — no code changes, no host switch.
Xác thực Bearer (sk_live_*)
Send Authorization: Bearer sk_live_… on every request. OAuth 2.1 + PKCE for hosted apps. Enterprise HMAC path documented for ops-provisioned partners.

Hoạt động trong 30 giây

1. Tạo khóa sandbox ẩn danh (không cần xác thực, không cần email):
curl -X POST https://api.predictasiax.com/v1/sandbox-keys \
  -H "Content-Type: application/json" \
  -d '{"org_name":"my-test"}'
# → { "api_key": "sk_live_...", "tier": "self_serve", ... }
2. Liệt kê các thị trường:
curl https://api.predictasiax.com/v1/markets \
  -H "Authorization: Bearer sk_live_YOUR_KEY_HERE"
3. Đăng ký nhận dữ liệu thời gian thực (dùng động từ lệnh viết hoa theo AsyncAPI):
wscat -c wss://predictasiax.com/ws
> {"op":"SUBSCRIBE","params":["fast_tick"]}
4. Đặt lệnh (Bearer + Idempotency-Key):
IDEM=$(uuidgen | tr -d '-' | cut -c1-24)
curl -X POST https://api.predictasiax.com/v1/orders \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: ${IDEM}" \
  -d '{"market_id":"m_...","side":"yes","price":"0.55","size":"2","client_order_id":"cli-001"}'

Quy cách, công cụ & SDK

OpenAPI 3.1 (REST)
69 đường dẫn / 76 thao tác trong 16 nhóm thẻ — Discovery, Builders, Apps, Attribution, Revenue, Connect, Subaccounts, Composer, Liquidity, Data, Webhooks, Marketplace, Oracle, Sandbox, Audit, Portfolio.
Mở Redoc →
AsyncAPI 2.6 (WebSocket)
54 thông báo sự kiện + 4 lệnh client (AUTH / SUBSCRIBE / UNSUBSCRIBE / LOCALE) trên wss://predictasiax.com/ws.
Mở AsyncAPI →
Postman + codegen
Bộ sưu tập Postman + môi trường sandbox/prod. openapi-generator hỗ trợ hơn 50 ngôn ngữ đích.
Tải tệp →
Sandbox — đang hoạt động
Cùng host với môi trường production, gói self_serve (10 USDT mỗi lệnh, giới hạn danh nghĩa 100 USDT/ngày, khớp lệnh mô phỏng tại giá giữa). Không rủi ro cho tài sản thực. Mint ẩn danh qua POST /v1/sandbox-keys.
Đọc tổng quan →
Xác thực
Bearer sk_live_* (live) · OAuth 2.1 + PKCE cho ứng dụng được lưu trữ (live) · Đường dẫn Enterprise HMAC được tài liệu hóa cho các đối tác do ops cấp phát.
Đọc hướng dẫn xác thực →
Lỗi & giới hạn tần suất
Hơn 40 mã lỗi có kiểu kèm các bước khắc phục. Giới hạn tần suất theo cửa sổ trượt với các header rõ ràng.
Đọc về lỗi →

Ai đang xây dựng trên PAX

Bot giao dịch
Systematic strategies, arbitrage bots, market-making. Bearer sk_live_* per request, WebSocket for real-time fills, multiple keys per account via the Portal.
Nền tảng tổng hợp
Multi-venue dashboards showing PAX markets alongside other prediction sources. Public read endpoints, no auth needed for market data.
Ứng dụng được lưu trữ (OAuth)
Apps that act on behalf of a PAX user. OAuth 2.1 + PKCE flow via connect.predictasiax.com; rotating refresh tokens; per-scope grant.
Ứng dụng di động
Bearer auth for machine partners; OAuth for user-scoped mobile flows. WebSocket for live prices and account events. Multi-locale support (13 languages).
Nhà cung cấp dữ liệu
Historical trades tape (30d), OHLCV candles (90d), settlement records. Full public Merkle audit trail per market via /v1/audit/*.
Nghiên cứu / Học thuật
Public read-only access. Prediction market research on Asia-focused events. No cost for read endpoints during early access.

Hỗ trợ

Đối tác & Hướng dẫn sử dụng
[email protected]
Yêu cầu API key, giới hạn tần suất cấp đối tác, câu hỏi về tích hợp.
Twitter
@PredictAsiaX_AD
Thông báo phát hành, cập nhật sự cố, cộng đồng.
Điều khoản API
predictasiax.com/terms
Điều khoản dịch vụ điều chỉnh việc sử dụng API.