Tất cả API requests cần header X-API-Key:
curl -H "X-API-Key: ask_xxxxxxxxxxxxx" \
https://your-domain.com/public/api/v1/portfolio
Tạo API key từ trang Account → API Keys section.
https://your-domain.com/public/api/v1
Lấy portfolio hiện tại
{
"success": true,
"data": {
"holdings": [
{
"symbol": "BTCUSDT",
"quantity": 0.005,
"avg_price": 95000,
"current_price": 97500,
"value": 487.50
}
],
"total_invested": 475.00,
"total_value": 487.50
}
}
Lấy trạng thái thị trường (Fear & Greed, BTC price)
{
"success": true,
"data": {
"fng": {
"value": 42,
"classification": "Fear",
"timestamp": "2026-02-08"
},
"btc_price": 97500.50
}
}
Lấy lịch sử giao dịch
Query params: page (default: 1), limit (default: 50, max:
100)
{
"success": true,
"data": {
"trades": [
{
"symbol": "BTCUSDT",
"action": "BUY",
"price": 95000,
"quantity": 0.001,
"amount": 95,
"created_at": "2026-02-08T10:30:00"
}
],
"total": 25,
"page": 1,
"per_page": 50,
"total_pages": 1
}
}
401 |
Missing or invalid API key |
403 |
Plan không hỗ trợ API access (cần Pro+) |
429 |
Rate limit exceeded |
import requests
API_KEY = "ask_xxxxxxxxxxxxx"
BASE_URL = "https://your-domain.com/public/api/v1"
headers = {"X-API-Key": API_KEY}
# Get portfolio
resp = requests.get(f"{BASE_URL}/portfolio", headers=headers)
print(resp.json())
const API_KEY = "ask_xxxxxxxxxxxxx";
const BASE_URL = "https://your-domain.com/public/api/v1";
fetch(`${BASE_URL}/portfolio`, {
headers: { "X-API-Key": API_KEY }
})
.then(res => res.json())
.then(data => console.log(data));