Epoch 列表
返回所有周期信息及其状态。
GET /epochs
无需认证。
响应
{
"success": true,
"data": [
{
"id": 1,
"label": "Epoch 1: 2026.1.1 - 2026.1.15",
"startDate": "2026-01-01",
"endDate": "2026-01-15",
"status": "settled"
},
{
"id": 2,
"label": "Epoch 2: 2026.1.15 - 2026.1.29",
"startDate": "2026-01-15",
"endDate": "2026-01-29",
"status": "active"
}
],
"error": null,
"timestamp": 1745280000
}
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | int | Epoch 编号(即 epoch_number) |
label | string | 含日期范围的可读标签 |
startDate | string | 开始日期(YYYY-MM-DD) |
endDate | string | 结束日期(YYYY-MM-DD) |
status | string | Epoch 状态(见下表) |
Epoch 状态
| 值 | 含义 |
|---|---|
pending | 待开始 |
active | 进行中 |
ended | 已结束(未结算) |
settled | 已结算 |
代码示例
Python
import requests
BASE_URL = "https://api.prex.world/api/v1"
resp = requests.get(f"{BASE_URL}/epochs")
epochs = resp.json()["data"]
for e in epochs:
print(f"Epoch {e['id']}: {e['startDate']} → {e['endDate']} [{e['status']}]")