Meet the Google Weather API: Real time weather for maps

Learn how to use the new Google Weather API to integrate real time weather data and forecasts into your apps and maps.

Meet the Google Weather API: Real time weather for maps

At Google Next 2025, Google launched the new Google Weather API, which provides detailed real time and predicted weather data for any location worldwide. In this tutorial series, I’ll explore the Weather API's potential use cases, discuss pricing (spoiler: it's free for now) and talk about how it fits in the Google Maps API ecosystem. I’ll also show you how to build three helpful apps with it.

Part 1: Meet the Google Weather API: Real time weather for maps (this article)
Part 2: Building a simple weather app with the Google Weather API
Part 3: Google Maps weather along route: Weather aware route planner
Part 4: Plan better delivery routes with the Google Weather API

First, we’ll create a simple weather app that displays current and forecasted conditions for any location in the world. Next, we’ll build a route planner that provides weather forecasts along your route. Finally, we’ll develop a delivery management tool that shows the expected weather at each stop. As always, I'll include working code that you can use in your own projects.

What is the Google Weather API?

The Google Weather API is a web service that delivers real-time, hyperlocal weather data, both current and forecasted, for any location worldwide. Simply provide a latitude and longitude, and the API returns detailed weather conditions for that point, now and in the near future. The response includes data such as temperature, precipitation, humidity, wind speed, and descriptive conditions like clear skies or thunderstorms. It also provides ready to use weather icons that visually represent the forecast, making it easy to display conditions in your app or on your map.

How does the Google Weather API work?

Just like with the Google Maps Route Optimization API, the Google Weather API is based on incredible research and AI work done at Google Research and commercialized through the Google Maps engineering and product teams. This is in itself an amazing achievement. It's not easy to take a research idea and turn it into a commercially viable (more on that later) product.

🌐
You can read the full paper, Probabilistic weather forecasting with machine learning for free on the Nature website.

What's even more impressive is that traditionally, weather forecasts have been based on numerical weather prediction, which relies on physics based simulations of the atmosphere. Google's weather model on the other hand, utilizes pattern matching to generate a probabilistic weather forecast that takes seconds instead of hours to generate.

Google claims that its weather model significantly outperforms ENS, the leading ensemble forecast from the European Centre for Medium-Range Weather Forecasts. In an era marked by climate change, the model offers improved accuracy in predicting both the timing and impact of extreme weather events. For instance, it successfully forecasted the path of Hurricane Milton 4 to 7 days in advance and identified the formation of Hurricane Helene a full two weeks before landfall.

The Google Weather API has two main endpoints:

  1. Current Conditions, which returns information about current weather conditions at a specific location.
  2. Forecast, which returns up to 10 days of weather forecast information for a specific location, starting with the current day.

There's a third endpoint, History, but it's rarely used. It returns up to 24 hours of hourly historical weather data at a given location, starting from the last hour.

What can the Google Weather API be used for?

Well, it can obviously be used to tell the weather. The documentation for the Google Weather API is straightforward and the API itself is easy enough to use. With a few lines of code (or a carefully worded Gemini prompt), you can build a basic weather app like the one below:

But Google's ambition for the Weather API goes far beyond simple weather apps. It envisions the Weather API as a key component in building predictive, weather aware solutions by combining it with other Google Maps APIs. For instance, when used alongside the Routes API or GMPRO, it can power route planning tools that adjust in real time based on current weather conditions. We'll build an example of this later in the tutorial series.

How much does the Google Weather API cost?

The Google Weather API is currently in Preview (pre-GA), so there’s no charge for usage at this time (source). While API calls will still appear on your Cloud Console billing page, the cost will be $0. Google has not yet announced final pricing, but it's likely to be competitively priced to stand out in the established weather API market.

As with other Google Maps services, working with a Google Maps Partner can provide access to discounted pricing once it becomes available.

How good is the Google Weather API?

Good is subjective. To evaluate the Google Weather API, I'm going to head outside and in a totally unscientific way, see what's the weather like and compare that to what the Google Weather API tells me (Google has been using the Weather API in its search results for over a year. For example, a simple search like "Vancouver weather" will show you real time weather data powered by the API).

It's currently raining outside (I live in Vancouver, Canada, so this is a totally normal for a wet spring day) and feels a little chilly. What does the Google Weather API say?

Great! Sounds about right. Now, let's see how the 7 day weather forecast returned by the Google Weather API compares to the what I consider to be the gold standard of Western Canada weather forecasting, the Environment Canada weather app at https://weather.gc.ca/.

Not bad - the daily high and low temperatures are pretty consistent, and the overall weather conditions align well. That said, Environment Canada is forecasting a sunnier week, while the Google Weather API is predicting a bit more cloud cover.

Google Weather API alternatives

Competition? There's plenty. Most governments view accurate weather data as a public good because of its importance in air travel, commercial shipping and general public safety (think about the impact hurricanes have on Florida). As a result, agencies like the Environment Canada and the National Weather Service offer real time weather conditions and forecasts for free, including access through public APIs.

In addition to public agencies, many private companies offer virtually identical weather APIs for free or at very low cost. Examples include:

  • OpenWeather, one of the most widely used weather APIs globally,
  • AccuWeather, popular with airlines, news organizations and the insurance industry,
  • Open Meteo, an open source weather API that offers free access for non-commercial use.

In my view, Google’s best opportunity lies in positioning the Weather API for casual, non mission critical use cases, especially when integrated with other Google Maps APIs. For example, a travel agency could recommend destinations based on forecasted weather, like promoting "sunny beach getaways this weekend". Similarly, an online grocery service might use the API to monitor weather along a driver’s route and proactively notify customers of potential delivery delays.

Why would these companies choose Google over a cheaper or free alternative? For convenience, mostly. Many of them are already using other Google Maps APIs, so it’s easier to justify sticking with a single provider for multiple services.

Google Weather API key

To get started with the Weather API, you'll need to first enable it in the Google Cloud Console. Once you've created a Google Cloud project, find your way to the APIs & Services page and search for "weather". The "Weather API" should show up as the first result. Click [Enable] to get access.

Google Weather API example

Here's a simple example that shows how to fetch the current weather for Vancouver, Canada (49.246292, -123.116226) to display on a website.

Endpoint: GET

https://weather.googleapis.com/v1/currentConditions:lookup?key={YOUR_API_KEY}
&location.latitude={LATITUDE}
&location.longitude={LONGITUDE}

{YOUR_API_KEY} This is your Google Maps API key with the Google Weather API enabled.

{LATITUDE} The latitude coordinates of the location you want to get weather for.

{LONGITUDE} The longitude coordinates of the location you want to get weather for.

Using 49.246292, -123.116226 for latitude and longitude gives us:

Response

{
    "currentTime": "2025-04-20T08:47:01.340744445Z",
    "timeZone": {
        "id": "America/Vancouver"
    },
    "isDaytime": false,
    "weatherCondition": {
        "iconBaseUri": "https://maps.gstatic.com/weather/v1/mostly_cloudy_night",
        "description": {
            "text": "Mostly cloudy",
            "languageCode": "en"
        },
        "type": "MOSTLY_CLOUDY"
    },
    "temperature": {
        "degrees": 7.2,
        "unit": "CELSIUS"
    },
    "feelsLikeTemperature": {
        "degrees": 7.2,
        "unit": "CELSIUS"
    },
    "dewPoint": {
        "degrees": 5.4,
        "unit": "CELSIUS"
    },
    "heatIndex": {
        "degrees": 7.2,
        "unit": "CELSIUS"
    },
    "windChill": {
        "degrees": 7.2,
        "unit": "CELSIUS"
    },
    "relativeHumidity": 90,
    "uvIndex": 0,
    "precipitation": {
        "probability": {
            "percent": 9,
            "type": "RAIN"
        },
        "snowQpf": {
            "quantity": 0,
            "unit": "MILLIMETERS"
        },
        "qpf": {
            "quantity": 0,
            "unit": "MILLIMETERS"
        }
    },
    "thunderstormProbability": 0,
    "airPressure": {
        "meanSeaLevelMillibars": 1022.11
    },
    "wind": {
        "direction": {
            "degrees": 315,
            "cardinal": "NORTHWEST"
        },
        "speed": {
            "value": 3,
            "unit": "KILOMETERS_PER_HOUR"
        },
        "gust": {
            "value": 5,
            "unit": "KILOMETERS_PER_HOUR"
        }
    },
    "visibility": {
        "distance": 16,
        "unit": "KILOMETERS"
    },
    "cloudCover": 69,
    "currentConditionsHistory": {
        "temperatureChange": {
            "degrees": -1.9,
            "unit": "CELSIUS"
        },
        "maxTemperature": {
            "degrees": 12.2,
            "unit": "CELSIUS"
        },
        "minTemperature": {
            "degrees": 6.8,
            "unit": "CELSIUS"
        },
        "snowQpf": {
            "quantity": 0,
            "unit": "MILLIMETERS"
        },
        "qpf": {
            "quantity": 3.8201,
            "unit": "MILLIMETERS"
        }
    }
}

The weatherCondition object provides details about the weather condition for a given location. It includes:

  • iconBaseUri, the URL of the weather icon associated with the specific weather condition. You can append a ".png" or ".svg" to the URL to retrieve the icon directly e.g. https://maps.gstatic.com/weather/v1/mostly_cloudy_night.png.
  • description, which provides a textual description for the associated weather condition e.g. "MOSTLY_CLOUDY"

temperature tells us the temperature for the given location in degrees celsius (switch units to degrees Fahrenheit by adding unitsSystem=IMPERIAL to the request).

precipitation represents a set of precipitation values at a given location. It contains:

  • probability, the probability of precipitation of a certain type ("RAIN", "SNOW", "FREEZING_RAIN" etc) at that location. When a weather forecast says there’s a 50% chance of rain, it usually means that, "There is a 50% probability that measurable rain will occur at a given location during the forecast period".

    Forecasters often use the formula: PoP (Probability of Precipitation) = Confidence × Areal Coverage. So, a 50% chance could mean:

    Google is 100% confident it will rain, but only half the area will get it or, Google is 50% confident it will rain everywhere in the area.

currentConditionsHistory provides the minimum and maximum temperatures recorded in the past 24 hours. These values are commonly shown in weather apps to help users understand the daily variation in temperature.

What's next for the Google Weather API

Many of Google’s newer APIs are very niche, but they excel at solving the specific problems they’re designed for. The Places Insights API is a good example of this. It provides the density, distribution, and availability of places within a specified area. It's useful to someone looking to set up a new cafe or restaurant, but not to anyone else.

The Google Weather API on the other hand, has a huge total addressable market (everyone checks the weather at some point during the day) but one that is hard to make money from - "Large TAM, low willingness to pay". Very few people pay for weather forecasts, and when they do, it's because there is financial payoff to making good decisions based on the weather.

For example, as an avid skier, during the ski season I subscribe to OpenSnow, a website that provides highly accurate snow forecasts. Forecasting mountainside snow conditions is notoriously difficult. Small changes in wind or elevation can cause huge shifts in local weather - rain on one side of a hill, sun on the other. Models often can't resolve these microclimates well enough. OpenSnow hires professional weather forecasters who are familiar with the terrain of many ski resorts to analyze computer generated forecasts and use their local knowledge of each ski area to predict how much snow is going to fall and where. This is super helpful and worth paying for if you are driving across Utah trying to decide which resort to hit next, or thinking about a last minute flight to Japan to catch the latest storm cycle.

In my view, unless Google's weather forecasts prove to be noticeably more accurate than existing models, particularly in predicting extreme weather events like atmospheric rivers, heat domes and bomb cyclones, it will be difficult to convince established companies and brands to switch. These organizations are already paying for high-quality weather data from trusted vendors they've relied on for years. At the same time, attracting startups may also be a challenge, as many are looking for free or extremely low cost API solutions.

Next: Part 2: Building a simple weather app with the Google Weather API