openapi: 3.0.1
info:
title: Weatherbit - Interactive Swagger UI Documentation 16 Day / Daily Forecast Forecast Degree Day API API
description: This an interactive version of the documentation for the Weatherbit API. The base URL for the API is [http://api.weatherbit.io/v2.0/](http://api.weatherbit.io/v2.0/) or [https://api.weatherbit.io/v2.0/](http://api.weatherbit.io/v2.0/). Below is the Swagger UI documentation for the API. All API requests require the `key` parameter. An Example for a 48 hour forecast for London, UK would be `http://api.weatherbit.io/v2.0/forecast/hourly?lat=51.5072`&`lon=-0.1276`. See our [Weather API description page](https://www.weatherbit.io/api) for the full documentation.
version: 2.0.0
servers:
- url: https://api.weatherbit.io/v2.0
- url: http://api.weatherbit.io/v2.0
tags:
- name: Forecast Degree Day API
paths:
/forecast/energy:
get:
tags:
- Forecast Degree Day API
summary: Weatherbit Returns Energy Forecast API Response - Given a Single Lat/lon.
description: Retrieve an 8 day forecast relevant to te Energy Sector (degree days, solar radiation, precipitation, wind).
parameters:
- name: lat
in: query
description: Latitude component of location.
schema:
type: number
format: double
example: 35.45
- name: lon
in: query
description: Longitude component of location.
schema:
type: number
format: double
example: 8.17
- name: threshold
in: query
description: 'Temperature threshold to use to calculate degree days (default 18 C) '
schema:
type: number
format: double
example: 59.44
- name: units
in: query
description: Convert to units. Default Metric See <a target='blank' href='/api/requests'>units field description</a>
schema:
type: string
format: string
enum:
- S
- I
example: I
- name: tp
in: query
description: 'Time period (default: daily)'
schema:
type: string
format: string
enum:
- hourly
- daily
example: daily
- name: key
in: query
description: Your registered API key.
required: true
schema:
type: string
format: string
example: abc123xyz
responses:
'200':
description: An Energy Data Object.
content:
application/json:
schema:
$ref: '#/components/schemas/EnergyObsGroupForecast'
default:
description: No Data.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
components:
schemas:
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
EnergyObsGroupForecast:
type: object
properties:
city_name:
type: string
description: City name (closest)
example: Raleigh
state_code:
type: string
description: State abbreviation
example: NC
country_code:
type: string
description: Country abbreviation
example: US
timezone:
type: string
description: Local IANA time zone
example: America/New_York
lat:
type: number
description: Latitude
example: 38.0
lon:
type: number
description: Longitude
example: -78.25
threshold_units:
type: string
description: Degree day threshold units
example: C
threshold_value:
type: string
description: Degree day threshold
example: '18'
data:
type: array
items:
$ref: '#/components/schemas/EnergyObsSeries'
EnergyObsSeries:
type: object
properties:
date:
type: string
description: Date
example: 2018-06-01
cdd:
type: number
description: Cooling degree days
example: 10.0
hdd:
type: number
description: Heating degree days
example: 120.0
rh:
type: integer
description: Average Relative humidity (%)
example: 75
dewpt:
type: number
description: Average dew point temperature - Default (C)
example: 12.0
wind_dir:
type: integer
description: Average wind direction (Degrees)
example: 125
wind_spd:
type: number
description: Average wind speed - Default (m/s)
example: 5.85
temp:
type: number
description: Average temperature - Default (C)
example: 13.85
clouds:
type: integer
description: Average cloud cover (%)
example: 42
t_ghi:
type: number
description: Total global horizontal solar irradiance (W/m^2)
example: 3000.0
t_dhi:
type: number
description: Total diffuse horizontal solar irradiance (W/m^2)
example: 450.0
t_dni:
type: number
description: Total direct normal solar irradiance (W/m^2)
example: 1200.0
sun_hours:
type: number
description: 'Average number of daily sun hours - # hours where Solar GHI > 1000 W/m^2'
example: 4.5
precip:
type: number
description: Total precipitation in period - Default (mm)
example: 2.0
snow:
type: number
description: Total snowfall in period - Default (mm)
example: 10.0