API 文档
基础信息
Base URL: https://blackswan-api.9cstar.com
鉴权: X-API-Key 请求头(付费墙开启后必需)
POST /api/v1/forecast
批量尾部风险预测:给定股票 + 压力情景,返回回撤区间/修复天数/盈利概率。
curl -X POST https://blackswan-api.9cstar.com/api/v1/forecast \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_KEY" \
-d '{
"tickers": ["SPY", "AAPL"],
"scenario_id": "covid_crash_2020",
"current_prices": {"SPY": 500, "AAPL": 200}
}'GET /api/v1/forecast
GET 版(QuantConnect Download 兼容,参数走 query string)。
curl "https://blackswan-api.9cstar.com/api/v1/forecast?\ tickers=SPY,AAPL&scenario_id=covid_crash_2020&\ current_prices=SPY:500,AAPL:200&as_of_date=2026-08-01"
GET /api/v1/market/match
市场路径匹配:近期 SPY 走势与历史长跌事件的相似度。
curl "https://blackswan-api.9cstar.com/api/v1/market/match?\ ticker=SPY&days=30&as_of_date=2026-08-01"
用量与套餐
- GET /api/v1/plans — 套餐列表(含 credits 与频率限制)
- GET /api/v1/me/usage — 当前用户用量
- POST /api/v1/subscribe — 创建 Stripe 支付会话
- 用量耗尽返回 402,频率超限返回 429