繁体   English   中英

使用Weather Underground API检索天气信息

[英]Using the Weather Underground API for retrieving weather info

首先,是否可以在Java应用程序中使用API​​? 代码示例列出Java。

无论如何,我想知道是否有可能在一个独立的Java应用程序中结合GeoIP地理定位和Weather Underground来检索天气数据。

要构造的URL如下所示:
http://api.wunderground.com/api/[API key here]/conditions/q/CA/San_Francisco.json

  • 那么我可以使用URLConnection类来获取响应的信息吗?
  • 1-是的,您应该能够从Java应用程序调用它并解析json响应

    2-您可以在查询中指定国家/城市,如下所示:

    http://api.wunderground.com/api/Your_Key/geolookup/conditions/forecast/q/Country/City.json
    

    暂无
    暂无

    声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

     
    粤ICP备18138465号  © 2020-2024 STACKOOM.COM