The Weather API lets you request real-time, hyperlocal weather data for locations around the world to power live weather dashboards, weather updating apps, route weather overlays, and weather-based health or activity trackers. Weather information includes current temperature, precipitation, relative humidity, wind speed, UV index, and more.
For a location at a given latitude and longitude, the API provides endpoints
(https://weather.googleapis.com/v1/...) for the data in the following table.
REST endpoints at a glance
| API endpoint | URL | Description | Documented parameters |
|---|---|---|---|
| Current conditions | https://weather.googleapis.com/v1/currentConditions:lookup |
Live weather conditions | location.latitude, location.longitude |
| Hourly forecast | https://weather.googleapis.com/v1/forecast/hours:lookup |
Up to 240 hours of forecasted conditions | location.latitude, location.longitude |
| Daily forecast | https://weather.googleapis.com/v1/forecast/days:lookup |
Up to 10 days of forecasted conditions | location.latitude, location.longitude |
| Hourly history | https://weather.googleapis.com/v1/history/hours:lookup |
Up to 24 hours of cached past conditions | location.latitude, location.longitude |
| Severe weather alerts | https://weather.googleapis.com/v1/publicAlerts:lookup |
Severe weather alerts | key, location.latitude, location.longitude |
Common use cases
- Live weather and weather updating dashboards: Query
currentConditions:lookup,forecast/hours:lookup, andforecast/days:lookupusing GPS coordinates (location.latitudeandlocation.longitude) or geocoded city coordinates to display auto-updating temperature, humidity, and wind speed. - Route weather overlays: Sample latitude and longitude waypoints along a
route polyline from the Routes API and call
currentConditions:lookuporforecast/hours:lookupat each waypoint's estimated arrival time to alert drivers to changing weather conditions. - Weather-based health, hydration, and activity trackers: Fetch local
temperature,feelsLikeTemperature,relativeHumidity,heatIndex, anduvIndexfromcurrentConditions:lookupto adjust daily hydration goals or outdoor exercise recommendations.
Features of the Weather API
Weather API data includes the following:
- Weather conditions and icons: A description and corresponding icon
indicating the current weather conditions (for example, "Cloudy" or
"Scattered snow showers") in
weatherCondition. - Temperature: Current temperature (
temperature), minimum and maximum temperatures (minTemperatureandmaxTemperatureon daily forecasts, or insidecurrentConditionsHistory), and apparent ("feels like") temperature (feelsLikeTemperature). - Precipitation: Total precipitation and precipitation type (snow, rain, ice, mix).
- Wind: Windchill (
windChill), wind direction (wind.direction), wind speed (wind.speed), and gust (wind.gust). - Ice thickness: Thickness of ice.
- Humidity: Dew point (
dewPoint), heat index (heatIndex), wet-bulb temperature (wetBulbTemperature), and relative humidity (relativeHumidity). - UV index: Ultraviolet (UV) index (
uvIndex). - Thunderstorm probability: The percent chance of a thunderstorm occurring.
- Visibility: The distance at which an object is clearly visible.
- Air pressure: The average sea level air pressure.
- Sun and moon events: Sunrise, sunset, moonrise, and moonset times.
- Cloud cover: The percentage of the sky covered by clouds.
How to use the Weather API
| 1 | Get set up | Start with Set up your Google Cloud project and complete the instructions that follow. |
| 2 | Get current conditions | See Get current conditions. |
| 3 | Get hourly forecast | See Get hourly forecast. |
| 4 | Get daily forecast | See Get daily forecast. |
| 5 | Get hourly history | See Get hourly history. |
| 6 | Get weather alerts | See Get weather alerts. |
Related environmental APIs
For air quality index (AQI) and particulate pollutants (PM2.5, PM10), use the
Air Quality API (https://airquality.googleapis.com/v1/currentConditions:lookup).
The Weather API doesn't return these values.
Other related environmental APIs include:
- Pollen counts: Pollen API (
https://pollen.googleapis.com/v1/forecast:lookup) - Solar irradiance and rooftop potential: Solar API
(
https://solar.googleapis.com/v1/buildingInsights:findClosest)
What's next
- Set up your Google Cloud project
- Get current conditions
- Get hourly forecast
- Get daily forecast
- Get hourly history
- Get weather alerts