返回首页

天气预报1-7天-中国气象局-IP查询版

接口说明

天气预报1-7天-中国气象局-IP查询版

接口基本信息

API地址

https://api.illlt.com/api/tq

请求方式

GET

返回格式

JSON

接口状态

正常启用

参数说明

以下参数为接口所需调用信息

名称 是否必填 类型 说明
day string 查询天数1-7,默认1(超出会自动纠正到1或7)
ip string ip地址,不传则按本接口IP,失败默认北京。
hourtype string 时段天气0或1,默认0

请求示例

HTTP请求

https://api.illlt.com/api/tq?day=3&hourtype=1

返回结果

HTTP 200 OK
{ "code": 200, "guo": "中国", "sheng": "四川", "shi": "江油", "name": "江油", "weather1": "阵雨", "weather2": "大雨", "wd1": "30", "wd2": "21", "winddirection1": "无持续风向", "winddirection2": "无持续风向", "windleve1": "微风", "windleve2": "微风", "weather1img": "https://rescdn.apihz.cn/resimg/tianqi/zhenyu.png", "weather2img": "https://rescdn.apihz.cn/resimg/tianqi/dayu.png", "lon": "104.730", "lat": "31.800", "uptime": "2025-08-22 12:00:00", "nowinfo": { "precipitation": 0, "temperature": 27.9, "pressure": 944, "humidity": 67, "windDirection": "东北风", "windDirectionDegree": 83, "windSpeed": 4.2, "windScale": "3级", "feelst": 29.4, "uptime": "2025/08/22 13:45" }, "alarm": { "id": "51078141600000_20250822091211", "title": "江油市气象台发布暴雨黄色预警信号[III级/较重]", "signaltype": "暴雨", "signallevel": "黄色", "effective": "2025/08/22 09:12", "eventType": "11B03", "severity": "YELLOW", "type": "p0002003" }, "weatherday2": { "date": "2025/08/23", "weather1": "阵雨", "weather2": "阵雨", "wd1": 28, "wd2": 22, "winddirection1": "无持续风向", "winddirection2": "无持续风向", "windleve1": "微风", "windleve2": "微风", "weather1img": "https://rescdn.apihz.cn/resimg/tianqi/zhenyu.png", "weather2img": "https://rescdn.apihz.cn/resimg/tianqi/zhenyu.png" }, "hourtime": "2025-08-22 13:01:18", "hour1": [{ "时间": "14:00", "天气": "晴", "图标": "https://rescdn.apihz.cn/resimg/tianqi/qing.png", "气温": "29.6℃", "降水": "无降水", "风速": "3.3m/s", "风向": "东南风", "气压": "915.8hPa", "湿度": "76.2%", "云量": "7.7%" }, { "时间": "17:00", "天气": "阵雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhenyu.png", "气温": "30℃", "降水": "3.8mm", "风速": "3.3m/s", "风向": "东南风", "气压": "914.6hPa", "湿度": "75.6%", "云量": "70%" }, { "时间": "20:00", "天气": "阵雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhenyu.png", "气温": "26.5℃", "降水": "4.3mm", "风速": "3.1m/s", "风向": "东北风", "气压": "916.2hPa", "湿度": "82.6%", "云量": "70%" }, { "时间": "23:00", "天气": "中雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhongyu.png", "气温": "22.5℃", "降水": "4.9mm", "风速": "3.2m/s", "风向": "西北风", "气压": "916.9hPa", "湿度": "89.1%", "云量": "70%" }, { "时间": "02:00", "天气": "中雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhongyu.png", "气温": "22.2℃", "降水": "8.4mm", "风速": "3.3m/s", "风向": "西北风", "气压": "915.8hPa", "湿度": "95.7%", "云量": "91.4%" }, { "时间": "05:00", "天气": "中雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhongyu.png", "气温": "21.9℃", "降水": "5.4mm", "风速": "3.3m/s", "风向": "东北风", "气压": "915.8hPa", "湿度": "94.1%", "云量": "100%" }, { "时间": "08:00", "天气": "中雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhongyu.png", "气温": "21.8℃", "降水": "6.2mm", "风速": "3.1m/s", "风向": "西北风", "气压": "917.2hPa", "湿度": "73.6%", "云量": "96.7%" }, { "时间": "11:00", "天气": "阵雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhenyu.png", "气温": "24.2℃", "降水": "8.7mm", "风速": "3.3m/s", "风向": "东北风", "气压": "917.3hPa", "湿度": "79.7%", "云量": "91.5%" }], "hour2": [{ "时间": "08:00", "天气": "中雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhongyu.png", "气温": "21.8℃", "降水": "6.2mm", "风速": "3.1m/s", "风向": "西北风", "气压": "917.2hPa", "湿度": "73.6%", "云量": "96.7%" }, { "时间": "11:00", "天气": "阵雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhenyu.png", "气温": "24.2℃", "降水": "8.7mm", "风速": "3.3m/s", "风向": "东北风", "气压": "917.3hPa", "湿度": "79.7%", "云量": "91.5%" }, { "时间": "14:00", "天气": "阵雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhenyu.png", "气温": "28.2℃", "降水": "3mm", "风速": "2.9m/s", "风向": "东北风", "气压": "916.9hPa", "湿度": "88.5%", "云量": "100%" }, { "时间": "17:00", "天气": "阵雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhenyu.png", "气温": "28.6℃", "降水": "2.7mm", "风速": "3.2m/s", "风向": "东南风", "气压": "915.9hPa", "湿度": "86.9%", "云量": "100%" }, { "时间": "20:00", "天气": "阵雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhenyu.png", "气温": "27.9℃", "降水": "4mm", "风速": "2.6m/s", "风向": "西北风", "气压": "917.3hPa", "湿度": "89.9%", "云量": "85.9%" }, { "时间": "23:00", "天气": "阵雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhenyu.png", "气温": "24.5℃", "降水": "0.1mm", "风速": "3.2m/s", "风向": "西南风", "气压": "918.5hPa", "湿度": "94.3%", "云量": "97.3%" }, { "时间": "02:00", "天气": "多云", "图标": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png", "气温": "23.6℃", "降水": "无降水", "风速": "3.3m/s", "风向": "西北风", "气压": "917.6hPa", "湿度": "95.3%", "云量": "69.5%" }, { "时间": "05:00", "天气": "阵雨", "图标": "https://rescdn.apihz.cn/resimg/tianqi/zhenyu.png", "气温": "23.1℃", "降水": "2mm", "风速": "3.1m/s", "风向": "东北风", "气压": "917.5hPa", "湿度": "97.2%", "云量": "85.1%" }] }

调用示例


        

示例代码