要獲取當(dāng)前天氣、1 小時(shí)的分鐘預(yù)報(bào)、48 小時(shí)的每小時(shí)預(yù)報(bào)、8 天的每日預(yù)報(bào)以及政府天氣警報(bào),請(qǐng)使用文檔的此部分。
如果您對(duì) 1979 年 1 月 1 日至未來 4 天的任何時(shí)間戳的天氣數(shù)據(jù)感興趣,請(qǐng)閱讀“時(shí)間戳的天氣數(shù)據(jù)”部分。
如果您對(duì)從 1979 年 1 月 2 日到未來 1.5 年的長(zhǎng)期預(yù)報(bào)的每日匯總天氣數(shù)據(jù)感興趣,請(qǐng)閱讀文檔的“每日匯總”部分。
請(qǐng)求參數(shù){
"lat": null,
"lon": null,
"appid": null,
"exclude": null,
"units": null,
"lang": null
}
返回參數(shù)
{
"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": ""
}
錯(cuò)誤碼
{
"400": "錯(cuò)誤 400 - 錯(cuò)誤請(qǐng)求。如果請(qǐng)求中缺少某些必需參數(shù),或者某些請(qǐng)求參數(shù)的格式不正確或值超出允許的范圍,您可能會(huì)收到 400 錯(cuò)誤。所有缺失或不正確的參數(shù)名稱列表將在“ErrorResponse”對(duì)象的“parameters”屬性中返回。",
"401": "錯(cuò)誤 401 - 未經(jīng)授權(quán)。如果請(qǐng)求中未提供 API 令牌,或者請(qǐng)求中提供的 API 令牌未授予對(duì)此 API 的訪問權(quán)限,您可能會(huì)收到 401 錯(cuò)誤。在返回請(qǐng)求之前,您必須將具有產(chǎn)品訪問權(quán)限的 API 令牌添加到請(qǐng)求中。",
"404": "未找到錯(cuò)誤404。如果服務(wù)數(shù)據(jù)庫(kù)中不存在請(qǐng)求參數(shù)( lat、等)的數(shù)據(jù),您可能會(huì)收到 404 錯(cuò)誤lon。date您不得重試同一請(qǐng)求。",
"429": "錯(cuò)誤 429 - 請(qǐng)求過多。如果超出了向此 API 提供的 API 請(qǐng)求的關(guān)鍵配額,您可能會(huì)收到 429 錯(cuò)誤。您可以在一段時(shí)間后或延長(zhǎng)密鑰配額后重試請(qǐng)求。",
"5xx": "錯(cuò)誤 5xx - 意外錯(cuò)誤。如果出現(xiàn)其他內(nèi)部錯(cuò)誤,您可能會(huì)收到“5xx”錯(cuò)誤。錯(cuò)誤響應(yīng)代碼將為“5xx”。請(qǐng)聯(lián)系我們,并將收到此錯(cuò)誤的 API 請(qǐng)求示例附在您的電子郵件中,以便我們分析并及時(shí)為您找到解決方案。您可以重試導(dǎo)致此錯(cuò)誤的請(qǐng)求。"
}