Degree Day Forecast API
With this API, you can retrieve cooling or heating degree day forecasts out to 8 days in daily or hourly intervals. Additionally, you can retrieve forecasts for other valuable information like total sun hours, precipitation, snowfall, and more!
Be sure to check out our blog to read about the methodology for calculating degree days.
This API is available to the following plans (See: pricing):
- Business plan
- Enterprise plan
All parameters should be supplied to the Weather API as query string parameters.
Base URL
HTTP: http://api.weatherbit.io/v2.0/forecast/energy
HTTPS: https://api.weatherbit.io/v2.0/forecast/energy
Supported Methods: GET
Request Parameters
key=[key] (REQUIRED)
key
- Your API Key.
units=[units](optional)
M
- [DEFAULT] Metric (Celsius, m/s, mm)S
- Scientific (Kelvin, m/s, mm)I
- Fahrenheit (F, mph, in)
tp=[time_period] (optional - Time period of each timestamp, default = daily)
hourly
- Hourly time stepsdaily
- [DEFAULT] Daily time steps
threshold=[degrees]
API Endpoints
Description | Required Parameters | Example(s) |
---|---|---|
Get data by lat/lon (Recommended) | lat, lon | &lat=38.123&lon=-78.543 |
Get data by city name | city, state(optional), country (optional) | &city=Raleigh,NC |
Get data by postal code | postal_code, country (optional) | &postal_code=27601&country=US |
Get data by city id | city_id | &city_id=8953360 |
Get data by ICAO or station id | station | &station=KRDU |
Example Request:
https://api.weatherbit.io/v2.0/forecast/energy?lat=38.0&lon=-78.0&threshold=63&units=I&key=API_KEY
Example Response (JSON):
{
"threshold_units":"F",
"timezone":"America\/New_York",
"threshold_value":"63",
"state_code":"VA",
"country_code":"US",
"city_name":"Louisa",
"city_id":4770766,
"data":[
{
"date":"2019-03-04",
"timestamp_utc":"2019-03-04T17:00:00",
"timestamp_local":"2019-03-04T12:00:00",
"temp":45.9,
"temp_wetbulb":44.3,
"hdd":13,
"cdd":0,
"wind_spd":4.7,
"max_wind_spd":8.1,
"wind_dir":166,
"wind_spd_100m":7.9,
"max_wind_spd_100m":10,
"wind_dir_100m":185,
"dewpt":33.4,
"snow":0,
"rh":86,
"dhi":194.8,
"precip":0,
"t_dni":1245,
"t_dhi":400,
"t_ghi":3000,
"sun_hours":4.7,
"clouds":6
}, ...
]
}
Field Decriptions:
threshold_units:
Degree Day threshold units (F/C/K).threshold_value:
Degree Day threshold value in degrees.lat:
Latitude (Degrees).lon:
Longitude (Degrees).timezone:
Local IANA Timezone.city_name:
City name.city_id:
City ID.station_id:
Source station ID.country_code:
Country abbreviation.state_code:
State abbreviation/code.data: [
date:
Date (YYYY-MM-DD).timestamp_local:
Timestamp at local time.timestamp_utc:
Timestamp at UTC time.wind_spd:
Average 10m wind speed over period (Default m/s).wind_dir:
Average 10m wind direction over period (degrees).max_wind_spd:
Maximum 10m wind gust over period (Default m/s).wind_spd_100m:
Average 100m wind speed over period (Default m/s).wind_dir_100m:
Average 100m wind direction over period (degrees).max_wind_spd_100m:
Maximum 100m wind speed over period (Default m/s).cdd:
Total number of cooling degree days relative to threshold temperature.hdd:
Total number of heating degree days relative to threshold temperature.temp:
Average temperature over period (default Celsius).temp_wetbulb:
Average wet bulb temperature over period (default Celsius).rh:
Average relative humidity over period (%).dewpt:
Average dew point over period (default Celsius).clouds:
Average cloud coverage over period (%).precip:
Accumulated liquid equivalent precipitation over period (default mm).snow:
Accumulated snowfall over period (default mm).t_dni:
Total direct normal irradiance (W/M^2) [Clear Sky]t_ghi:
Total global horizontal irradiance (W/M^2) [Clear Sky]t_dhi:
Total diffuse horizontal irradiance (W/M^2) [Clear Sky]t_solar_rad:
Total solar radiation (W/M^2)sun_hours:
Total peak sun hours over period.]