2 Day Hourly Forecast (48 hour)

Overview

  • Domain Portfolio: Forecast
  • Domain: Forecasts
  • Usage Classification: Standard
  • Geography: Global
  • Attribution Required: NO
  • Attribution Requirements: N/A

The Hourly Forecast API is sourced from the The Weather Company® (TWC®) Forecast system. This TWC API returns weather forecasts starting with the current day. Your content licensing agreement with TWC determines the number of days returned in the API response and is constrained by the API Key that is provided to your company. Please refer to the Data Elements section later in this document for more details.

Note: All wind values are calculated based on wind status 10 meters above ground.

HTTP Headers and Data Lifetime - Caching and Expiration

For details on appropriate header values as well as caching and expiration definitions, please see The Weather Company Data | API Common Usage Guide.

NOTE: Subscribers to the TWC Core Package receive access to the 2 Day Hourly Forecast. Subscribers to the TWC Enhanced Forecast Package receive access to the 15 Day Hourly Forecast

Your content licensing agreement determines the specific endpoint authorized by the API Key entitlements that is provided to your company.

Each time segment duration (2, 15 day) is an atomic API endpoint. Your API key must be authorized for each atomic API endpoint to successfully request a given API endpoint.

  • For example if your API key is authorized for only the 2 Day, and you attempt to request a 15 Day duration, you will get an error stating: ”Access Denied”.

Translated Fields:

This TWC API handles the translation of phrases for values of the following data. However, when formatting a request URL a valid language must be passed along (see the language code table for the supported codes).
  • dayOfWeek
  • windDirectionCardinal
  • wxPhraseLong
IBM® Passport Advantage® Package Atomic Endpoints Aggregate Product Name
Weather Company Data - Core v3/wx/forecast/hourly/2day v3-wx-forecast-hourly-2day
Weather Company Data - Enhanced Forecast v3/wx/forecast/hourly/15day v3-wx-forecast-hourly-15day

URL Construction

Request by Geocode: Required Parameters: geocode, units, language, format, apiKey

https://api.weather.com/v3/wx/forecast/hourly/2day?geocode=33.74,-84.39&format=json&units=e&language=en-US&apiKey=yourApiKey

https://api.weather.com/v3/wx/forecast/hourly/15day?geocode=33.74,-84.39&format=json&units=e&language=en-US&apiKey=yourApiKey

Request by IATA Code: Required Parameters: iataCode, units, language, format, apiKey

https://api.weather.com/v3/wx/forecast/hourly/2day?iataCode=DEN&units=e&language=en-US&format=json&apiKey=yourApiKey

https://api.weather.com/v3/wx/forecast/hourly/15day?iataCode=DEN&units=e&language=en-US&format=json&apiKey=yourApiKey

Request by ICAO Code: Required Parameters: icaoCode, units, language, format, apiKey

https://api.weather.com/v3/wx/forecast/hourly/2day?icaoCode=KDEN&units=e&language=en-US&format=json&apiKey=yourApiKey

https://api.weather.com/v3/wx/forecast/hourly/15day?icaoCode=KDEN&units=e&language=en-US&format=json&apiKey=yourApiKey

Request by Place ID: Required Parameters: placeid, units, language, format, apiKey

https://api.weather.com/v3/wx/forecast/hourly/2day?placeid=327145917e06d09373dd2760425a88622a62d248fd97550eb4883737d8d1173b&units=e&language=en-US&format=json&apiKey=yourApiKey

https://api.weather.com/v3/wx/forecast/hourly/15day?placeid=327145917e06d09373dd2760425a88622a62d248fd97550eb4883737d8d1173b&units=e&language=en-US&format=json&apiKey=yourApiKey

Request by Postal Key: Required Parameters: postalKey, units, language, format, apiKey

https://api.weather.com/v3/wx/forecast/hourly/2day?postalKey=81657:US&units=e&language=en-US&format=json&apiKey=yourApiKey

https://api.weather.com/v3/wx/forecast/hourly/15day?postalKey=81657:US&units=e&language=en-US&format=json&apiKey=yourApiKey

 

Data Elements & Definitions

Note: Field names are sorted alphabetically in the table below for presentation purposes. The table below does not represent the sort order of the API response.

Field Name Description Type Range Sample Nulls Allowed
cloudCover Hourly average cloud cover expressed as a percentage. [integer] 0 to 100 82 N
dayOfWeek Day of week [string] Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday Thursday N
dayOrNight

This data field indicates whether it is daytime or nighttime based on the Local Apparent Time of the location.

D = Day, N = Night, X = missing (for extreme northern and southern hemisphere

[string] D, N, X D N
expirationTimeUtc Expiration time in UNIX seconds [epoch] 1369252800   N
iconCode This number is the key to the weather icon lookup. The data field shows the icon number that is matched to represent the observed weather conditions. [integer] 26   N
iconCodeExtend Code representing full set sensible weather [integer] 3200   N
precipChance Hourly maximum probability of precipitation [integer] 0 to 100 20 N
precipType The short text describing the expected type accumulation associated with the precipChance parameter. [string] rain,snow, precip (‘precip’ = “Any type of precipitation”) rain N
pressureMeanSeaLevel Hourly mean sea level pressure [decimal] 30.21   N
qpf

The forecasted measurable precipitation (liquid or liquid equivalent) for the upcoming hour. For example, if the local time is 8:35 am, the returned value would represent the timeframe of 9:00 am to 10:00 am.

Units - Expressed in inches when units=e, expressed in millimeters when units=m

[decimal] 0.06   N
qpfSnow

The forecasted hourly snow accumulation for the upcoming hour. For example, if the local time is 8:35 am, the returned value would represent the timeframe of 9:00 am to 10:00 am.

Units - Expressed in inches when units=e, expressed in centimeters when units=m

[decimal] 0.0   N
relativeHumidity The relative humidity of the air, which is defined as the ratio of the amount of water vapor in the air to the amount of vapor required to bring the air to saturation at a constant temperature. Relative humidity is always expressed as a percentage. [integer] 0 to 100 83 N
temperature The temperature of the air, measured by a thermometer 1.5 meters (4.5 feet) above the ground that is shaded from the other elements. You will receive this data field in Fahrenheit degrees or Celsius degrees. [integer] -140 to 140 (F) 68 N
temperatureDewPoint The temperature to which air must be cooled at constant pressure to reach saturation. The Dew Point is also an indirect measure of the humidity of the air. The Dew Point will never exceed the Temperature. When the Dewpoint and Temperature are equal, clouds or fog will typically form. The closer the values of Temperature and Dew Point, the higher the relative humidity. [integer]

-80 to 100 (°F) or

-62 to 37 (°C)

60 N
temperatureFeelsLike

An apparent temperature. It represents what the air temperature “feels like” on exposed human skin due to the combined effect of the wind chill or heat index.

When the temperature is 65°F or higher, the Feels Like value represents the computed Heat Index. When the temperature is below 65°F, Feels Like value represents the computed Wind Chill.

Units - Expressed in fahrenheit when units=e, expressed in celsius when units=m, s, or h.

Range: -140 to 140

[integer] 84   Y
temperatureHeatIndex

An apparent temperature. It represents what the air temperature “feels like” on exposed human skin due to the combined effect of warm temperatures and high humidity.

Below 65°F, it is set = to the temperature.

Units - Expressed in fahrenheit when units=e, expressed in celsius when units=m, s, or h.

[integer] 84   N
temperatureWindChill

An apparent temperature. It represents what the air temperature “feels like” on exposed human skin due to the combined effect of the cold temperatures and wind speed.

Above 65°F, it is set = to the temperature.

Units - Expressed in fahrenheit when units=e, expressed in celsius when units=m, s, or h.

[integer] 68   N
uvDescription

The UV Index Description which complements the UV Index value by providing an associated level of risk of skin damage due to exposure.

-2 = Not Available, -1 = No Report, 0 to 2 = Low, 3 to 5 = Moderate, 6 to 7 = High, 8 to 10 = Very High, 11 to 16 = Extreme

[string] Not Available, No Report, Low, Moderate, High, Very High, Extreme Low N
uvIndex Hourly maximum UV index [integer] -2 to 16 2 N
validTimeLocal Time forecast is valid in local apparent time. [ISO] YYYY-MM-DDTHH:MM:SS-NNNN; NNNN=GMT offset 2014-08-20T10:47:59-0500 N
validTimeUtc Time forecast is valid in UNIX seconds [epoch] 1369306800   N
visibility The horizontal visibility at the observation point. Visibilities can be reported as fractional values particularly when visibility is less than 2 miles. You can also find visibility values that equal zero. This occurrence is not wrong. Dense fog and heavy snows can produce values near zero. Fog, smoke, heavy rain and other weather phenomena can reduce visibility to near zero miles or kilometers. [decimal]

0 to 10;

For less than 1 = 2 (Metric) & 2 (Imperial) decimal places.

5.22 N
windDirection Hourly average wind direction in magnetic notation. [integer] 0 to 359 145 N
windDirectionCardinal Hourly average wind direction in cardinal notation. [string] N , NNE , NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW SE N
windGust The maximum expected wind gust speed. [integer] 7   Y
windSpeed

The forecast of the sustained wind speed at the top of the hour.

The wind is treated as a vector; hence, winds must have direction and magnitude (speed). The wind information reported in the hourly current conditions corresponds to a 10-minute average called the sustained wind speed. Sudden or brief variations in the wind speed are known as “wind gusts” and are reported in a separate data field. Wind directions are always expressed as "from whence the wind blows" meaning that a North wind blows from North to South. If you face North in a North wind the wind is at your face. Face southward and the North wind is at your back.

[integer] 5   N
wxPhraseLong

Hourly sensible weather phrase up to 32 characters.

Note: The character limit applies to English phrases only. For other languages this phrase may exceed 32 characters.

[string] Fog Late N N
wxPhraseShort Hourly sensible weather phrase up to 12 characters. [string] Cloudy   Y
wxSeverity A number denoting how impactful is the forecasted weather for this hour. Can be used to determine the graphical treatment of the weather display such as using red font on weather.com. [integer]

1 = no threat

6 = dangerous / life threatening

2 N

JSON Sample

// Response Collapsed for Presentation Purposes

{
   "v3-wx-forecast-hourly-2day": {
     "cloudCover": [30,45],
     "dayOfWeek": ["Saturday","Saturday"]
     "dayOrNight": ["D","D"],
     “temperatureDewPoint”: [60,100],
     "expirationTimeUtc": [1474132031,1474132031],
     "iconCode": [30,30],
     "iconCodeExtend": [3000,3000],
     "precipChance": [0,0],
     "precipType": ["rain","rain" ],
     "pressureMeanSeaLevel": [30.1,30.07 ],
     "qpf": [0,0 ],
     "qpfSnow": [0,0 ],
     "relativeHumidity": [56,50 ],
     "temperature": [84,86 ],
     "temperatureFeelsLike": [87,89 ],
     "temperatureHeatIndex": [87,89 ],
     "temperatureWindChill": [84,86 ],
     "uvDescription": ["Very High","Very High" ],
     "uvIndex": [8,8 ],
     "validTimeLocal": ["2016-09-17T13:00:00-0400","2016-09-17T14:00:00-0400" ],
     "validTimeUtc": [1474131600,1474135200 ],
     "visibility": [10,10 ],
     "windDirection": [129,137 ],
     "windDirectionCardinal": ["SE","SE" ],
     "windGust": [null,null ],
     "windSpeed": [8,7 ],
     "wxPhraseLong": ["Partly Cloudy","Partly Cloudy" ],
     "wxPhraseShort": ["P Cloudy","P Cloudy" ],
     "wxSeverity": [1,1 ]
    }
  }