Energy / Degree Day Forecast API
Energy-focused forecast endpoint including degree-day and irradiance used for energy and load planning.
Returns both weather and energy-relevant forecast fields.
- Cooling and heating degree-day forecast support.
- Includes Clear-sky DNI, DHI, and GHI fields. As well as surface Solar Radiation (W/m^2).
- The solar radiation field (solar_rad) accounts for cloud cover, and other factors.
- Useful for demand and load modeling.
Frequently Asked Questions
How are heating and cooling degree days calculated?
Degree days estimate heating or cooling demand relative to a selected temperature threshold. We calculate HDD and CDD from hourly temperature values, which better captures intraday swings than a simple daily max/min average.
Read blog postWhat does the `solar_rad` field represent?
The solar radiation field is an estimated surface solar flux value that accounts for cloud cover, surface albedo, and atmospheric effects. Alternatively, GHI/DNI/DHI values are clear-sky values which do not account for these.
Read help articleRequest Parameters
| Field | Optional/Required | Type | Data Type | Description |
|---|---|---|---|---|
lat
|
Required | query | number | Latitude component of location. |
lon
|
Required | query | number | Longitude component of location. |
threshold
|
Optional | query | number | Temperature threshold to use to calculate degree days (default 18 C) |
units
|
Optional | query | string | Convert to units. Default Metric. Options (I = Imperial, M = Metric, S = Scientific) |
tp
|
Optional | query | string | Time period (default: daily) |
key
|
Required | query | string | Your registered API key. |
Example Request
Enter API key
lat/lon (recommended)
https://api.weatherbit.io/v2.0/forecast/energy?key=API_KEY&lat=35.7796&lon=-78.6382
curl -s "https://api.weatherbit.io/v2.0/forecast/energy?key=API_KEY&lat=35.7796&lon=-78.6382"
require 'uri'
require 'net/http'
require 'json'
uri = URI("https://api.weatherbit.io/v2.0/forecast/energy?key=API_KEY&lat=35.7796&lon=-78.6382")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = (uri.scheme == "https")
request = Net::HTTP::Get.new(uri)
response = http.request(request)
json = JSON.parse(response.body)
puts JSON.pretty_generate(json)
const https = require("https");
https.get("https://api.weatherbit.io/v2.0/forecast/energy?key=API_KEY&lat=35.7796&lon=-78.6382", (res) => {
let raw = "";
res.on("data", (chunk) => { raw += chunk; });
res.on("end", () => {
const json = JSON.parse(raw);
console.log(JSON.stringify(json, null, 2));
});
}).on("error", (err) => {
console.error(err.message);
});
Estimated quota: 1 requeststandard
Example Response HTTP 200
{
"city_name": "Phoenix",
"country_code": "US",
"data": [
{
"cdd": 9.566042,
"clouds": 1,
"date": "2026-06-02",
"dewpt": -3.3088942,
"hdd": 0,
"max_wind_spd": 10.703125,
"max_wind_spd_100m": 12.980885,
"precip": 0,
"rh": 8,
"snow": 0,
"sun_hours": 6.2231994,
"t_dhi": 903.12,
"t_dni": 7123.75,
"t_ghi": 6223.2,
"t_solar_rad": 6223.199,
"temp": 35.990383,
"temp_wetbulb": 16.028856,
"timestamp_local": null,
"timestamp_utc": null,
"wind_dir": 278,
"wind_dir_100m": 267,
"wind_spd": 4.6088557,
"wind_spd_100m": 6.522531
},
{
"cdd": 15.016666,
"clouds": 3,
"date": "2026-06-03",
"dewpt": -0.83658487,
"hdd": 0,
"max_wind_spd": 5.4,
"max_wind_spd_100m": 9.5176935,
"precip": 0,
"rh": 12,
"snow": 0,
"sun_hours": 8.598942,
"t_dhi": 1330.8201,
"t_dni": 10653.84,
"t_ghi": 8598.99,
"t_solar_rad": 8598.935,
"temp": 33.34667,
"temp_wetbulb": 15.441433,
"timestamp_local": null,
"timestamp_utc": null,
"wind_dir": 218,
"wind_dir_100m": 232,
"wind_spd": 1.7833333,
"wind_spd_100m": 3.9319463
},
{
"cdd": 15.222083,
"clouds": 2,
"date": "2026-06-04",
"dewpt": 0.39336398,
"hdd": 0,
"max_wind_spd": 7.8,
"max_wind_spd_100m": 11.017624,
"precip": 0,
"rh": 13,
"snow": 0,
"sun_hours": 8.606662,
"t_dhi": 1331.53,
"t_dni": 10659.79,
"t_ghi": 8606.67,
"t_solar_rad": 8383.004,
"temp": 33.552082,
"temp_wetbulb": 15.858048,
"timestamp_local": null,
"timestamp_utc": null,
"wind_dir": 199,
"wind_dir_100m": 210,
"wind_spd": 2.3233333,
"wind_spd_100m": 4.3713956
},
{
"cdd": 14.674167,
"clouds": 1,
"date": "2026-06-05",
"dewpt": 0.20331913,
"hdd": 0,
"max_wind_spd": 7.6,
"max_wind_spd_100m": 14.629183,
"precip": 0,
"rh": 13,
"snow": 0,
"sun_hours": 8.613829,
"t_dhi": 1332.24,
"t_dni": 10665.29,
"t_ghi": 8613.83,
"t_solar_rad": 8395.945,
"temp": 33.004166,
"temp_wetbulb": 15.588694,
"timestamp_local": null,
"timestamp_utc": null,
"wind_dir": 222,
"wind_dir_100m": 246,
"wind_spd": 3.1095834,
"wind_spd_100m": 6.2135878
},
{
"cdd": 14.012917,
"clouds": 11,
"date": "2026-06-06",
"dewpt": 1.8923435,
"hdd": 0,
"max_wind_spd": 7.6,
"max_wind_spd_100m": 11.364197,
"precip": 0,
"rh": 15,
"snow": 0,
"sun_hours": 8.6163645,
"t_dhi": 1332.85,
"t_dni": 10670.32,
"t_ghi": 8620.45,
"t_solar_rad": 8367.236,
"temp": 32.34292,
"temp_wetbulb": 15.826333,
"timestamp_local": null,
"timestamp_utc": null,
"wind_dir": 205,
"wind_dir_100m": 205,
"wind_spd": 3.83125,
"wind_spd_100m": 4.6465883
},
{
"cdd": 15.114011,
"clouds": 93,
"date": "2026-06-07",
"dewpt": 1.0086149,
"hdd": 0,
"max_wind_spd": 8.8125,
"max_wind_spd_100m": 10.90621,
"precip": 0,
"rh": 14,
"snow": 0,
"sun_hours": 3.4776783,
"t_dhi": 1272.78,
"t_dni": 10111.74,
"t_ghi": 8622.54,
"t_solar_rad": 1537.4442,
"temp": 32.447918,
"temp_wetbulb": 15.582192,
"timestamp_local": null,
"timestamp_utc": null,
"wind_dir": 244,
"wind_dir_100m": 218,
"wind_spd": 3.565484,
"wind_spd_100m": 4.5209165
},
{
"cdd": 15.015703,
"clouds": 2,
"date": "2026-06-08",
"dewpt": 0.81759644,
"hdd": 0,
"max_wind_spd": 8.1015625,
"max_wind_spd_100m": 9.825677,
"precip": 0,
"rh": 13,
"snow": 0,
"sun_hours": 8.626628,
"t_dhi": 1272.9,
"t_dni": 10111.68,
"t_ghi": 8626.65,
"t_solar_rad": 8394.837,
"temp": 33.345703,
"temp_wetbulb": 15.940627,
"timestamp_local": null,
"timestamp_utc": null,
"wind_dir": 198,
"wind_dir_100m": 263,
"wind_spd": 3.6300633,
"wind_spd_100m": 4.4025865
},
{
"cdd": 15.871172,
"clouds": 1,
"date": "2026-06-09",
"dewpt": -0.77789307,
"hdd": 0,
"max_wind_spd": 7.1992188,
"max_wind_spd_100m": 8.731303,
"precip": 0,
"rh": 12,
"snow": 0,
"sun_hours": 8.6304,
"t_dhi": 1272.99,
"t_dni": 10111.53,
"t_ghi": 8630.399,
"t_solar_rad": 8630.399,
"temp": 34.20117,
"temp_wetbulb": 15.911085,
"timestamp_local": null,
"timestamp_utc": null,
"wind_dir": 268,
"wind_dir_100m": 241,
"wind_spd": 2.985981,
"wind_spd_100m": 3.6214354
}
],
"lat": 33.4484,
"lon": -112.074,
"state_code": "AZ",
"threshold_units": "C",
"threshold_value": 18.33,
"timezone": "America/Phoenix"
}
HTTP Statuses
| Code | Description | Example |
|---|---|---|
| 200 | An Energy Data Object. | - |
| 204 | No Data Found | - |
| 400 | Client Error |
|
| 403 | Unauthorized/No Access for current plan level |
|
| 429 | Daily or Velocity limit exceeded See rate limit guidance. |
|
| 500 | Internal Server Error |
|
Return Fields
| Field | Data Type | Description |
|---|---|---|
city_name
|
string | Nearest city name |
state_code
|
string | State abbreviation |
country_code
|
string | Country abbreviation |
timezone
|
string | Local IANA time zone |
lat
|
number | Latitude |
lon
|
number | Longitude |
threshold_units
|
string | Degree day threshold units |
threshold_value
|
string | Degree day threshold |
data
|
array<EnergyForecastSeries> | |
data[].date
|
string | Date |
data[].timestamp_local
|
['string', 'null'] | Timestamp in local time |
data[].timestamp_utc
|
['string', 'null'] | Timestamp UTC |
data[].cdd
|
number | Cooling degree days |
data[].hdd
|
number | Heating degree days |
data[].rh
|
integer | Average Relative humidity (%) |
data[].dewpt
|
number | Average dew point temperature - Default (C) |
data[].max_wind_dir
|
integer | Average max 10m wind direction (Degrees) - Degrees clockwise from 0 = North |
data[].max_wind_dir_100m
|
integer | Average max wind direction at 100m height (Degrees) - Degrees clockwise from 0 = North |
data[].max_wind_spd
|
number | Max 10m wind speed - Default (m/s) |
data[].max_wind_spd_100m
|
number | Max wind speed at 100m height - Default (m/s) |
data[].wind_dir
|
integer | Average wind direction (Degrees) - Degrees clockwise from 0 = North |
data[].wind_dir_100m
|
integer | Average wind direction at 100m height (Degrees) - Degrees clockwise from 0 = North |
data[].wind_spd
|
number | Average wind speed at 10m height - Default (m/s) |
data[].wind_spd_100m
|
number | Average wind speed at 100m height - Default (m/s) |
data[].temp
|
number | Average temperature - Default (C) |
data[].temp_wetbulb
|
number | Average wetbulb temperature - Default (C) |
data[].clouds
|
integer | Average cloud cover (%) |
data[].t_ghi
|
number | Total clear sky global horizontal solar irradiance (W/m^2) |
data[].t_dhi
|
number | Total clear sky diffuse horizontal solar irradiance (W/m^2) |
data[].t_dni
|
number | Total clear sky direct normal solar irradiance (W/m^2) |
data[].t_solar_rad
|
number | Total solar radiation (W/m^2) - Accounts for cloud cover, and other factors. |
data[].sun_hours
|
number | Average number of daily sun hours - # hours where Solar GHI > 1000 W/m^2 |
data[].precip
|
number | Total precipitation in period - Default (mm) |
data[].snow
|
number | Total snowfall in period - Default (mm) |