API url: http://weather.sun.ac.za/api/getlivedata.php?tag&tag&tag add as many &tag's as you like The API returns a html page with the values you specified separated by the specified delimiter or a html break (
) if none was given. The last value is always followed by the delimiter. The values are returned in the same order as the tags. If you use the same tag more than once in the same request, only the first one will be used and the rest ignored. It is possible to choose from which weather station the returned values should come by adding the setstation tag to the request as shown below. All special characters will be returned as html entities. Thus, even if this document displays incorrectly, the returned values will be correct. If you request a value that is not available, three hyphens will be returned (---). This is also applicable to times. This API does not have any fail-over or backup whatsoever. If the power goes down the API will not work. Use the API at your own risk. Neither The University of Stellenbosch, the Administrator of the server, nor the webmaster can be held responsible for any damage caused by the use of this website or the API. DELIMITER --------- delimiter Character or string of characters to separate the results of queries. Defaults to
if none is specified. Please note that special characters might cause weird behaviour and in such a case the url encoded character should rather be supplied. Url: ...?tag&tag&delimiter=
Returns: 24.5
68
WEATHER STATION --------------- setstation The weather station from which the measurements must be taken. EE or MM. If none is specified the best one is automatically chosen. Do note the difference between the setstation and station tags. URL: ...?tag&tag&setstation=EE&delimiter=
OTHER TAGS ---------- +-------------------------------+ | Possible values for "tag" | +-------------------------------+ | tag | | description | | example of returned value | +-------------------------------+ Only tags marked with a - are currently available. Ignore the -, * and $ when using the tag. Those are only to keep record of what still needs to be done. GENERAL INFO ------------ -about Normal about message. Copyright JP Meijers 2010 -version The version of this API. It returns the date on which the last change was made. 2010-12-05 -*date Date of the last measurement received from the weather station. 18/03/10 -*time Time of the last measurement. 14:17 -locationname Town where the weather station are located. Stellenbosch (coordinates...) -*station Weather Station Name. MM is for the weather station at mechanical engineering, EE for the one at E&E engineering. This name is an indication from which station the current record came. Due to automatic fail-over this might change a lot. MM -sunrise Today's sunrise time computed with php like this: date_sunrise(time(), SUNFUNCS_RET_STRING, -33.928, 18.866, 90+50/60, 2); 6:46 -sunset Today's sunset time computed with php: date_sunset(time(), SUNFUNCS_RET_STRING, -33.928, 18.866, 90+50/60, 2); 18:59 -quickforecast The current weather trend according to the barometer, humidity and temperature. Increasing clouds with little temperature change. If there is a need for it, I can add data about the moon. But you can easily enough compute it yourself. If someone has a algorithm to calculate moonrise and moonset times, please let me know. OUTSIDE TEMPERATURE - all temperatures are in degrees Celsius ------------------- -*temperature Outside Temperature <- updated every minute from the weather station. Last update is given by "date" & "time". 39: 21.2 -maxtemp High outside Temperature 41: 21.2 -maxtemptime The time today at which the maxtemp occurred. 41: 0:00 -mintemp Low outside Temperature 43: 21.2 -mintemptime The time today at which it was the coldest. 43: 0:00 OUTSIDE HUMIDITY - unit is percentage ---------------- -*humidity Outside humidity 67: 44 -maxhum High humidity 69: 44 -maxhumtime: time 00:00 -minhum Low humidity 71: 44 -minhumtime: time 00:00 BAROMETER - unit is hectopascal (hPa) or millibar --------- -*baro Barometer 81: 1012.2 -barotrend Barometer Trend 83: Steady -maxbaro High barometer 85: --- -maxbarotime: time 85: ---- -minbaro Low barometer 87: --- -minbarotime: time 87: ---- WIND - unit is kilometre per hour ---- -*wind The windspeed at the instant the sample was take. That is at the time given by the "time" tag. 97: 11.3 -*winddir Wind direction sector in degrees -*windsec Wind direction sector 109: NNW -windavg 10 minute average wind speed 99: 12.9 -windavgdir 10 minute average wind direction in degrees. Maximum two decimal places. 329.45 -windavgdirsec 10 minute average wind direction sector. NNW -maxwind High wind speed 101: 16.1 -maxwindtime: time 0:00 -*windrun -*windchill Wind chill - degrees Celsius 111: 20.9 minwindchill Low wind chill 113: 21.1 minwindchilltime: time 113: 0:00 Nobody needs the maximum wind chill, but if somebody really wants it let me know. OUTSIDE DEW POINT ----------------- -*dew Outside dew point 159: 8.4 °C maxdew High dew point 161: 8.3 °C at 0:00 maxdewtime: mindew Low dew point 163: 8.3 °C at 0:00 mindewtime: OUTSIDE - OTHER --------------- -*heat Outside heat index <- "aanvoelbare temperatuur", alhoewel "windchill" 'n beter waarde sal gee 175: 19.9 °C maxheat High heat index 177: 20.0 °C at 0:00 maxheattime -*thw High thsw index <- Ook 'n vorm van "aanvoelbare temperatuur", maar neem temperatuur, humiditeit, son en wind in ag. Gewoonlik 'n baie beter waarde om verskillende dorpe se "warmte" te vergelyk. 183: 17.8 °C at 0:00 maxthw maxthwtime -$*thsw $maxthsw $maxthswtime PRECIPITATION ------------- -dayrain Daily rain 0.2 -monthrain Ammount of rain since the beginning of this month. 9 -yearrain Ammount of rain since 1 January. 61.6 -*rainrate Rain rate <- currently raining if >0 127: 0.0 mm/hr maxrainrate High rain rate 129: 0.0 mm/hr at ---- maxrainratetime: $dayet Daily et <- evapotranspiration - go and wiki it. 137: 0.00 mm SUNLIGHT INTENSITY ------------------ -$*solarrad Solar radiation 143: 0 W/m² $maxsolarrad High solar rad 145: 0 W/m² at ---- $maxsolarradtime -$*solarenergy $maxsolarenergy $maxsolarenergytime -$*uvindex Uv <- current value 151: 0.0 index $maxuvindex High uv 153: 0.0 index at ---- $maxuvindextime -$*uvdose $maxuvdose $maxuvdosetime MEASUREMENTS INSIDE BUILDING ---------------------------- -*insidetemp Inside temperature 25: 25.4 °C -*insidehum Inside humidity 53: 33 % -*insidedew Inside dew point 173: 7.9 °C -*insideheat Inside heat index 189: 24.7 °C UNITS ----- All of the following returns the appropriate unit encoded with html entities. -rainunit -rainrateunit -tempunit -windunit -humidunit -barounit -------------------------------------------------- If anything is missing, unclear or malfunctioning, please contact me. webjpmeijers.com --------------------------------------------------