Bootstrap

20220626-JAVA高德地图天气API调用总结

AutoNavi——Weather API Usage

Background

I need information of weather forecast ,so I choose AutoNavi API as it is widely used in China


Website
https://lbs.amap.com
Apply for Key

image-20220624200829566

Document Download
https://lbs.amap.com/api/webservice/download

#部分数据<adcode>
厦门市	350200	0592
厦门市市辖区	350201	0592
思明区	350203	0592
海沧区	350205	0592
湖里区	350206	0592
集美区	350211	0592
同安区	350212	0592
翔安区	350213	0592
API format
#返回预报天气
https://restapi.amap.com/v3/weather/weatherInfo?city=<adcode>&key=<用户key>&extensions=all
#返回实况天气
https://restapi.amap.com/v3/weather/weatherInfo?city=<adcode>&key=<用户key>&extensions=base
Json Entities Class
@Data
public class WeatherDTO {
   
    private String status;
    private String count;
    private String info;
    private String infocode;
    private ArrayList<Forecast> forecasts;
}


@Data
public class Forecast {
   
   private

悦读

道可道,非常道;名可名,非常名。 无名,天地之始,有名,万物之母。 故常无欲,以观其妙,常有欲,以观其徼。 此两者,同出而异名,同谓之玄,玄之又玄,众妙之门。

;