- HTTP request
- Query parameters
- Request body
- Response body
- Authorization scopes
- ForecastDay
- Date
- ForecastDayPart
- SunEvents
- MoonEvents
- MoonPhase
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 |
Required. The location to get the daily forecast for. |
units |
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). |
page |
Optional. The maximum number of daily forecast records to return per page - a value from 1 to 10 (inclusive). The default value is 5. |
page |
Optional. A page token received from a previous request. It is used to retrieve the subsequent page. |
days |
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. |
language |
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 ( |
Fields | |
---|---|
forecast |
The daily forecast records, according to the number of days and page size specified in the request. |
time |
The time zone at the requested location. |
next |
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 ( |
Fields | |
---|---|
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 |
display |
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. |
daytime |
The forecasted weather conditions for the daytime part of the day (7am to 7pm local time). |
nighttime |
The forecasted weather conditions for the nighttime part of the day (7pm to 7am next day, local time). |
max |
The maximum (high) temperature throughout the day. |
min |
The minimum (low) temperature throughout the day. |
feels |
The maximum (high) feels-like temperature throughout the day. |
feels |
The minimum (low) feels-like temperature throughout the day. |
max |
The maximum heat index temperature throughout the day. |
sun |
The events related to the sun (e.g. sunrise, sunset). |
moon |
The events related to the moon (e.g. moonrise, moonset). |
ice |
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:
google.type.TimeOfDay
google.type.DateTime
google.protobuf.Timestamp
JSON representation |
---|
{ "year": integer, "month": integer, "day": integer } |
Fields | |
---|---|
year |
Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. |
month |
Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. |
day |
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 ( |
Fields | |
---|---|
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 |
weather |
The forecasted weather condition. |
precipitation |
The forecasted precipitation. |
wind |
The average wind direction and maximum speed and gust. |
relative |
The forecasted percent of relative humidity (values from 0 to 100). |
uv |
The maximum forecasted ultraviolet (UV) index. |
thunderstorm |
The average thunderstorm probability. |
cloud |
Average cloud cover percent. |
SunEvents
Represents the events related to the sun (e.g. sunrise, sunset).
JSON representation |
---|
{ "sunriseTime": string, "sunsetTime": string } |
Fields | |
---|---|
sunrise |
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: |
sunset |
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: |
MoonEvents
Represents the events related to the moon (e.g. moonrise, moonset).
JSON representation |
---|
{
"moonriseTimes": [
string
],
"moonsetTimes": [
string
],
"moonPhase": enum ( |
Fields | |
---|---|
moonrise |
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: |
moonset |
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: |
moon |
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 🌒. |