Probabilistic Hourly Forecast

The Probabilistic Forecast API provides a variety of statistical forecast content by generating it on-the-fly using proprietary technology from The Weather Company® An IBM® Business (TWC®). This API provides a discretized PDF, and/or probability integrations over specified parameter value ranges, generalized percentile value extractions, and/or prototypes for supported physical quantities, and limited functional expressions. Hourly forecast data starts at the beginning of the current hour, at time of call, and can extend from 24 to 360 hours with a default of 240 hours. Hourly temperature distributions are further enhanced using a BMA calibration method. Calibration is not available for min(), max(), or sum() aggregations of hourly temperatures or other parameters.

Overview

  • Domain Portfolio: Forecast
  • Domain: Hourly - Probabilistic
  • Usage Classification: Limited Availability
  • Geography: Global
  • Attribution Required: No
  • Attribution Requirements: N/A

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:

Due to throttling, there are limitations to the use of this API. The following errors may be returned. If an API call results in one or more of these errors, it is recommended that several minutes be allowed to pass before re-attempting the call:

  1. Error 401 - Request rates exceeded
  2. Error 403 - Request rates exceeded
  3. Error 509 - Bandwidth limit exceeded
Atomic API URL Examples:
Request by Geocode: Required Parameters:geocode, units, format, apiKey and one or more of discretePdfs, percentiles, probabilities, or prototypes| Optional Parameters:elevation, hours, landuse

https://api.weather.com/v3/wx/forecast/probabilistic?geocode=34.26,-118.42&elevation=2000&landuse=1&format=json&units=e&discretePdfs=temperature:coarse&apiKey=yourApiKey

https://api.weather.com/v3/wx/forecast/probabilistic?geocode=43.37,-71.03&elevation=140&landuse=1&format=json&units=m&prototypes=windSpeed:2&discretePdfs=windGust:coarse&percentiles=visibility:10:50:90;ceiling:10:50:90&probabilities=qpf:0.1,inf&apiKey=yourApiKey

Request by IATA Code: Required Parameters:iataCode, units, format, apiKey and one or more of discretePdfs, percentiles, probabilities, or prototypes| Optional Parameters:elevation, hours, landuse
https://api.weather.com/v3/wx/forecast/probabilistic?iataCode=DEN&elevation=2000&landuse=1&format=json&units=e&discretePdfs=temperature:coarse&apiKey=yourApiKey
Request by ICAO Code: Required Parameters:icaoCode, units, format, apiKey and one or more of discretePdfs, percentiles, probabilities, or prototypes| Optional Parameters:elevation, hours, landuse
https://api.weather.com/v3/wx/forecast/probabilistic?icaoCode=KDEN&elevation=2000&landuse=1&format=json&units=e&discretePdfs=temperature:coarse&apiKey=yourApiKey
Request by Place ID: Required Parameters:placeid, units, format, apiKey and one or more of discretePdfs, percentiles, probabilities, or prototypes| Optional Parameters:elevation, hours, landuse
https://api.weather.com/v3/wx/forecast/probabilistic?placeid=ee0214ae7fb1d265f3e4d2509e77557119b2cac9d0ac1013b593c74a1567f2b7&elevation=2000&landuse=1&format=json&units=e&discretePdfs=temperature:coarse&apiKey=yourApiKey
Request by Postal Key: Required Parameters:postalKey, units, format, apiKey and one or more of discretePdfs, percentiles, probabilities, or prototypes| Optional Parameters:elevation, hours, landuse
https://api.weather.com/v3/wx/forecast/probabilistic?postalKey=81657:US&elevation=2000&landuse=1&format=json&units=e&discretePdfs=temperature:coarse&apiKey=yourApiKey

Valid Parameter Definitions

Parameter Name Valid Parameter Value Description
discretePdfs min(temperature,temporal,25):0.5;sum(qpf,temporal,24):1.0, ceiling (minimum bin width 50 feet or 25 meters, see table below for further details), visibility (minimum bin width .06 miles or .1 kilometers, see table below for further details), windGust (minimum bin width .25 miles per hour or .1 meters per second, see table below for further details) The full, discrete PDF (Probability Distribution Function) of a temporal minimum and a summation.
hours Integer 24 - 360 Optional range of hours that can be queried. Without this optional parameter a default of 240 hours is queried.
percentiles sum(sfa,temporal,6):1:5:10:25:33:50:66:75:90:95:99, ceiling (minimum bin width 50 feet or 25 meters, see table below for further details), visibility (minimum bin width .06 miles or .1 kilometers, see table below for further details), windGust (minimum bin width .25 miles per hour or .1 meters per second, see table below for further details) Percentiles of the distribution for accumulated snowfall over 6 hours periods.
probabilities sum(qpf,temporal,24):0,;min(temperature,temporal,25):,0, ceiling (see table below for details), visibility (see table below for details), windGust (see table below for details) Probabilities of the sum of precipitation over the next 24 hours and subzero temperatures, over a full day.
prototypes parameter:90, where parameter is one of ceiling, temperature, qpf, temperatureDewPoint, relativeHumidity, visibility, windGust, windSpeed, windDirection, or qpfSnow Requested number (90) full duration, one hour forecasts for the temporal max, min, or sum of a parameter(s).
elevation

Optional parameter, value interpretation is dependent on the ‘units’ parameter.

  • Range (Imperial): English units range from -1,500 feet to 60,000 feet, inclusive.
  • Range (Metric): Metric units range from -500 meters to 20,000 meters, inclusive.
..v3/<product>?elevation=800
landuse Optional parameter. Can be provided where SEA=0 and LAND=1.

..v3/<product>?landuse=0

..v2/<product>?landuse=1

Note: This API allows for a maximum of 21 products to be requested from the set of parameters detailed above.

Parameter: discretePdfs

The full, discrete PDF (Probability Distribution Function). Describes the likelihood of the full set of possible outcomes at user-defined discretization. Defined in statistical terms, the PDF is a function that describes the relative likelihood of a random variable to take on a value in any of a set of distinct possible outcomes. In the context of the Probabilistic Forecast the “random variable” is the parameter we’re requesting a forecast for (e.g. temperature or qpf), and from a product standpoint the PDF output would answer the question of “what percentage of the ensemble member forecasts of the requested variable (e.g. temperature, qpf, etc) fall within a certain output range or bin for that variable”.

For instance, if a request was made for the PDF of qpf with the input arguments of [.01, .05, .25], it would be asking for the (approximate) percentage of the ensemble member forecasts that fall in the range -infinity to .01, .01 to .05, .05 to .25 and .25 to +infinity. The values (percentages) returned by the Probabilistic API always sum to 100 as the PDF encompasses all possible forecast outcomes from the ensemble.

There are two ways to specify the discretization of the output PDF. All have a similar foundation of a semicolon separated list of parameters, for which to return the discrete PDF. Further decoration of the parameter name implicitly selects the method by which the PDF is discretized:

  1. Decorating with a single decimal facilitates the specification of a constant bin width, in parameter appropriate units, consistent with units specified in the request. Number of bins and sequence of bin sizes are chosen appropriately based on the parameter range and specified bin size. There is no default bin size.
    • Format: param0:binSize0; param1:binSize1
    • Example: ...<product>?discretePdfs=temperature:0.5;qpf:0.5
  1. Decorating with 2 or more colon separated decimal values or 1 or more triplets defined below, facilitates specification of each bin edge explicitly. The edge values must be provided in the units specified in the request. A triplet is in the form of lowerBound, increment, upperBound where the elements of the triplet are separated by a comma. The sequence of edge specifications is piecewise continuous.
    • Format: param0:e0:e1:…en; param1: e0:e1:…em
    • Example: ...<product>?discretePdfs=temperature:22.0:23.0:24.0.;qpf:0.01:0.5:1.0:4.0
  1. Decorating with “fine”, “medium” or “coarse” facilitates specification of predefined bin ranges, which range from narrow (fine) to wide (coarse) in precision. The bin ranges are provided below. In the case of temperature, number of bins and sequence of bin sizes are chosen appropriately based on the parameter range and specified bin size.The predefined bin ranges are translated into purely numeric bin ranges as described in #1 and #2 in this section using the discretePdfs predefined bin ranges.
  • Format: param0:predefined0; param1:predefined1
  • Example: ...<product>?discretePdfs=temperature:coarse;qpf:fine

- Minimum Bin Width:

  • ceiling: 50 ft or 25 m
  • temperature: 0.1deg F or C
  • temperatureDewPoint: 0.1deg F or C
  • qpf: 0.005in/hr or 0.125mm/hr
  • relativeHumidity: 1%
  • Visibility: 0.06 statute mi or 0.1 km
  • windSpeed: 0.1 m/s or 0.25 mph
  • windGust: 0.1 m/s or 0.25 mph
  • windDirection: 5 degrees
  • qpfSnow: 0.1cm or 0.025 inches
  • The maximum number of edges supported is 103 if bins are explicitly defined by the caller by means of edge values.

temperature Predefined Bin Ranges

Units: Imperial (degrees Fahrenheit)
Specificity Level Coarse Medium Fine
Increment Increment Increment
2 degrees F 1 degree F .5 degree F
Units: Metric (degrees Celsius)
Specificity Level Coarse Medium Fine
Increment Increment Increment
1 degree C .5 degree C .25 degree C

temperatureDewPoint Predefined Bin Ranges

Units: Imperial (degrees Fahrenheit)
Specificity Level Coarse Medium Fine
Increment Increment Increment
2 degrees F 1 degree F .5 degree F
Units: Metric(degrees Celsius)
Specificity Level Coarse Medium Fine
Increment Increment Increment
1 degree C .5 degree C .25 degree C

qpf Predefined Bin Ranges

Wind Speed Predefined Bin Ranges

windDirection Predefined Bin Ranges

relativeHumidity Predefined Bin Ranges

qpfSnow Predefined Bin Ranges

ceiling Predefined Bin Ranges

visibility Predefined Bin Ranges

windGust Predefined Bin Ranges

Parameter: Percentiles

Percentiles of the distribution. Some users find value in requesting information about percentiles of the distribution. A percentile is a measure used in statistics indicating the value below which a given percentage of observations (or forecasts) in a group of observations (forecasts) fall. For instance, the 30th percentile is the value below which 30% of forecasts fall. In the context of Probabilistic temperature forecasts, the 30th percentile temperature forecast is (approximately) the value in the Probabilistic ensemble in which the 30% of the forecasted temperatures are cooler.

  1. When specifying a percentiles parameter value, a semicolon separated list of parameters is used for which to return percentile values, along with a colon separated list of desired percentile points (percent) for each. There are no defaults for the percentile point percentages so they must be specified.
    • Format: param0:p0:p1:..pn; param1:p0:p1:..pm
    • Example: ...<product>?percentiles=temperature:5.0:50.0:95.0;qpf:5.0:50.0:95.0
  1. Decorating with “fine”, “medium” or “coarse” facilitates specification of predefined percentile ranges, which range from narrow (fine) to wide (coarse) in precision. The percentile ranges are provided below. The predefined percentile ranges are translated into purely numeric ranges..
  • Format: param0:predefined0;param1:predefined1
  • Example: ...<product>?percentiles=temperature:coarse;qpf:fine

The maximum number of percentiles supported is 100.

Percentiles Predefined Bin Ranges

Parameter: Probabilities

Subset probabilities of the PDF distribution. Some users do not require the entire PDF, which describes the likelihood of the full set of possible outcomes at user-defined discretization. These users may only require information about what portion of the ensemble forecasts that fall in some small range of the full distribution. For instance, they may want to know the percentage of qpf forecasts that fall between some lower bound and upper bound, e.g. qpf between 0.05 and 0.10” per hour, or temperature above 90 deg F.

When specifying probabilities, use a semicolon separated list of parameters for which to return probability distribution integrations defined by a colon separated list of integral limit sets (form of <lb,ub> where lb is lower bound and ub is an upper bound and they are comma separated) following each parameter name:

lb_i: The lower bound of the integration required to form a probability where the integration is for lb_i < parameter value <=ub_i. Must be a decimal value, inf, or –inf. Default is -inf.

ub_i: The upper bound of the integration required to form a probability where the integration is for lb_i < parameter value <=ub_i. Must be a decimal value, inf, or –inf. Default is inf.

Although lower and upper bounds can be excluded to imply +/-inf defaults, the comma itself must be included.

Units of bounds much match that of parameter, consistent with the units request parameter.

  • Format: param0:lb0,ub0:lb1,ub1:…lbN,ubN;param1:lb0,ub0:lb1,ub1,…lbM,ubM
  • Example: …<product>?probabilities=temperature:,0:0.0,10:10,;qpf:2.0,5.0

Parameter: Prototypes

A quantity of prototype forecasts can be requested for specified parameters. The response will include the requested quantity of individually unique, but statistically representative hourly forecasts for the specified parameter. Each of the individual forecasts returned are statistically viable and as a collection they retain the characteristics of the underlying probability distribution for the parameter at each forecast hour. The underlying probability distribution function is represented with higher resolution the larger the requested quantity of forecasts, A user may utilize a collection of prototype forecasts to provide multiple variable inputs to a downstream model to obtain a meaningful distribution of outcomes from that model.

  1. When specifying an prototype request, a semicolon separated list of parameters is used, each with a colon separated integer that specifies the quantity of forecasts being requested. There are no defaults for the quantity so it must be specified for each parameter. The quantity across parameters may vary although in many use cases a consistent quantity is likely.
  • Format: param0:n;param1:m
  • Example: ...<product>?prototypes=temperature:25;qpf:25

This example requests 25 temperature and 25 qpf hourly forecasts.

The maximum number of prototypes supported is 100.

Data Elements & Definitions

Field Name Description Type Range Sample Nulls Allowed
"metadata" object
procTime Time observation is valid in UNIX® epoch value epoch 1369252927 N
initTime Time of start of forecast. Usually validTimeUtc rounded back to the top of the current hour epoch 1369252800 N
latitude Originally requested latitude of target point, clipped to 6 decimal points maximum decimal -89.9 to 89.9 42.71 N
longitude Originally requested longitude of target point, clipped to 6 decimal points maximum decimal -180 to 180.0 -71.12 N
elevation Elevation of the target point surface in units of the request, optionally provided by the request decimal 278.9 838.25 N
expires The expiration time of the content provided in the response. Not for public publication. string Mon, 19 Aug 2013 13:16:16 GMT N
landuse Landuse specifications. Current® permissible values are 1 for Land and 0 for Water decimal 1 N
resource The product the API applies to - pfp here string pfp N
serviceTime Length of time it took to produce the response [seconds]. Not for public publication. decimal 0.024182 N
spatialApp Spatial applicability of this forecast used for caching, expressed as an enumeration value of radius values [in km] defined above. Not for public publication. integer 1 N
version The API version string 3 N
requestId Unique identifier of the request, for transactional QC/troubleshooting purposes integer 5235660879876651 N
"forecasts1Hour" [array]
fcsttValid Time forecast is valid in UNIX seconds. [epoch] Unix times for hour 0 through 240 (241 times inclusive) [1503964800,1503968400,1503972000,1503975600,... ] N
"discretePdfs" Note: May return field header with empty array [array]
parameter Parameter name string <qty>, min(<qty>, temporal, <nHours>), max(<qty>, temporal, <nHours>), sum(<qty>,temporal,<nHours>) where <qty> is one of ceiling, temperature, qpf, temperatureDewPoint, relativeHumidity, visibility, windGust, windSpeed, windDirection,qpfSnow, and temporal is a keyword and nHours is an integer number of hours defining the aggregation period. temperature N
binEdges Array of arrays of bin edges, one binEdge array for each forecast hour. Different number of edges for each hour possible. Number of bins is number of binEdges + 1 [[decimal]] Dimensions: 241 times BY the variable number of bin edges for each hour

[[0.0,2.0,4.0,6.0,8.0,10.0,12.0],

[0.0,2.0,4.0,6.0,8.0,10.0,12.0],

[0.0,2.0,4.0,6.0,8.0,10.0],...]

N
binValues Array of arrays of bin values, each array one for a forecast hour The probabilities expressed as a percentage for the range defined by each bin. For the subarray representing a single forecast hour, the Left Tail: binValues[0] is the probability in the left tail. Right Tail: binValues[numBins-1] is the probability in the right tail. The binValues[:] array for each forecast hour sums to approximately 100.0 [[decimal]] Dimensions: 241 times BY the variable number of bins for each hour.

[[0.00,14.57,40.98,29.17,9.57,3.25,2.47,0.00],

[0.00,24.44,35.89,24.01,8.63,6.62,0.41,0.00],

[0.00,29.78,29.01,19.85,13.88,7.48,0.00], ...]

N
"probabilities" Note: May return field header with empty array [array]
parameter Parameter name string <qty>, min(<qty>, temporal, <nHours>), max(<qty>, temporal, <nHours>), sum(<qty>,temporal,<nHours>) where <qty> is one of ceiling, temperature, qpf, temperatureDewPoint, relativeHumidity, visibility, windGust, windSpeed, windDirection,qpfSnow, and temporal is a keyword and nHours is an integer number of hours defining the aggregation period. temperature N
lb Lower bound of the parameter value range for which the returned probability applies, in units consistent with the request. Note +/-inf is represented as +/-3.40e+38 (max 4 byte IEEE float) decimal 23.125 N
ub Upper bound of the parameter value range for which the returned probability applies, in units consistent with the request. Note +/-inf is represented as +/-3.40e+38 (max 4 byte IEEE float) decimal 27 N
probability Probability, as a percentage, of the parameter having a value lb<parameterValue<=ub for each hour of the forecast, in array format [decimal] Dimensions: 241 times for hours 0-240 inclusive. [0.00,0.00,0.00,2.69,54.41,94.37,97.29,97.58,97.51, ... ] N
"percentiles" Note: May return field header with empty array [array]
parameter Parameter name string <qty>, min(<qty>, temporal, <nHours>), max(<qty>, temporal, <nHours>), sum(<qty>,temporal,<nHours>) where <qty> is one of ceiling, temperature, qpf, temperatureDewPoint, relativeHumidity, visibility, windGust, windSpeed, windDirection,qpfSnow, and temporal is a keyword and nHours is an integer number of hours defining the aggregation period. temperature N
numPoints Number of percentiles in returned result. Should always be the same as the number requested integer 5 N
percentilePoints The requested percentile points in percent. Should always be the same as the requested percentiles. The minimum value for a point is 0.1% and the maximum value for a point is 99.9% [decimal] 0.1% to 99.9% [10.00, 25.00, 50.00, 75.00, 90.00] N
percentileValues The parameter values at the requested points, in units consistent with the request. Presented as an array of arrays. Outer array captures each forecast hour, 0-240. Inner array is the percentile values for that forecast hour [decimal] Dimensions: 241 times BY the variable number of percentiles requested.

[[0.000,0.000],

[0.000,0.000],

[0.000,0.001],...]

N
"prototypes" Note: May return field header with empty array [array]
parameter Parameter name string One of ceiling, temperature, qpf, temperatureDewPoint, relativeHumidity, visibility, windGust, windSpeed, windDirection,qpfSnow temperature N
forecast Requested number of prototype forecasts for all hours 0-240, for the parameter specified [decimal] Dimensions: Number of prototypes requested BY 241 times. Number of prototypes, currently limited to <= 100 [[20,21,22,25,22,...], [21,19,20,23,...],...] Y

JSON Sample

// Response Collapsed for Presentation Purposes

{ 
    "metadata": {
        "procTime":1555432667,"resource":"pfp","version":"2","units":"m","spatialApp":1,"serviceTime":0.15704954,"initTime":1555430400,
        "latitude":43.3700,"longitude":-71.0300,"elevation":140.00,"landuse":1.00,"expires":"Tue Apr 16 16:39:47 2019",
        "hostname":"pfp-prod-01-compute-000-us-east-1","requestId":674590000179262,"user_specified_n_output_hours":241
    },
    "forecasts1Hour": {
        "fcstValid": [ 1555430400, 1555434000, 1555437600, 1555441200, 1555444800, 1555448400, 1555452000, 1555455600,...],
        "discretePdfs": [
            {
                "parameter": "windGust",
                "binEdges": [ [1.5,5.5,10.7,17.1,24.4,32.6,42.0,49.0,57.7], [1.5,5.5,10.7,17.1,24.4,32.6,42.0,49.0,57.7],...],
                "binValues": [ [0.00,0.00,0.00,32.61,63.16,4.23,0.00,0.00,0.00,0.00], [0.00,0.00,0.00,32.60,64.40,3.01,0.00,0.00,0.00,0.00],...]
            }
        ],
        "probabilities": [
            {
                "parameter": "qpf",
                "lb": 0.100,
                "ub": 3.403e+38,
                "probability": [ 7.943, 7.266, 7.087, 7.271, 8.014, 8.376, 8.714, 8.725,...]
            }
        ],
        "percentiles": [
            {
                "parameter": "ceiling",
                "numPoints": 3,
                "percentilePoints": [ 10.00, 50.00, 90.00 ],
                "percentileValues": [ [ 1371, 1749, 25400 ], [ 1816, 25400, 25400 ], [ 1816, 25400, 25400 ],...]
            },
            {
                "parameter": "visibility",
                "numPoints": 3,
                "percentilePoints": [
                    10.00,
                    50.00,
                    90.00
                ],
                "percentileValues": [ [ 1.98, 7.22, 16.10 ], [ 5.80, 16.10, 16.10 ], [ 16.10, 16.10, 16.10 ],...]
            }
        ],
        "prototypes": [
            {
                "parameter": "windSpeed",
                "forecast": [ [ 9.8, 9.5, 9.8, 9.7, 8.5, 7.8, 6.8, 5.3, 3.8, 3.2, 2.8, 2.5,...],
                              [ 8.8, 8.7, 9.0, 8.9, 9.1, 8.5, 7.5, 5.8, 4.4, 3.9, 3.4, 3.2,...] ]
            }
        ]
    }
}