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

# 生活指数

> 查询中国城市今明后三天生活指数

## 接口概述

返回穿衣、运动、洗车、紫外线等生活指数的等级与建议文案，覆盖今明后共 3 天。

| 项目 | 说明 |
| - | - |
| 覆盖范围 | 中国大陆主要城市 |
| 更新频率 | 每日约 2 次（早晚） |
| 时区 | 业务时间多为北京时间；场站预报库内为 UTC，响应同时提供本地时间 |
| 鉴权 | 请求头 `X-API-Key`；需开通对应模块权限 |

### 相关参考

* [城市列表](https://docs.sunnymeteo.com/zh/reference/location-codes.md)

## 请求

```
GET /v1/weather/life
GET /weather/life
```

### 查询参数

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `city_uid` | integer | 四选一 | 内部城市 ID，优先级最高 |
| `city_code` | string | 四选一 | GB2260 行政区划代码，如 `110000` |
| `city_name` | string | 四选一 | 城市名称，如 `北京市` |
| `lat` | number | 与 lon 成对 | 纬度 -90\~90 |
| `lon` | number | 与 lat 成对 | 经度 -180\~180 |
| `format` | string | 否 | 响应格式：`json`（默认）/`csv`/`tsv`/`xml`/`yaml` |

## 响应

### JSON 结构

```json theme={null}
{
  "city": { "city_name": "成都市" },
  "forecast": {
    "update_time": "2026-08-24T07:30:00+08:00",
    "forecast": [
      {
        "forecast_date": "2026-08-24",
        "indices": [
          {
            "life_id": 1,
            "index_name": "穿衣",
            "level": "舒适",
            "level_num": 2,
            "description": "建议穿薄外套或长袖衬衫。"
          }
        ]
      }
    ]
  }
}
```

### `forecast.forecast[]` 字段

| 字段英文名 | 类型 | 单位 | 中文名 |
| - | - | - | - |
| `forecast_date` | string | YYYY-MM-DD | 预报日期 |
| `indices` | array | — | 当日生活指数列表 |

### `indices[]` 字段

| 字段英文名 | 类型 | 单位 | 中文名 |
| - | - | - | - |
| `life_id` | integer | — | 指数 ID |
| `index_name` | string | — | 指数名称 |
| `level` | string | — | 等级描述 |
| `level_num` | integer | — | 等级序号 |
| `description` | string | — | 建议说明 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.