GET /health
返回市场来源、变体采集器、公共端点数据集、饰品 schema 和数据库汇总计数的当前健康状态。不需要认证。
健康数据就绪后,即使 JSON 中的 status 为 degraded 或 down,端点仍返回 HTTP 200。HTTP 503 表示健康快照本身尚未就绪。
请求
GETapi.cs2.sh/health
curl https://api.cs2.sh/health \
-H "Accept-Encoding: gzip" --compressed响应
{
"status": "up",
"last_refreshed_at": "string",
"schema_ready": false,
"sources": null,
"variants": null,
"endpoints": null,
"stats": {
"total_events": 0,
"market_hash_names": 0,
"variant_items": 0
}
}响应字段
HealthResponse 字段:
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
status | string | 是 | 允许值: up, degraded, down. API 数据的整体健康状态。 |
last_refreshed_at | string (date-time) | 是 | 此健康快照的生成时间。 |
schema_ready | boolean | 是 | 饰品 schema 是否可用。 |
sources | Record<string, HealthEntry> | 是 | 按来源键控的市场健康状态。 |
variants | Record<string, HealthEntry> | 是 | 按来源采集器键控的变体价格健康状态。 |
endpoints | Record<string, HealthEntry> | 是 | 按端点名称键控的数据集健康状态。 |
stats | HealthStats | 是 | 上次健康状态刷新时的数据库汇总计数。 |
健康条目
sources、variants 和 endpoints 下的条目都包含 updated_at、collected_at 和 status。status 根据该数据集的预期刷新频率取值为 up、degraded 或 down。
schema_ready 表示 GET /v1/schema 是否可用。stats 包含 total_events、market_hash_names 和 variant_items。
完整结构:HealthEntry 和 HealthStats。