In this article
Get Daily Forecast
This endpoint gets the daily forecast using the AccuWeather API.
URL
https://{{HOST}}/weather/accuweather/forecast/daily/{postalcode}
Method
GET
Required IMS Scopes
- weatherapi_all
URL Path Parameters
| Name | Description | Example | Type |
|---|---|---|---|
| postalCode required |
Postal code to search for | daily/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. | daily/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. | daily/532302?details=true | bool |
| metric optional |
Boolean value specifies whether or not to display metric values. Default value is false, if not provided | daily/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/daily/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"
]
},
"DailyForecast": {
"Headline": {
"EffectiveDate": "2018-04-27T14:00:00-05:00",
"EffectiveEpochDate": 1524855600,
"Severity": 5,
"Text": "Expect showers Friday afternoon",
"Category": "rain",
"EndDate": "2018-04-27T20:00:00-05:00",
"EndEpochDate": 1524877200,
"MobileLink": "http://m.accuweather.com/en/us/milwaukee-wi/53202/extended-weather-forecast/23138_pc?lang=en-us",
"Link": "http://www.accuweather.com/en/us/milwaukee-wi/53202/daily-weather-forecast/23138_pc?lang=en-us"
},
"DailyForecasts": [
{
"Date": "2018-04-25T07:00:00-05:00",
"EpochDate": 1524657600,
"Temperature": {
"Minimum": {
"Value": 35,
"Unit": "F",
"UnitType": 18
},
"Maximum": {
"Value": 50,
"Unit": "F",
"UnitType": 18
}
},
"Day": {
"Icon": 2,
"IconPhrase": "Mostly sunny"
},
"Night": {
"Icon": 33,
"IconPhrase": "Clear"
},
"Sources": [
"AccuWeather"
],
"MobileLink": "http://m.accuweather.com/en/us/milwaukee-wi/53202/daily-weather-forecast/23138_pc?day=1&lang=en-us",
"Link": "http://www.accuweather.com/en/us/milwaukee-wi/53202/daily-weather-forecast/23138_pc?day=1&lang=en-us"
}
]
}
}