Get Strategy
Return one strategy by id.
Endpoint
GET /strategies/{strategy_id}
Authentication: Public.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
strategy_id | integer | Yes | DB-assigned id returned by Create. |
Response — 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"
}
Errors
| HTTP | Backend detail | English equivalent |
|---|---|---|
404 | 策略不存在 | Strategy not found |
422 | (FastAPI validation) | strategy_id not an integer |
Example
curl -s "https://api.pipai.org/strategies/1"