查询策略
按 id 返回单条策略。
接口
GET /strategies/{strategy_id}
鉴权: 公开。
路径参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
strategy_id | integer | 是 | 由 Create 返回的数据库自增 id。 |
响应 — 200 OK
{
"id": 1,
"name": "btc-momentum-1h",
"author": "alice",
"description": "BTC momentum on 1h candles",
"entry_condition": "close > ema(50) AND rsi(14) > 55",
"exit_condition": "close < ema(50) OR rsi(14) < 45",
"bot_name": "executor-momentum-v1",
"created_at": "2026-05-03T10:00:00",
"updated_at": "2026-05-03T10:00:00"
}
错误
| HTTP | 后端 detail | 英文对照 |
|---|---|---|
404 | 策略不存在 | Strategy not found |
422 | (FastAPI validation) | strategy_id not an integer |
示例
curl -s "https://api.pipai.org/strategies/1"