Method: forecast.days.lookup

Returns up to 10 days of daily forecasts at a given location, starting from the current day.

HTTP request

GET https://weather.googleapis.com/v1/forecast/days:lookup

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
location

object (LatLng)

Required. The location to get the daily forecast for.

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).

pageSize

integer

Optional. The maximum number of daily forecast records to return per page - a value from 1 to 10 (inclusive). The default value is 5.

pageToken

string

Optional. A page token received from a previous request. It is used to retrieve the subsequent page.

days

integer

Optional. Limits the amount of total days to fetch starting from the current day - a value from 1 to 10 (inclusive). The default value is the maximum allowed value of 10.

languageCode

string

Optional. Allows the client to choose the language for the response. If data cannot be provided for that language, the API uses the closest match. Allowed values rely on the IETF BCP-47 standard. The default value is "en".

Request body

The request body must be empty.

Response body

Response for the days.lookup RPC.

If successful, the response body contains data with the following structure:

JSON representation
{
  "forecastDays": [
    {
      object (ForecastDay)
    }
  ],
  "timeZone": {
    object (TimeZone)
  },
  "nextPageToken": string
}
Fields
forecastDays[]

object (ForecastDay)

The daily forecast records, according to the number of days and page size specified in the request.

timeZone

object (TimeZone)

The time zone at the requested location.

nextPageToken

string

The token to retrieve the next page.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

ForecastDay

Represents a daily forecast record at a given location.

JSON representation
{
  "interval": {
    object (Interval)
  },
  "displayDate": {
    object (Date)
  },
  "daytimeForecast": {
    object (ForecastDayPart)
  },
  "nighttimeForecast": {
    object (ForecastDayPart)
  },
  "maxTemperature": {
    object (Temperature)
  },
  "minTemperature": {
    object (Temperature)
  },
  "feelsLikeMaxTemperature": {
    object (Temperature)
  },
  "feelsLikeMinTemperature": {
    object (Temperature)
  },
  "maxHeatIndex": {
    object (Temperature)
  },
  "sunEvents": {
    object (SunEvents)
  },
  "moonEvents": {
    object (MoonEvents)
  },
  "iceThickness": {
    object (IceThickness)
  }
}
Fields
interval

object (Interval)

The UTC time interval when this forecasted day is starts (inclusive) and ends (exclusive). Note: a day starts at 7am and ends at 7am next day, local time. For example: If the local time zone is UTC-7, then the interval will start at the time 14:00:00.000Z and end at the same hour the next day.

displayDate

object (Date)

The local date in the time zone of the location (civil time) which this daily forecast is calculated for. This field may be used for display purposes on the client.

daytimeForecast

object (ForecastDayPart)

The forecasted weather conditions for the daytime part of the day (7am to 7pm local time).

nighttimeForecast

object (ForecastDayPart)

The forecasted weather conditions for the nighttime part of the day (7pm to 7am next day, local time).

maxTemperature

object (Temperature)

The maximum (high) temperature throughout the day.

minTemperature

object (Temperature)

The minimum (low) temperature throughout the day.

feelsLikeMaxTemperature

object (Temperature)

The maximum (high) feels-like temperature throughout the day.

feelsLikeMinTemperature

object (Temperature)

The minimum (low) feels-like temperature throughout the day.

maxHeatIndex

object (Temperature)

The maximum heat index temperature throughout the day.

sunEvents

object (SunEvents)

The events related to the sun (e.g. sunrise, sunset).

moonEvents

object (MoonEvents)

The events related to the moon (e.g. moonrise, moonset).

iceThickness

object (IceThickness)

The accumulated amount of ice throughout entire the day.

Date

Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following:

  • A full date, with non-zero year, month, and day values.
  • A month and day, with a zero year (for example, an anniversary).
  • A year on its own, with a zero month and a zero day.
  • A year and month, with a zero day (for example, a credit card expiration date).

Related types:

JSON representation
{
  "year": integer,
  "month": integer,
  "day": integer
}
Fields
year

integer

Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

month

integer

Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

day

integer

Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

ForecastDayPart

Represents a forecast record for a part of the day.

JSON representation
{
  "interval": {
    object (Interval)
  },
  "weatherCondition": {
    object (WeatherCondition)
  },
  "precipitation": {
    object (Precipitation)
  },
  "wind": {
    object (Wind)
  },
  "relativeHumidity": integer,
  "uvIndex": integer,
  "thunderstormProbability": integer,
  "cloudCover": integer
}
Fields
interval

object (Interval)

The UTC date and time when this part of the day starts (inclusive) and ends (exclusive). Note: a part of a day starts at 7am and ends at 7pm the same day, local time. For example: If the local time zone is UTC-7, then the daytime interval will start at the time 14:00:00.000Z and end at 02:00:00.000Z the next day and the nighttime interval will start at 02:00:00.000Z the next day and end at 14:00:00.000Z that same day.

weatherCondition

object (WeatherCondition)

The forecasted weather condition.

precipitation

object (Precipitation)

The forecasted precipitation.

wind

object (Wind)

The average wind direction and maximum speed and gust.

relativeHumidity

integer

The forecasted percent of relative humidity (values from 0 to 100).

uvIndex

integer

The maximum forecasted ultraviolet (UV) index.

thunderstormProbability

integer

The average thunderstorm probability.

cloudCover

integer

Average cloud cover percent.

SunEvents

Represents the events related to the sun (e.g. sunrise, sunset).

JSON representation
{
  "sunriseTime": string,
  "sunsetTime": string
}
Fields
sunriseTime

string (Timestamp format)

The time when the sun rises.

NOTE: In some unique cases (e.g. north of the artic circle) there may be no sunrise time for a day. In these cases, this field will be unset.

Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

sunsetTime

string (Timestamp format)

The time when the sun sets.

NOTE: In some unique cases (e.g. north of the artic circle) there may be no sunset time for a day. In these cases, this field will be unset.

Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

MoonEvents

Represents the events related to the moon (e.g. moonrise, moonset).

JSON representation
{
  "moonriseTimes": [
    string
  ],
  "moonsetTimes": [
    string
  ],
  "moonPhase": enum (MoonPhase)
}
Fields
moonriseTimes[]

string (Timestamp format)

The time when the upper limb of the moon appears above the horizon (see https://en.wikipedia.org/wiki/Moonrise_and_moonset).

NOTE: For most cases, there'll be a single moon rise time per day. In other cases, the list might be empty (e.g. when the moon rises after next day midnight). However, in unique cases (e.g. in polar regions), the list may contain more than one value. In these cases, the values are sorted in ascending order.

Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

moonsetTimes[]

string (Timestamp format)

The time when the upper limb of the moon disappears below the horizon (see https://en.wikipedia.org/wiki/Moonrise_and_moonset).

NOTE: For most cases, there'll be a single moon set time per day. In other cases, the list might be empty (e.g. when the moon sets after next day midnight). However, in unique cases (e.g. in polar regions), the list may contain more than one value. In these cases, the values are sorted in ascending order.

Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

moonPhase

enum (MoonPhase)

The moon phase (a.k.a. lunar phase).

MoonPhase

Marks the moon phase (a.k.a. lunar phase).

Enums
MOON_PHASE_UNSPECIFIED Unspecified moon phase.
NEW_MOON The moon is not illuminated by the sun.
WAXING_CRESCENT The moon is lit by 0%-50% on its right side in the northern hemisphere 🌒 and on its left side in the southern hemisphere 🌘.
FIRST_QUARTER The moon is lit by 50.1% on its right side in the northern hemisphere 🌓 and on its left side in the southern hemisphere 🌗.
WAXING_GIBBOUS The moon is lit by 50%-100% on its right side in the northern hemisphere 🌔 and on its left side in the southern hemisphere 🌖.
FULL_MOON The moon is fully illuminated.
WANING_GIBBOUS The moon is lit by 50%-100% on its left side in the northern hemisphere 🌖 and on its right side in the southern hemisphere 🌔.
LAST_QUARTER The moon is lit by 50.1% on its left side in the northern hemisphere 🌗 and on its right side in the southern hemisphere 🌓.
WANING_CRESCENT The moon is lit by 0%-50% on its left side in the northern hemisphere 🌘 and on its right side in the southern hemisphere 🌒.