How to request a seven day weather forecast
This section provides an example of a seven day weather forecast request in the HERE Destination Weather API.
Note
This example uses a HERE token to authenticate your request. For the available authentication options, see the Identity and Access Management Developer Guide.
User story
The user wants to obtain a daily weather forecast for seven days for Chicago, Illinois, USA.
Request summary
| Resource | report |
|---|---|
Parameters products: Indicates what kind of report the query requests; in this example, the query uses the parameter value forecast7daysSimple to request a daily forecast for the next seven days. location: Latitude and longitude for which the query requests a weather forecast. |
Request
The following code block demonstrates the complete request, specifying that the response data is to be delivered in JSON.
curl https://weather.hereapi.com/v3/report
?products=forecast7daysSimple
&location=41.83,-87.68
-H "Authorization: Bearer {YOUR_TOKEN}"Response
The response to the request contains:
- daily forecasts for Chicago, Illinois
The example response in JSON format is as follows:
{
"places": [
{
"dailyForecasts": [
{
"place": {
"address": {
"countryCode": "USA",
"countryName": "United States",
"state": "Illinois",
"city": "Ducktown"
},
"location": {
"lat": 41.83142,
"lng": -87.67505
},
"distance": 0.44
},
"forecasts": [
{
"daylight": "day",
"description": "Increasing cloudiness. Mild.",
"skyInfo": 26,
"skyDesc": "Increasing cloudiness",
"temperatureDesc": "Mild",
"comfort": "25.00",
"highTemperature": "24.00",
"lowTemperature": "10.50",
"humidity": "35",
"dewPoint": 7.16,
"precipitationProbability": 2,
"airInfo": 29,
"airDesc": "Comfortable",
"windSpeed": 6.41,
"windDirection": 220,
"windDesc": "Southwest",
"windDescShort": "SW",
"beaufortScale": 1,
"beaufortDesc": "Light air",
"uvIndex": 3,
"uvDesc": "Low",
"barometerPressure": 1014.4,
"iconId": 4,
"iconName": "partly_cloudy",
"iconLink": "https://weather-dev.api-gateway.sit.ls.hereapi.com/static/weather/icon/3.png",
"weekday": "tu",
"time": "2024-06-11T00:00:00-05:00"
},
{
"daylight": "day",
"description": "Showers early. Partly cloudy. Warm.",
"skyInfo": 10,
"skyDesc": "Partly cloudy",
"temperatureDesc": "Warm",
"comfort": "29.70",
"highTemperature": "30.20",
"lowTemperature": "17.40",
"humidity": "42",
"dewPoint": 15.51,
"precipitationProbability": 21,
"precipitationDesc": "Showers early",
"rainFall": 0.02,
"windSpeed": 17.58,
"windDirection": 230,
"windDesc": "Southwest",
"windDescShort": "SW",
"beaufortScale": 3,
"beaufortDesc": "Gentle breeze",
"uvIndex": 7,
"uvDesc": "High",
"barometerPressure": 1012.37,
"iconId": 33,
"iconName": "showers",
"iconLink": "https://weather-dev.api-gateway.sit.ls.hereapi.com/static/weather/icon/27.png",
"weekday": "we",
"time": "2024-06-12T00:00:00-05:00"
},
{
"daylight": "day",
"description": "Thunderstorms. Cloudy. Warm.",
"skyInfo": 17,
"skyDesc": "Cloudy",
"temperatureDesc": "Warm",
"comfort": "30.00",
"highTemperature": "29.60",
"lowTemperature": "20.20",
"humidity": "52",
"dewPoint": 18.25,
"precipitationProbability": 84,
"precipitationDesc": "Thunderstorms",
"rainFall": 1.25,
"windSpeed": 10.75,
"windDirection": 270,
"windDesc": "West",
"windDescShort": "W",
"beaufortScale": 2,
"beaufortDesc": "Light breeze",
"uvIndex": 5,
"uvDesc": "Moderate",
"barometerPressure": 1010.55,
"iconId": 22,
"iconName": "tstorms",
"iconLink": "https://weather-dev.api-gateway.sit.ls.hereapi.com/static/weather/icon/7.png",
"weekday": "th",
"time": "2024-06-13T00:00:00-05:00"
},
{
"daylight": "day",
"description": "Scattered clouds. Cool.",
"skyInfo": 9,
"skyDesc": "Scattered clouds",
"temperatureDesc": "Cool",
"comfort": "21.00",
"highTemperature": "21.60",
"lowTemperature": "16.60",
"humidity": "53",
"dewPoint": 11.06,
"precipitationProbability": 72,
"rainFall": 0.59,
"windSpeed": 16.5,
"windDirection": 40,
"windDesc": "Northeast",
"windDescShort": "NE",
"beaufortScale": 3,
"beaufortDesc": "Gentle breeze",
"uvIndex": 7,
"uvDesc": "High",
"barometerPressure": 1015.69,
"iconId": 2,
"iconName": "mostly_sunny",
"iconLink": "https://weather-dev.api-gateway.sit.ls.hereapi.com/static/weather/icon/2.png",
"weekday": "fr",
"time": "2024-06-14T00:00:00-05:00"
},
{
"daylight": "day",
"description": "Overcast. Mild.",
"skyInfo": 18,
"skyDesc": "Overcast",
"temperatureDesc": "Mild",
"comfort": "25.40",
"highTemperature": "24.60",
"lowTemperature": "15.80",
"humidity": "46",
"dewPoint": 11.67,
"precipitationProbability": 0,
"airInfo": 29,
"airDesc": "Comfortable",
"windSpeed": 12.18,
"windDirection": 90,
"windDesc": "East",
"windDescShort": "E",
"beaufortScale": 3,
"beaufortDesc": "Gentle breeze",
"uvIndex": 3,
"uvDesc": "Low",
"barometerPressure": 1015.64,
"iconId": 7,
"iconName": "cloudy",
"iconLink": "https://weather-dev.api-gateway.sit.ls.hereapi.com/static/weather/icon/17.png",
"weekday": "sa",
"time": "2024-06-15T00:00:00-05:00"
},
{
"daylight": "day",
"description": "Showers early. Broken clouds. Warm.",
"skyInfo": 15,
"skyDesc": "Broken clouds",
"temperatureDesc": "Warm",
"comfort": "34.70",
"highTemperature": "33.40",
"lowTemperature": "19.00",
"humidity": "47",
"dewPoint": 19.83,
"precipitationProbability": 22,
"precipitationDesc": "Showers early",
"rainFall": 0.09,
"windSpeed": 21.97,
"windDirection": 210,
"windDesc": "Southwest",
"windDescShort": "SW",
"beaufortScale": 4,
"beaufortDesc": "Moderate breeze",
"uvIndex": 7,
"uvDesc": "High",
"barometerPressure": 1009.94,
"iconId": 33,
"iconName": "showers",
"iconLink": "https://weather-dev.api-gateway.sit.ls.hereapi.com/static/weather/icon/27.png",
"weekday": "su",
"time": "2024-06-16T00:00:00-05:00"
},
{
"daylight": "day",
"description": "Showers early. Broken clouds. Warm.",
"skyInfo": 15,
"skyDesc": "Broken clouds",
"temperatureDesc": "Warm",
"comfort": "34.80",
"highTemperature": "33.10",
"lowTemperature": "25.00",
"humidity": "48",
"dewPoint": 20.08,
"precipitationProbability": 17,
"precipitationDesc": "Showers early",
"rainFall": 0.01,
"windSpeed": 20.2,
"windDirection": 220,
"windDesc": "Southwest",
"windDescShort": "SW",
"beaufortScale": 4,
"beaufortDesc": "Moderate breeze",
"uvIndex": 7,
"uvDesc": "High",
"barometerPressure": 1011.16,
"iconId": 33,
"iconName": "showers",
"iconLink": "https://weather-dev.api-gateway.sit.ls.hereapi.com/static/weather/icon/27.png",
"weekday": "mo",
"time": "2024-06-17T00:00:00-05:00"
}
]
}
]
}
]
}For more details about responses to this type of request, see Report response For more information, see Weather report.
Updated 11 days ago