Degree Day Forecast API

With this API, you can retrieve cooling or heating degree day forecasts out to 8 days. 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):

  • Advanced plan(s)
  • Degree Day API High plan
  • Degree Day API Low 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 (Celcius, m/s, mm)
  • S - Scientific (Kelvin, m/s, mm)
  • I - Fahrenheit (F, mph, in)
threshold=[degrees]
callback=[function] (optional: JSON-P callback)

API Endpoints

Description Required Parameters Example(s)
Get data by lat/lon 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":[  
              {  
                 "dewpt":33.4,
                 "snow":0,
                 "max_wind_spd":8.1,
                 "date":"2018-12-14",
                 "hdd":13,
                 "cdd":0,
                 "rh":53,
                 "wind_spd":4.7,
                 "dhi":194.8,
                 "wind_dir":166,
                 "precip":0,
                 "temp":50,
                 "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).
    • wind_spd: Average wind speed over period (Default m/s).
    • wind_dir: Average wind direction over period (degrees).
    • max_wind_spd: Maximum wind gust 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 Celcius).
    • rh: Average relative humidity over period (%).
    • dewpt: Average dew point over period (default Celcius).
    • 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]
    • sun_hours: Average daily peak sun hours (where hourly GHI > 1000 W/m^2) over period.
  • ]