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

发布于 2024-09-13 11:14:07 字数 224 浏览 2 评论 0原文

我发现的大多数都使用 XML,而我宁愿只使用 JSON Objective-C 源代码。

有什么建议吗?

我看过这个:

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

Most of the ones I've found use XML, and I'd rather just use the JSON Objective-C source code.

Any suggestions?

I have seen this:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

雨后彩虹 2024-09-20 11:14:16

尝试我们最近发布的新 Aeris Weather API。极其灵活,提供多种数据选项,未来还会有更多选项。我们还提供免费的开发者帐户,每天最多允许您进行 750 次点击。

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

Try out the new Aeris Weather API that we've recently released. Extremely flexible and offers a wide variety of data options with a lot more coming down the road. We also offer a free developer account that allows you for up to 750 hits per day.

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

深陷 2024-09-20 11:14:15

注意:此 API 现已被 Yahoo 弃用,并且将无法工作


我在闲逛了一段时间后发现了一个未记录的雅虎天气 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
      }
   ]
}

Note: This API is now deprecated by Yahoo and will not work!


There is an undocumented Yahoo Weather API I discovered after messing around for a while. Here's a sample link:

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

The value after w is the WOEID, and u is for units. I'm sure there are more options available for configuring the URL.

Here's what it looks like:

{
   "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
      }
   ]
}
烈酒灼喉 2024-09-20 11:14:13

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

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

Weather Underground has an API that returns JSON and XML. Fair pricing, plus 500 free developer calls a day. Weather Underground has many local weather stations outside of the NOAA official stations, a good number in the SF area.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文