请求方式:
GET
请求地址:
https://api.vvhan.com/api/weather
请求示例:
https://api.vvhan.com/api/weather 自动识别
https://api.vvhan.com/api/weather?ip=180.149.130.16 根据IP
https://api.vvhan.com/api/weather?city=北京 根据城市
https://api.vvhan.com/api/weather?city=北京&type=week 一周天气
返回格式:
JSON
请求参数:
city
否
输入城市或县区
ip
否
输入IP
返回参数:
返回示例:
{"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":"天有点冷,注意保暖~"}