跳到主要内容

查询策略

按 id 返回单条策略。

接口

GET /strategies/{strategy_id}

鉴权: 公开。

路径参数

名称类型必填说明
strategy_idintegerCreate 返回的数据库自增 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"