Weather API 概览
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
借助 Weather API,您可以请求全球各地点的实时超本地天气数据。天气信息包括温度、降水、湿度等。
对于给定纬度和经度的位置,该 API 提供的端点可让您查询:
- 当前天气状况:当前天气状况。
- 每小时天气预报:所有要素的预测情况,最长可达 240 小时。
- 每日预报:所有要素的预报情况,最多可显示 10 天。
- 每小时历史记录:所有元素最多 24 小时的缓存历史条件。
Weather API 的功能
天气 API 数据包括以下内容:
- 天气状况和图标:用于指示当前天气状况的说明和相应图标(例如“多云”或“零星阵雪”)。
- 温度:最低温度、最高温度和体感温度。
- 降水:总降水量和降水类型(雪、雨、冰、混合)。
- 风:平均风寒指数、风向、最大风速和阵风。
- 冰层厚度:冰层的厚度。
- 湿度:、酷热指数、湿球温度和相对湿度。
- 紫外线指数:紫外线 (UV) 指数。
- 雷暴概率:发生雷暴的百分比概率。
- 能见度:物体清晰可见的距离。
- 气压:平均海平面气压。
- 日出和月出事件:日出、日落、月出和月落时间。
- 云量:云层覆盖天空的百分比。
如何使用 Weather API
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[],[],null,["# Weather API overview\n\nThe Weather API lets you request real-time, hyperlocal weather data for\nlocations around the world. Weather information includes temperature,\nprecipitation, humidity, and more.\n\nFor a location at a given latitude and longitude, the API provides endpoints\nthat let you query:\n\n- **Current conditions:** The current weather conditions.\n- **Hourly forecast:** Up to 240 hours of forecasted conditions for all elements.\n- **Daily forecast:** Up to 10 days of forecasted conditions for all elements.\n- **Hourly history:** Up to 24 hours of cached past conditions for all elements.\n\nFeatures of the Weather API\n---------------------------\n\nWeather API data includes the following:\n\n- **Weather conditions and icons:** A description and corresponding icon indicating the current weather conditions (for example, \"Cloudy\" or \"Scattered snow showers\").\n- **Temperature:** Minimum, maximum, and apparent (\"feels like\") temperatures.\n- **Precipitation:** Total precipitation and precipitation type (snow, rain, ice, mix).\n- **Wind:** Average windchill, wind direction, maximum speed, and gust.\n- **Ice thickness:** Thickness of ice.\n- **Humidity:** Dew point, heat index, wet-bulb temperature, and relative humidity.\n- **UV index:** Ultraviolet (UV) index.\n- **Thunderstorm probability:** The percent chance of a thunderstorm occurring.\n- **Visibility:** The distance at which an object is clearly visible.\n- **Air pressure:** The average sea level air pressure.\n- **Sun and moon events:** Sunrise, sunset, moonrise, and moonset times.\n- **Cloud cover:** The percentage of the sky covered by clouds.\n\nHow to use the Weather API\n--------------------------\n\n|---|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------|\n| 1 | **Get set up** | Start with [Set up your Google Cloud project](/maps/documentation/weather/cloud-setup) and complete the instructions that follow. |\n| 2 | **Get current conditions** | See [Get current conditions](/maps/documentation/weather/current-conditions). |\n| 3 | **Get hourly forecast** | See [Get hourly forecast](/maps/documentation/weather/hourly-forecast). |\n| 4 | **Get daily forecast** | See [Get daily forecast](/maps/documentation/weather/daily-forecast). |\n| 5 | **Get hourly history** | See [Get hourly history](/maps/documentation/weather/hourly-history). |\n\nWhat's next\n-----------\n\n- [Set up your Google Cloud project](/maps/documentation/weather/cloud-setup)\n- [Get current conditions](/maps/documentation/weather/current-conditions)\n- [Get hourly forecast](/maps/documentation/weather/hourly-forecast)\n- [Get daily forecast](/maps/documentation/weather/daily-forecast)\n- [Get hourly history](/maps/documentation/weather/hourly-history)"]]