Vital Weather API
Introduction
The Vitalweather v1 API can be used to access weather station metadata and weather observation data for Vitalweather.com connected weather stations that you have access to.
Geting started
Get Your API Key
from cwp@cwprice.co.za and we will provide you your API key
https://www.vitalweather.co.za/api/v1/stations.php?key=(YOUR KEY)
links for api
stations
[key] is is require
stations link provides you with all your stations.
https://www.vitalweather.co.za/api/v1/stations.php?key=(YOUR KEY)
{
stations: [
{
Station_ID: 2, <= ID of the station. [Int]
Station_Name: "C W Price Midrand VW001", <= Name of the station. [String]
latitude: -26.00643733, <= latitude of the station location. [Int]
longitude: 28.130963551, <= longitude of the station location. [Int]
height: 1598.1 <= height in Meters [Int]
}
],
generated_at: 1625048805 <= A Unix timestamp for when the API response was generated [Int]
}
conditions
[key] is is require
conditions link provides you with rencent conditions values .
https://www.vitalweather.co.za/api/v1/conditions.php/{Station_ID}?key=(YOUR KEY)
or for all stations
https://www.vitalweather.co.za/api/v1/conditions.php?key=(YOUR KEY)
{
conditions: [{
{
station_id: 2, <= ID of the station. [Int]
local_time_last_update: "2021-07-01 13:15:08", <= local time of data captured [STR]
ts: 1625138108, <= time stamp in unix of data captured [Int]
temperature: 21.4, <= recent temperature [Int]
humidity: 33, <= recent humidity [Int]
pressure: 1025.57, <= recent pressure: 1025.57 [Int]
avg_wind: 9.7, <= recent wind average: [Int]
wind_direction: 337, <= recent wind_direction [Int]
total_rain: 0 <= total rain for the day will incress as the day passes [Int]
}
],
unites: {
local_time_last_update: "YYYY-MM-DD HH:MM:SS", <= local date time formate [STR]
ts:"Unix time" <= Unix time stamp [STR]
temperature: "°C", <= temperature in degree Celsius [STR]
humidity: "%", <= humidity in percentage [STR]
pressure: "mb", <= pressure in Millibar [STR]
avg_wind: "Km/h", <= wind_average in Kilometres per hour [STR]
wind_direction: "360 points", <= wind_direction indercating it 360 points [STR]
total_rain: "mm" <= total_rain units in millimeters per hour [STR]
},
generated_at: 1625050833 <= A Unix timestamp for when the API response was generated [Int]
}
dailysummary
[key] is is require
dailysummary link provides you with day before daily summary values or .
https://www.vitalweather.co.za/api/v1/dailysummary.php/{Station_ID}?key=(YOUR KEY)
or for all stations
https://www.vitalweather.co.za/api/v1/dailysummary.php?key=(YOUR KEY)-
{
dailysummary: [
{
station_id: 2, <= ID of the station. [Int]
Date: "2021-06-29", <= date of the data captured [str]
rain: 0, <= rain for day. [Int]
avg_temp: 16.9, <= average temperature for the day [Int]
min_temp: 12.6, <= minimum temperature for the day [Int]
max_temp: 22.8, <= maximum temperature for the day [Int]
avg_RH: 42, <= average relative humidity for the day [Int]
min_RH: 29, <= minimum relative humidity for the day [Int]
max_RH: 52, <= maximum relative humidity for the day [Int]
avg_wind: 1.9, <= average wind speed for the day [Int]
avg_solar: 103.9 <= average solar radiation for the day [Int]
avg_pressure: 1031.53 <= average pressure for the day [Int]
min_pressure: 1029.19 <= minimum pressure for the day [Int]
max_pressure: 1033.97 <= maximum pressure for the day [Int]
avg_winddirection: [ <= array wind direction average array()
225, <= wind direction average [Int]
"SW" <= wind direction average [str]
]
}
],
unites: {
rain: "mm", <= units in millimeters per hour [str]
avg_temp: "°C", <= temperature in degree Celsius [str]
max_temp: "°C", <= temperature in degree Celsius [str]
min_temp: "°C", <= temperature in degree Celsius [str]
avg_RH: "%", <= humidity in percentage [str]
max_hum: "%", <= humidity in percentage [str]
min_hum: "%", <= humidity in percentage [str]
avg_wind: "kmh", <= wind_average in Kilometres per hour [str]
avg_solar: "Watts/M" <= solar radiation in Watts per metter [str]
avg_pressure: "mb" <= average pressure for the day [Int]
min_pressure: "mb" <= minimum pressure for the day [Int]
max_pressure: "mb" <= minimum pressure for the day [Int]
avg_winddirection: [ <= array wind direction average array()
"°", <= wind direction in degree [str]
"DIR" <= wind direction in string formate [str]
},
generated_at: 1625050955 <= A Unix timestamp for when the API response was generated [Int]
}
History
History link provides you with History conditions values .
please note:
[Id] is is require 'station ID'
[key] is is require
!please note that you can only retive a year of data. One at a time. as multipal years will produce to much data to process for the call.
this function allow tou to retive from one date to anouther.
https://www.vitalweather.co.za/api/v1/history.php?ID=(Station ID)&key=(YOUR KEY)&from=[Unix timestamp]&to=[Unix timestamp]
or
this allows you to get History starting from todays date and - how many days you looking for.
https://www.vitalweather.co.za/api/v1/history.php?ID=(Station ID)&key=(YOUR KEY)&day=[int number min 0 to max 365]
{
History: [{
{
station_id: 2, <= ID of the station. [Int]
local_time_last_update: "2021-07-01 13:15:08", <= local time of data captured [STR]
ts: 1625138108, <= time stamp in unix of data captured [Int]
temperature: 21.4, <= temperature [Int]
humidity: 33, <= humidity [Int]
pressure: 1025.57, <= pressure [Int]
avg_wind: 9.7, <= wind average: [Int]
wind_direction: 337, <= wind_direction [Int]
total_rain: 0 <= rain for that time and date [Int]
}
],
unites: {
local_time_last_update: "YYYY-MM-DD HH:MM:SS", <= local date time formate [STR]
ts:"Unix time" <= Unix time stamp [STR]
temperature: "°C", <= temperature in degree Celsius [STR]
humidity: "%", <= humidity in percentage [STR]
pressure: "mb", <= pressure in Millibar [STR]
avg_wind: "Km/h", <= wind_average in Kilometres per hour [STR]
wind_direction: "360 points", <= wind_direction indercating it 360 points [STR]
total_rain: "mm", <= total_rain units in millimeters per hour [Int]
solar_radiation: " W/M2", <= solar_radiation units in W/M2 [Int]
FDI: "Fire Danger Index" <= Fire Danger Index units 1 to 100 [Int]
},
generated_at: 1625050833 <= A Unix timestamp for when the API response was generated [Int]
}