Weather API quick reference

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.hours covers at most 24 hours.

Weather API: setup

Weather API: common mistakes

  • Problem: Responses default to metric units; apps that expect Fahrenheit or miles display wrong values. Fix: Set the unitsSystem parameter (for example IMPERIAL) 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 pageSize and follow nextPageToken through the pageToken parameter; handle token errors. See /maps/documentation/weather/hourly-forecast.
  • Problem: When there is no active alert (or a required provider field is missing), publicAlerts returns an empty weatherAlerts array with regionCode (and an empty nextPageToken); missing optional alert fields are omitted. Fix: Treat an empty or missing weatherAlerts array 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:lookup can still return data there; history/hours:lookup (such as in Japan and South Korea) and publicAlerts:lookup return 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.