关于天气

## 关于天气接口 https://openweathermap.org/guide #### 1. 使用openWeather API接口 ![image.png](https://cos.easydoc.net/21942958/files/kev2zo92.png) - api_key: ```a9e95b29c785688b2623e05c2568e27e``` #### 2. 根据城市名称获取当前天气 http://api.openweathermap.org/data/2.5/weather?q=Sydney,AU&appid={{api_key}} ``` { "coord": { "lon": 151.21, "lat": -33.87 }, "weather": [ { "id": 803, "main": "Clouds", "description": "broken clouds", "icon": "04n" } ], "base": "stations", "main": { "temp": 285.81, "feels_like": 280.97, "temp_min": 284.82, "temp_max": 287.15, "pressure": 1027, "humidity": 87 }, "visibility": 9000, "wind": { "speed": 7.2, "deg": 170 }, "clouds": { "all": 75 }, "dt": 1599639491, "sys": { "type": 1, "id": 9600, "country": "AU", "sunrise": 1599595378, "sunset": 1599637347 }, "timezone": 36000, "id": 2147714, "name": "Sydney", "cod": 200 } ``` ![image.png](https://cos.easydoc.net/21942958/files/kfhwd79x.png) ![image.png](https://cos.easydoc.net/21942958/files/kfhwdohe.png) #### 3. 通过 位置坐标 获取天气 http://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={API key}