国内油价查询
查询全国或指定省份的汽柴油最新价格,包含92号/95号/98号汽油及0号/-10号/-20号柴油等
GET
https://api.tinyaii.cn/v1/oil
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| province | string | 可选 | 省份名称(支持31省,如北京/广东/上海) | 北京 |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
| province | string | 省份名称 |
| date | string | 当前日期 |
| prices | array | 油价列表 |
| prices[].type | string | 油品类型(92号汽油/95号汽油/98号汽油/0号柴油) |
| prices[].price | number | 价格(元/升) |
| prices[].change | number | 涨跌金额(元) |
| prices[].unit | string | 单位 |
| update_time | string | 数据更新时间 |
返回示例
{
"code": 200,
"message": "success",
"data": {
"province": "北京",
"date": "2026年05月22日",
"prices": [
{
"type": "92号汽油",
"price": 8.78,
"change": 0.06,
"unit": "元/升"
},
{
"type": "95号汽油",
"price": 9.34,
"change": 0.06,
"unit": "元/升"
},
{
"type": "98号汽油",
"price": 10.84,
"unit": "元/升"
},
{
"type": "0号柴油",
"price": 8.53,
"change": 0.07,
"unit": "元/升"
}
],
"update_time": "2026-05-21 00:12:00"
}
}
调用示例
curl "https://api.tinyaii.cn/v1/oil?province=北京" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch("https://api.tinyaii.cn/v1/oil?province=北京", {
headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
console.log(await res.json());import requests
resp = requests.get(
"https://api.tinyaii.cn/v1/oil",
params={"province": "北京"},
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=10,
)
print(resp.json())把 YOUR_API_KEY 换成你的密钥即可直接运行。密钥只保存在你自己的设备上。