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](https://developers.google.com/maps/documentation/weather/overview.md.txt)
- **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](https://developers.google.com/maps/documentation/weather/coverage.md.txt))

## 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](https://developers.google.com/maps/documentation/air-quality/quick-reference.md.txt) instead.
- You need pollen counts or pollen forecasts for a location. Use [Pollen API](https://developers.google.com/maps/documentation/pollen/quick-reference.md.txt) instead.
- You need solar irradiance or rooftop solar potential for a building. Use [Solar API](https://developers.google.com/maps/documentation/solar/quick-reference.md.txt) 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

- **Service to enable:** `weather.googleapis.com`
- **Authentication:** API key, OAuth 2.0, Service account
- **Prototyping key:** Get a working, no-cost [Maps Demo Key](https://developers.google.com/maps/demo-key.md.txt) with a personal Google Account (daily quota limits apply; see [eligibility and supported features](https://developers.google.com/maps/demo-key.md.txt#eligibility)). No Google Cloud project or billing account is required.
- **Get started:** [Set up Weather API](https://developers.google.com/maps/documentation/weather/get-api-key.md.txt)
- **Reference:** [Weather API reference](https://developers.google.com/maps/documentation/weather/reference/rest.md.txt)
- **Pricing:** [Weather API usage and billing](https://developers.google.com/maps/documentation/weather/usage-and-billing.md.txt)
- **Policies:** [Weather API policies](https://developers.google.com/maps/documentation/weather/policies.md.txt)
- **Release notes:** [Weather API release notes](https://developers.google.com/maps/documentation/weather/release-notes.md.txt)

## Weather API: related products

- **Often used with:** [Routes API](https://developers.google.com/maps/documentation/routes/quick-reference.md.txt)

## 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](https://developers.google.com/maps/documentation/weather/current-conditions.md.txt).
- **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](https://developers.google.com/maps/documentation/weather/hourly-forecast.md.txt).
- **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](https://developers.google.com/maps/documentation/weather/weather-alerts.md.txt).
- **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](https://developers.google.com/maps/documentation/weather/coverage.md.txt).

## What you can do with Weather API

See the guides linked below for each task, or compare across products in the
[Capabilities Explorer](https://developers.google.com/maps/documentation/capabilities-explorer.md.txt).

- [Return current weather conditions for a set of latitude/longitude coordinates.](https://developers.google.com/maps/documentation/weather/current-conditions.md.txt) **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.](https://developers.google.com/maps/documentation/weather/daily-forecast.md.txt) **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.](https://developers.google.com/maps/documentation/weather/hourly-forecast.md.txt) **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.](https://developers.google.com/maps/documentation/weather/hourly-history.md.txt) **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.](https://developers.google.com/maps/documentation/weather/weather-alerts.md.txt) **Note:** Call this endpoint from your server and keep the API key there. See /maps/api-security-best-practices#proxy-server.