> ## Documentation Index
> Fetch the complete documentation index at: https://api.csboard.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /v1/health — CSBoard API 存活与新鲜度探针

> 检查 CSBoard API 是否可达，以及价格列表的陈旧程度。这是唯一无需 API 密钥即可调用的端点——可以安全地匿名轮询。

health 端点是一个轻量级探针，用于确认 API 是否可达，并告诉您实体化的价格列表有多陈旧。它是**唯一**无需 API 密钥即可工作的端点，因此非常适合从监控系统轮询，或在执行已认证调用前在应用启动阶段进行新鲜度检查。

## 响应字段

<ResponseField name="status" type="string" required>
  服务正常时始终为 `"ok"`。
</ResponseField>

<ResponseField name="groups" type="integer" required>
  当前价格列表中已定价的商品组数量（每个唯一的 `market_hash_name` + `wear` + `doppler_phase` 组合算一组）。
</ResponseField>

<ResponseField name="price_list_age_seconds" type="integer" required>
  实体化价格列表的年龄，以秒为单位。请将其作为新鲜度指标——数值过大意味着价格可能滞后。
</ResponseField>

## 示例请求

```bash theme={null}
curl https://csboard.com/v1/health
```

## 示例响应

```json theme={null}
{
  "status": "ok",
  "groups": 184213,
  "price_list_age_seconds": 42
}
```

## 错误代码

| HTTP 状态码 | 代码                    | 含义                                      |
| -------- | --------------------- | --------------------------------------- |
| 429      | `rate_limit_exceeded` | 超过请求速率限制。请退避后按 `Retry-After` 响应头中的秒数重试。 |

<Tip>
  在执行已认证调用之前，请在健康检查或启动逻辑中轮询此端点。如果 `price_list_age_seconds` 出乎意料地大（例如超过几分钟），请将下游价格数据视为可能已陈旧。
</Tip>


## OpenAPI

````yaml GET /health
openapi: 3.1.0
info:
  title: CSBoard API
  version: 1.0.0
  description: >-
    Market data over the CSBoard marketplace — live listings, floats, stickers,
    minAsk prices, FX rates — plus opt-in buying straight from your balance.
    Free to read, key-gated, built for automation.
  contact:
    name: CSBoard
    url: https://csboard.com/docs
servers:
  - url: https://csboard.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Status
    description: Liveness and freshness probes.
  - name: Market data
    description: Read the live catalog, prices, and FX rates.
  - name: Trading
    description: Buy listings from your CSBoard balance. Opt-in, key-gated.
  - name: Account
    description: Your balance, settled funds, and trading status.
paths:
  /health:
    get:
      tags:
        - Status
      summary: Liveness + freshness probe
      description: >-
        Liveness and price-list freshness probe. No key required — use it to
        check the API is up and the price list is fresh. This is the only
        endpoint that works without authentication.
      operationId: getHealth
      responses:
        '200':
          description: Service is up.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Health'
              example:
                status: ok
                groups: 184213
                price_list_age_seconds: 42
      security: []
components:
  schemas:
    Health:
      type: object
      properties:
        status:
          type: string
          example: ok
        groups:
          type: integer
          description: Count of priced item groups.
        price_list_age_seconds:
          type: integer
          description: Age of the materialized price list, in seconds (freshness).
      required:
        - status
        - groups
        - price_list_age_seconds
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send your key as a Bearer token on every request: `Authorization: Bearer
        csb_pub_...`. Generate keys in your CSBoard profile.

````