快速開始
1. 取得 API Key
註冊帳號後,在後台「API Key 管理」頁面建立一組新的 API Key。
2. 呼叫 API
Python
import requests
response = requests.post(
"https://api.boshan.roamer-tech.info/v1/models/arima/run",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"data": [100, 102, 105, 103, 108, 110],
"p": 1, "d": 1, "q": 1,
"forecast_periods": 6
}
)
result = response.json()
print(result["result"]["forecasts"])
3. 取得結果
API 回傳 JSON 格式的分析結果,包含預測值、信賴區間、診斷統計量等。
API Endpoints
| Method | Endpoint | 說明 |
|---|---|---|
| GET | /api/v1/models | 列出所有可用統計模型 |
| GET | /api/v1/models/{slug} | 取得模型詳情與參數定義 |
| POST | /api/v1/models/{slug}/run | 執行統計模型(非同步) |
| GET | /api/v1/jobs/{uuid} | 查詢 Job 狀態與結果 |
| GET | /api/v1/api-keys | 列出所有 API Keys |
| POST | /api/v1/api-keys | 建立新 API Key |
| DELETE | /api/v1/api-keys/{id} | 撤銷 API Key |