In this article
Get Hourly Forecast
This endpoint gets the hourly forecast using the Accuweather API.
URL
https://{{HOST}}/weathera/AccuWeather/forecast/hourly/{postalcode}
Method
GET
Required IMS Scopes
- weatherapi_all
URL Path Parameters
| Name | Description | Example | Type |
|---|---|---|---|
| postalCode required |
Postal code to search for | hourly/53202 | string |
URL Query Parameters
| Name | Description | Example | Type |
|---|---|---|---|
| isoAlphaCode optional |
ISO Alpha 2 string value representing the country code for the supplied postal (see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for list of country codes). Default value is ‘US’, if not provided. | hourly/160%2000?isoAlphaCode=CZ | string |
| details optional |
Boolean value specifies whether or not to include full details in the response. Default value is false, if not provided. | hourly/532302?details=true | bool |
| metric optional |
Boolean value specifies whether or not to display metric values. Default value is false, if not provided | hourly/532302?metric=true | bool |
Request Header Parameters
| Type | Value | Description |
|---|---|---|
| Authorization | Bearer {access_token} required |
IMS access token |
Example
Request
curl -X GET
'https://{{HOST}}/weather/AccuWeather/forecast/hourly/53202'
-H 'Authorization: Bearer {{access_token}}'
Response
{
"Location": {
"Version": 1,
"Key": "23138_PC",
"Type": "PostalCode",
"Rank": 35,
"LocalizedName": "Milwaukee",
"EnglishName": "Milwaukee",
"PrimaryPostalCode": "53202",
"Region": {
"ID": "NAM",
"LocalizedName": "North America",
"EnglishName": "North America"
},
"Country": {
"ID": "US",
"LocalizedName": "United States",
"EnglishName": "United States"
},
"AdministrativeArea": {
"ID": "WI",
"LocalizedName": "Wisconsin",
"EnglishName": "Wisconsin",
"Level": 1,
"LocalizedType": "State",
"EnglishType": "State",
"CountryID": "US"
},
"TimeZone": {
"Code": "CDT",
"Name": "America/Chicago",
"GmtOffset": -5,
"IsDaylightSaving": true,
"NextOffsetChange": "2018-11-04T07:00:00Z"
},
"GeoPosition": {
"Latitude": 43.045,
"Longitude": -87.899,
"Elevation": {
"Metric": {
"Value": 188,
"Unit": "m",
"UnitType": 5
},
"Imperial": {
"Value": 616,
"Unit": "ft",
"UnitType": 0
}
}
},
"IsAlias": false,
"ParentCity": {
"Key": "351543",
"LocalizedName": "Milwaukee",
"EnglishName": "Milwaukee"
},
"SupplementalAdminAreas": [
{
"Level": 2,
"LocalizedName": "Milwaukee",
"EnglishName": "Milwaukee"
}
],
"DataSets": [
"Alerts",
"DailyAirQualityForecast",
"DailyPollenForecast",
"ForecastConfidence",
"MinuteCast"
]
},
"HourlyForecast": [
{
"DateTime": "2018-04-25T14:00:00-05:00",
"EpochDateTime": 1524682800,
"WeatherIcon": 2,
"IconPhrase": "Mostly sunny",
"IsDaylight": true,
"Temperature": {
"Value": 49,
"Unit": "F",
"UnitType": 18
},
"PrecipitationProbability": 0,
"MobileLink": "http://m.accuweather.com/en/us/milwaukee-wi/53202/hourly-weather-forecast/23138_pc?day=1&lang=en-us",
"Link": "http://www.accuweather.com/en/us/milwaukee-wi/53202/hourly-weather-forecast/23138_pc?day=1&hbhhour=14&lang=en-us"
}
]
}