跳到主要内容

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
}

响应字段

字段类型说明
idintEpoch 编号(即 epoch_number
labelstring含日期范围的可读标签
startDatestring开始日期(YYYY-MM-DD
endDatestring结束日期(YYYY-MM-DD
statusstringEpoch 状态(见下表)

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']}]")