要獲取當前天氣、1 小時的分鐘預報、48 小時的每小時預報、8 天的每日預報以及政府天氣警報,請使用文檔的此部分。
如果您對 1979 年 1 月 1 日至未來 4 天的任何時間戳的天氣數據感興趣,請閱讀“時間戳的天氣數據”部分。
如果您對從 1979 年 1 月 2 日到未來 1.5 年的長期預報的每日匯總天氣數據感興趣,請閱讀文檔的“每日匯總”部分。
請求參數{
"lat": null,
"lon": null,
"appid": null,
"exclude": null,
"units": null,
"lang": null
}
返回參數
{
"lat": null,
"lon": null,
"timezone": null,
"timezone_offset": null,
"current": null,
"current.dt": null,
"current.sunrise": null,
"current.sunset": null,
"current.temp": null,
"current.feels_like": null,
"current.pressure": null,
"current.humidity": null,
"current.dew_point": null,
"current.clouds": null,
"current.uvi": null,
"current.visibility": null,
"current.wind_speed": null,
"current.wind_gust": null,
"current.wind_deg": null,
"current.rain": null,
"current.rain.1h": null,
"current.snow": null,
"current.snow.1h": null,
"current.weather": null,
"current.weather.id": null,
"current.weather.main": null,
"current.weather.description": null,
"current.weather.icon": null,
"minutely": null,
"minutely.dt": null,
"minutely.precipitation": null,
"hourly": null,
"hourly.dt": null,
"hourly.temp": null,
"hourly.feels_like": null,
"hourly.pressure": null,
"hourly.humidity": null,
"hourly.dew_point": null,
"hourly.uvi": null,
"hourly.clouds": null,
"hourly.visibility": null,
"hourly.wind_speed": null,
"hourly.wind_gust": null,
"hourly.wind_deg": null,
"hourly.pop": null,
"hourly.rain": null,
"hourly.rain.1h": null,
"hourly.snow": null,
"hourly.snow.1h": null,
"hourly.weather": null,
"hourly.weather.id": null,
"hourly.weather.main": null,
"hourly.weather.description": null,
"hourly.weather.icon": null,
"daily": null,
"daily.dt": null,
"daily.sunrise": null,
"daily.sunset": null,
"daily.moonrise": null,
"daily.moonset": null,
"daily.moon_phase": null,
"summary": null,
"daily.temp": null,
"daily.temp.morn": null,
"daily.temp.day": null,
"daily.temp.eve": null,
"daily.temp.night": null,
"daily.temp.min": null,
"daily.temp.max": null,
"daily.feels_like": null,
"daily.feels_like.morn": null,
"daily.feels_like.day": null,
"daily.feels_like.eve": null,
"daily.feels_like.night": null,
"daily.pressure": null,
"daily.humidity": null,
"daily.dew_point": null,
"daily.wind_speed": null,
"daily.wind_gust": null,
"daily.wind_deg": null,
"daily.clouds": null,
"daily.uvi": null,
"daily.pop": null,
"daily.rain": null,
"daily.snow": null,
"daily.weather": null,
"daily.weather.id": null,
"daily.weather.main": null,
"daily.weather.description": null,
"daily.weather.icon": null,
"alerts": null,
"alerts.sender_name": null,
"alerts.event": null,
"alerts.start": null,
"alerts.end": null,
"alerts.description": null,
"alerts.tags": null,
"cod": "",
"message": "",
"parameters": ""
}
錯誤碼
{
"400": "錯誤 400 - 錯誤請求。如果請求中缺少某些必需參數,或者某些請求參數的格式不正確或值超出允許的范圍,您可能會收到 400 錯誤。所有缺失或不正確的參數名稱列表將在“ErrorResponse”對象的“parameters”屬性中返回。",
"401": "錯誤 401 - 未經授權。如果請求中未提供 API 令牌,或者請求中提供的 API 令牌未授予對此 API 的訪問權限,您可能會收到 401 錯誤。在返回請求之前,您必須將具有產品訪問權限的 API 令牌添加到請求中。",
"404": "未找到錯誤404。如果服務數據庫中不存在請求參數( lat、等)的數據,您可能會收到 404 錯誤lon。date您不得重試同一請求。",
"429": "錯誤 429 - 請求過多。如果超出了向此 API 提供的 API 請求的關鍵配額,您可能會收到 429 錯誤。您可以在一段時間后或延長密鑰配額后重試請求。",
"5xx": "錯誤 5xx - 意外錯誤。如果出現其他內部錯誤,您可能會收到“5xx”錯誤。錯誤響應代碼將為“5xx”。請聯系我們,并將收到此錯誤的 API 請求示例附在您的電子郵件中,以便我們分析并及時為您找到解決方案。您可以重試導致此錯誤的請求。"
}