地区油价历史
请求
GET /v1/oil/history响应
等待请求发送请求后显示 JSON 响应。
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
requestedRegionCode | string | 请求传入的六位地区编码。 |
unit | string | 聚合接口标注的单位,固定为 CNY/L。 |
items | object[] | 最多 30 条历史报价,按日期倒序排列。 |
items[].date | string · 日期 | 报价日期。 |
items[].regionCode | string | 报价实际所属的六位地区编码。 |
items[].scope | string | 实际报价范围,province 为省级,city 为城市级。 |
items[].areaName | string | 报价地区或价区名称。 |
items[].updatedAt | string · 日期时间 / null | 报价记录的更新时间。 |
items[].price | object | 按油品组织的价格。非空值统一为保留两位小数的元/升字符串。 |
items[].price.92 | string | 92 号汽油价格。 |
items[].price.95 | string | 95 号汽油价格。 |
items[].price.98 | string / null | 普通 98 号汽油报价。当前口径下暂无报价时为 null。 |
items[].price.0 | string / null | 0 号柴油价格。数据缺失时为 null。 |
fetchedAt | string · 日期时间 | 该数据最近一次成功采集的时间。 |
stale | boolean | 快照是否需要更新。 |
状态码
| 状态码 | 说明 |
|---|---|
200 | 查询成功。成功响应结构见上表。 |
304 | 客户端发送的 If-None-Match 命中缓存。响应无正文。 |
400 | INVALID_REGION_CODE,地区编码格式错误或缺少必填编码。 |
404 | UNKNOWN_REGION,该地区尚未收录。 |
429 | 请求超出频率限制。响应含 statusCode(number)、error 和 message(string)。 |
503 | DATA_UNAVAILABLE,暂无可用快照。 |
400、404 和 503 业务错误响应包含 error(错误码)和 message(说明),均为字符串。