How to make a weather observation request
This section provides an example of a weather observation 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 the current weather conditions for Berlin-Tegel, Germany.
Request summary
| Resource | report |
|---|---|
Parameters products: Indicates what kind of report the query requests; in this example, the query uses the parameter value observation to request a report on the current weather conditions at the eight closest reporting points to the specified location. q: Indicates the location name for which the query requests a weather report. |
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=observation
&q=Berlin-Tegel
-H "Authorization: Bearer {YOUR_TOKEN}"Response
The response to the request contains:
- A series of locations with observation information.
- Weather report information for each location.
The example response in JSON format is as follows:
{
"places": [
{
"observations": [
{
"place": {
"address": {
"countryCode": "DEU",
"countryName": "Germany",
"state": "Berlin",
"city": "Tegel"
},
"location": {
"lat": 52.57601,
"lng": 13.29389
},
"distance": 0
},
"daylight": "day",
"description": "Scattered clouds. Mild.",
"skyInfo": 9,
"skyDesc": "Scattered clouds",
"temperature": 19,
"temperatureDesc": "Mild",
"comfort": "19.00",
"highTemperature": "19.10",
"lowTemperature": "10.80",
"humidity": "46",
"dewPoint": 7,
"precipitationProbability": 60,
"rainFall": 0.19,
"windSpeed": 14.83,
"windDirection": 280,
"windDesc": "West",
"windDescShort": "W",
"uvIndex": 3,
"uvDesc": "Low",
"barometerPressure": 1006.1,
"barometerTrend": "Steady",
"iconId": 2,
"iconName": "mostly_sunny",
"iconLink": "https://us-east-1-weather-v3.api-gateway.ls.hereapi.com/static/weather/icon/2.png",
"ageMinutes": 18,
"activeAlerts": 0,
"time": "2024-06-10T12:20:00+02:00"
}
]
}
]
}For more details about responses to this type of request, see Report response For more information, see Weather report.
Updated 11 days ago