Method: lookupWeather

Search for weather conditions at a location.

HTTP request

POST https://mapstools.googleapis.com/v1:lookupWeather

The URL uses gRPC Transcoding syntax.

Request body

The request body contains data with the following structure:

JSON representation
{
  "unitsSystem": enum (UnitsSystem),
  "location": {
    object (Location)
  },
  "capabilities": [
    enum (Capability)
  ],
  "date": {
    object (Date)
  },
  "hour": integer,
  "languageCode": string,
  "weatherOptions": {
    object (WeatherOptions)
  },
  "airQualityOptions": {
    object (AirQualityOptions)
  }
}
Fields
unitsSystem

enum (UnitsSystem)

Optional. The units system to use for the returned weather conditions. If not provided, the returned weather conditions will be in the metric system (default = METRIC).

location

object (Location)

Required. The location to get the weather conditions for.

capabilities[]

enum (Capability)

Optional. The environmental capabilities to include in the response.

date

object (Date)

Optional. Specifies the date of the requested environmental information, relative to the local timezone of the location specified in the location field. Supported date ranges depend on the requested capabilities: - WEATHER: up to 24 hours in the past (when hour is also set) and up to 10 days (240 hours) in the future (today through +9 days for daily forecasts). - AIR_QUALITY: up to 30 days (720 hours) in the past and up to 4 days (96 hours) in the future. - POLLEN: today through +4 days (up to 5 days including today; historical dates are not supported).

hour

integer

Optional. Specifies the hour of the requested environmental information, in 24-hour format (0-23), relative to the local timezone of the location specified in the location field. Requires date to be specified. Supported hourly ranges depend on the requested capabilities: - WEATHER: up to 24 hours in the past and up to 240 hours (10 days) in the future. - AIR_QUALITY: up to 30 days (720 hours) in the past and up to 4 days (96 hours) in the future. - POLLEN: returns daily forecasts only; hour is ignored for pollen.

languageCode

string

Optional. The BCP-47 language code for localized text in the response (e.g. "en", "ja", "fr-CA"). Defaults to "en" if not specified.

weatherOptions

object (WeatherOptions)

Optional. Options specific to weather requests. weatherOptions.units_system is supported in tandem with top-level unitsSystem (tag 4) to preserve backwards compatibility for existing callers; returns INVALID_ARGUMENT if both specify conflicting unit systems. Ignored if WEATHER is not requested in capabilities.

airQualityOptions

object (AirQualityOptions)

Optional. Options specific to air quality requests. Ignored if AIR_QUALITY is not requested in capabilities.

Response body

If successful, the response body contains an instance of LookupWeatherResponse.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/maps-platform.mapstools