OpenAPI
AlphaLom 对外提供开放 REST API,使用 API Key 鉴权,接入简单。
文档地址
服务启动后,可访问交互式文档与外部 API 说明。
http://localhost:8080/docs # FastAPI 交互式文档
http://localhost:8080/api/extdocs # 外部开放 API 文档
鉴权方式
API Key
在管理后台生成 API Key,通过请求头传递。支持撤销与轮换。
Authorization: Bearer <你的 API Key>
限流保护
服务内置 Rate-Limiter,请控制请求频率。建议结合 ETag 与本地缓存使用。
主要接口
以下为部分核心端点,完整列表见 docs/EXTERNAL_API.md。
投资组合
GET
/portfolio投资组合总览股票与股票池
GET
/stocks/pools股票池列表GET
/stocks/watchlist关注 / 自选列表GET
/stocks/{symbol}/profile股票基础信息GET
/stocks/{symbol}/fundamentals基础面数据GET
/stocks/{symbol}/financials财务数据因子
GET
/factor/catalog因子目录(107+)GET
/factor/stock/{symbol}/dashboard单股因子看板GET
/factor/industry-rank行业排行选股与回测
POST
/screen因子选股POST
/backtest/analysis策略回测分析调用示例
cURL
curl -H "Authorization: Bearer $API_KEY" \
"http://localhost:8080/stocks/pools"
Python
import requests
resp = requests.get(
"http://localhost:8080/factor/catalog",
headers={"Authorization": f"Bearer {API_KEY}"},
)
print(resp.json())