繁体   English   中英

我在哪里可以找到适用于iPhone应用程序的JSON天气API?

[英]Where can I find a JSON weather api for an iphone app?

我发现大多数使用xml,而id只是使用JSON目标c源代码。

有什么建议么?

我看到了这个:

https://stackoverflow.com/questions/507441/best-weather-apis

Weather Underground有一个返回JSON和XML的API。 公平的定价,加上每天500个免费的开发者电话。 Weather Underground在NOAA官方站外有许多当地气象站,在SF区域有很多。

http://www.wunderground.com/weather/api/d/documentation.html

注意:此API现已被Yahoo弃用, 不起作用


有一段未经证实的Yahoo Weather API我在搞砸了一段时间后发现了。 这是一个示例链接:

http://weather.yahooapis.com/forecastjson?w=12844782&u=c

w之后的值是WOEID, u代表单位。 我确信有更多选项可用于配置URL。

这是它的样子:

{
   "units":{
      "temperature":"C",
      "speed":"km\/h",
      "distance":"km",
      "pressure":"mb"
   },
   "location":{
      "location_id":"ITXX0024",
      "city":"Como",
      "state_abbreviation":"*",
      "country_abbreviation":"IT",
      "elevation":935,
      "latitude":45.81000000000000,
      "longitude":9.08000000000000
   },
   "wind":{
      "speed":5.00000000000000,
      "direction":"VAR"
   },
   "atmosphere":{
      "humidity":"40",
      "visibility":9.99000000000000,
      "pressure":982.00000000000000,
      "rising":"steady"
   },
   "url":"http:\/\/weather.yahoo.com\/forecast\/ITXX0024.html",
   "logo":"http:\/\/l.yimg.com\/a\/i\/us\/nt\/ma\/ma_nws-we_1.gif",
   "astronomy":{
      "sunrise":"08:01",
      "sunset":"16:42"
   },
   "condition":{
      "text":"Fair",
      "code":"34",
      "image":"http:\/\/l.yimg.com\/a\/i\/us\/we\/52\/34.gif",
      "temperature":9.00000000000000
   },
   "forecast":[
      {
         "day":"Today",
         "condition":"Mostly Clear",
         "high_temperature":7.00000000000000,
         "low_temperature":2.00000000000000
      },
      {
         "day":"Tomorrow",
         "condition":"Partly Cloudy",
         "high_temperature":8.00000000000000,
         "low_temperature":2.00000000000000
      },
      {
         "day":"Friday",
         "condition":"Sunny",
         "high_temperature":8.00000000000000,
         "low_temperature":3.00000000000000
      },
      {
         "day":"Saturday",
         "condition":"Mostly Sunny",
         "high_temperature":7.00000000000000,
         "low_temperature":1.00000000000000
      },
      {
         "day":"Sunday",
         "condition":"Sunny",
         "high_temperature":8.00000000000000,
         "low_temperature":1.00000000000000
      }
   ]
}

试试我们最近发布的新款Aeris Weather API。 非常灵活,提供各种各样的数据选项,还有更多的数据可供选择。 我们还提供免费的开发者帐户,每天最多750次点击。

http://www.hamweather.com/products/aeris-api/
http://www.hamweather.com/support/documentation/aeris/

暂无
暂无

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

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