一个可以根据IP地址或者城市名称查询天气的免费接口,支持国内3400+个城市天气
请求地址 GET
https://api.itapi.cn/api/tianqi
请求参数
参数名 | 参数说明 |
key | 用户请求密钥,可在 密钥管理页面 |
city | 城市名称(默认根据请求IP地址所在城市) |
ip | IP地址(和城市名称参数二选一) |
请求结果参数说明
参数名 | 参数说明 |
city | 南昌 |
city_en | nanchang |
province | 江西 |
province_en | jiangxi |
city_id | 101240101 |
update_time | 2022-10-24 15:30:59 |
weather | 晴 |
weather_code | qing |
temp | 22 |
min_temp | 18 |
max_temp | 25 |
wind | 东风 |
wind_speed | 2级 |
wind_scale | 6km/h |
rain | 0 |
rain_24h | 0 |
humidity | 42% |
visibility | 20km |
pressure | 1014 |
tail_number | |
air | 48 |
air_pm25 | 33 |
sunrise | 06:22 |
sunset | 17:38 |
aqi | air_level|空气等级,aqi.air_tips|出行提示,aqi.pm25|pm25,aqi.pm10|pm10,aqi.co|co,aqi.no2|no2,aqi.so2|so2,aqi.o3|o3 |
alarm | |
hour | 小时天气 |
{
"code":200,
"msg":"请求成功",
"data":{
"city":"北京",
"city_en":"beijing",
"province":"北京",
"province_en":"beijing",
"city_id":"101010100",
"update_time":"2022-10-26 14:30:01",
"weather":"霾",
"weather_code":"mai",
"temp":"18",
"min_temp":"10",
"max_temp":"18",
"wind":"北风",
"wind_speed":"3级",
"wind_scale":"17km/h",
"rain":"0",
"rain_24h":"0",
"humidity":"44%",
"visibility":"5km",
"pressure":"1019",
"tail_number":"3和8",
"air":"124",
"air_pm25":"94",
"sunrise":"06:36",
"sunset":"17:20",
"aqi":{
"air":"124",
"air_level":"轻度",
"air_tips":"空气好,除极少数对污染物特别敏感的人群以外,对公众没有危害!",
"pm25":"94",
"pm10":"156",
"co":"0.3",
"no2":"37",
"so2":"4",
"o3":"69"
},
"index":{
"xiche":{
"name":"洗车指数",
"level":"较不适宜",
"content":"预计今日天气较差,不是洗车的最佳时机,等等好天气再洗吧。"
},
"ganmao":{
"name":"感冒指数",
"level":"多发",
"content":"感冒多发期,适当减少外出频率,适量补充水分,适当增减衣物。"
},
"yundong":{
"name":"运动指数",
"level":"不太适宜",
"content":"预计今日整体气象条件较差,应减少锻炼,或选择室内运动。"
},
"huazhuang":{
"name":"化妆指数",
"level":"暂无",
"content":""
},
"chuangyi":{
"name":"穿衣指数",
"level":"卫衣",
"content":"预计今日天气凉爽,早晚较冷,请穿可以保暖的春秋装。建议着休闲装,西装,夹克衫,薄毛衣等,既舒适,又时尚。"
},
"ziwaixian":{
"name":"紫外线强度指数",
"level":"最弱",
"content":"属弱紫外线辐射天气,无需特别防护。若长期在户外,建议涂擦SPF 在8-12 之间的防晒护肤品。"
}
},
"alarm":[
],
"hour":[
{
"time":"2022-10-26 08:00:00",
"temp":"12",
"wea":"阴",
"wea_code":"yin",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 09:00:00",
"temp":"13",
"wea":"阴",
"wea_code":"yin",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 10:00:00",
"temp":"13",
"wea":"阴",
"wea_code":"yin",
"wind":"北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 11:00:00",
"temp":"14",
"wea":"阴",
"wea_code":"yin",
"wind":"北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 12:00:00",
"temp":"15",
"wea":"小雨",
"wea_code":"yu",
"wind":"北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 13:00:00",
"temp":"16",
"wea":"小雨",
"wea_code":"yu",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 14:00:00",
"temp":"18",
"wea":"小雨",
"wea_code":"yu",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 15:00:00",
"temp":"17",
"wea":"小雨",
"wea_code":"yu",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 16:00:00",
"temp":"17",
"wea":"小雨",
"wea_code":"yu",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 17:00:00",
"temp":"17",
"wea":"小雨",
"wea_code":"yu",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 18:00:00",
"temp":"16",
"wea":"多云",
"wea_code":"duoyun",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 19:00:00",
"temp":"16",
"wea":"多云",
"wea_code":"duoyun",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 20:00:00",
"temp":"16",
"wea":"多云",
"wea_code":"duoyun",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 21:00:00",
"temp":"12",
"wea":"多云",
"wea_code":"duoyun",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 22:00:00",
"temp":"12",
"wea":"多云",
"wea_code":"duoyun",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-26 23:00:00",
"temp":"12",
"wea":"阴",
"wea_code":"yin",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-27 00:00:00",
"temp":"11",
"wea":"阴",
"wea_code":"yin",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-27 01:00:00",
"temp":"11",
"wea":"阴",
"wea_code":"yin",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-27 02:00:00",
"temp":"11",
"wea":"阴",
"wea_code":"yin",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-27 03:00:00",
"temp":"10",
"wea":"阴",
"wea_code":"yin",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-27 04:00:00",
"temp":"10",
"wea":"阴",
"wea_code":"yin",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-27 05:00:00",
"temp":"10",
"wea":"多云",
"wea_code":"duoyun",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-27 06:00:00",
"temp":"10",
"wea":"多云",
"wea_code":"duoyun",
"wind":"东北风",
"wind_level":"<3级"
},
{
"time":"2022-10-27 07:00:00",
"temp":"10",
"wea":"多云",
"wea_code":"duoyun",
"wind":"东北风",
"wind_level":"<3级"
}
]
},
"debug":"",
"exec_time":0.318161,
"user_ip":"888.888.888.888"