The Weather API is a REST web service that returns current conditions, hourly forecasts (up to 240 hours), daily forecasts (up to 10 days), up to 24 hours of hourly history, and severe weather alerts for a location. Data includes temperature, precipitation, humidity, wind, and UV index. Experimental endpoints add minute-by-minute precipitation forecasts (nowcasting) and weather map tiles.
Weather API: key facts
- Product: Weather API
- Also known as: Google Maps Platform Weather API
- Category: Environment
- Platform: Web service (REST)
- Runs on: Server (backend code)
- Launch stage: GA
- Lifecycle: Active
- Overview: Weather API overview
- Regional availability: Global. Not available in China, Cuba, Iran, North Korea, Syria, or Vietnam. Weather alerts cover 52 countries and regions. Hourly history isn't available in Japan or South Korea. Weather data for Japan and South Korea comes from Weathernews Inc. and requires third-party attribution. (coverage details)
Weather API: when to use it
Use Weather API when:
- You need current weather conditions (temperature, humidity, wind, UV index) for a latitude and longitude.
- You need hourly forecasts up to 240 hours or daily forecasts up to 10 days for a location.
- You need the last 24 hours of hourly weather history for a location.
- You need real-time severe weather alerts, or weather at waypoints along a Routes API route.
Don't use Weather API when:
- You need air quality index (AQI) or pollutant values such as PM2.5 or PM10; the Weather API doesn't return them. Use Air Quality API instead.
- You need pollen counts or pollen forecasts for a location. Use Pollen API instead.
- You need solar irradiance or rooftop solar potential for a building. Use Solar API instead.
- You need hourly weather history older than 24 hours or bulk data for analysis (such as in BigQuery);
history.hourscovers at most 24 hours.
Weather API: setup
- Service to enable:
weather.googleapis.com - Authentication: API key, OAuth 2.0, Service account
- Prototyping key: Get a working, no-cost Maps Demo Key with a personal Google Account (daily quota limits apply; see eligibility and supported features). No Google Cloud project or billing account is required.
- Get started: Set up Weather API
- Reference: Weather API reference
- Pricing: Weather API usage and billing
- Policies: Weather API policies
- Release notes: Weather API release notes
Weather API: related products
- Often used with: Routes API
Weather API: common mistakes
- Problem: Responses default to metric units; apps that expect Fahrenheit or miles display wrong values. Fix: Set the
unitsSystemparameter (for exampleIMPERIAL) in the request. See /maps/documentation/weather/current-conditions. - Problem: Hourly forecast returns only 24 hours per page by default, even if you request more hours; page tokens become invalid (error) if data is unavailable for any hour in the period. Fix: Set
pageSizeand follownextPageTokenthrough thepageTokenparameter; handle token errors. See /maps/documentation/weather/hourly-forecast. - Problem: When there is no active alert (or a required provider field is missing),
publicAlertsreturns an emptyweatherAlertsarray withregionCode(and an emptynextPageToken); missing optional alert fields are omitted. Fix: Treat an empty or missingweatherAlertsarray as no alert, and don't assume optional fields are present. See /maps/documentation/weather/weather-alerts. - Problem: Coverage marks China, Cuba, Iran, North Korea, Syria, and Vietnam as unsupported, yet
currentConditions:lookupcan still return data there;history/hours:lookup(such as in Japan and South Korea) andpublicAlerts:lookupreturn 404 (NOT_FOUND) for unsupported locations. Fix: Check the coverage page before you query, and handle 404 responses; don't rely on an error to detect unsupported locations. See /maps/documentation/weather/coverage.
What you can do with Weather API
See the guides linked below for each task, or compare across products in the Capabilities Explorer.
- Return current weather conditions for a set of latitude/longitude coordinates. Note: Call this endpoint from your server and keep the API key there. See /maps/api-security-best-practices#proxy-server.
- Return a daily weather forecast for a set of latitude/longitude coordinates. Note: Call this endpoint from your server and keep the API key there. See /maps/api-security-best-practices#proxy-server.
- Return an hourly weather forecast for a set of latitude/longitude coordinates. Note: Call this endpoint from your server and keep the API key there. See /maps/api-security-best-practices#proxy-server.
- Return up to 24 hours of hourly historical weather data for a set of latitude/longitude coordinates. Note: Call this endpoint from your server and keep the API key there. See /maps/api-security-best-practices#proxy-server.
- Return weather alerts occurring in real time for a given latitude and longitude. Note: Call this endpoint from your server and keep the API key there. See /maps/api-security-best-practices#proxy-server.