# 天气情况API接口

摘要

可查 城市 县区的天气情况

接口地址:

https://api.vvhan.com/api/weather

请求方式:

GET

返回格式:

JSON

请求示例:

https://api.vvhan.com/api/weather

自动识别:

https://api.vvhan.com/api/weather

根据IP:

https://api.vvhan.com/api/weather?ip=180.149.130.16

根据城市:

https://api.vvhan.com/api/weather?city=北京

一周天气:

https://api.vvhan.com/api/weather?city=北京&type=week

请求参数:
名称必填说明

city输入城市或县区

ip输入IP

返回状态:
名称必填说明

success成功:true,失败:false

message返回状态描述信息

返回示例:

{"success":true,"city":"北京市","data":{"date":"2024-03-14","week":"星期四","type":"晴","low":"5°C","high":"21°C","fengxiang":"西南风","fengli":"3-4级","night":{"type":"晴","fengxiang":"西南风","fengli":"1-3级"}},"air":{"aqi":85,"aqi_level":2,"aqi_name":"良","co":"1","no2":"33","o3":"99","pm10":"119","pm2.5":"62","so2":"4"},"tip":"天有点冷,注意保暖~"}