Weather API

返回指定城市的当前天气报告,以及未来四天的天气预测。

URL

http://pandoralab.appspot.com/api/weather.json

格式

JSON

HTTP 请求方式

GET , POST

请求参数

city: 必填参数. 要获取天气报告的城市名,国内城市使用中文或拼音,国外城市使用英文全称

lan: 可选参数. 语言代码,指定返回天气报告的语言,具体语言代码请参考这里

Status Code

请求参数错误将返回 http 400 错误

查询超时将返回 http 504 错误

查询服务暂停或出错将返回 http 503 错误

返回结果

{
    "forecast_information":
    {
       "city":"Shantou, Guangdong",
       "postal_code": "shantou",
       "forecast_date": "2010-08-09",
       "current_date_time": "2010-08-09 22:00:00 +0000"
    },
    "current_conditions":
    {
       "condition": "局部多云",
       "temp_f": 90,
       "temp_c": 32,
       "humidity": "湿度: 59%",
       "wind_condition": "风向: 南、风速:5 米/秒",
       "icon": "http://www.google.com/ig/images/weather/partly_cloudy.gif"
    },
    "forecast_conditions":
    [
       {
          "day_of_week": "周一",
          "low": 26,
          "high": 33,
          "condition": "可能有暴风雨",
          "icon": "http://www.google.com/ig/images/weather/chance_of_storm.gif"
       },
       {
          "day_of_week": "周二",
          "low": 26,
          "high": 33,
          "condition": "可能有雨",
          "icon": "http://www.google.com/ig/images/weather/chance_of_rain.gif"
       },
       {
          "day_of_week": "周三",
          "low": 27,
          "high": 33,
          "condition": "可能有暴风雨",
          "icon": "http://www.google.com/ig/images/weather/chance_of_storm.gif"
       },
       {
          "day_of_week": "周四",
          "low": 26,
          "high": 32,
          "condition": "可能有暴风雨",
          "icon": "http://www.google.com/ig/images/weather/chance_of_storm.gif"
       }
    ]
}