LLSR API - Information (INFO) port docs and examples.
This document explains the simple use of the info port, its methods and limitations.
Full details of this port, its methods and responses can be found by viewing the WSDL file here.
Connecting to the Info-API
The code below will create a PHP SOAP client object that contains all of the Info-API methods.
$client = new
SoapClient('https://api.skilouise.com/INFO-API.php?WSDL',array('trace'
=> true,'exceptions' => false));
Info-API contains a number of methods which provide you with access to weather and snow data.
Current snow report
To fetch the current snow report use the following code.
$response = $client->getSnowReport();
The above code will return an object such as this.
stdClass Object (
[date] => Thursday Dec 19th, 2013
[time]
=> 5:38 AM
[timeStamp] => 1387456690
[midMountainOvernight]
=> 1
[midMountainLast24] => 2
[midMountainLast48] => 27
[midMountainLast7days] => 48
[midMountainDepth] => 96
[midMountainYTD] => 162
[topMountainOvernight] => 2
[topMountainLast24] => 3
[topMountainLast48] => 34
[topMountainLast7days] => 60
[topMountainDepth] => 90
[topMountainYTD] => 188
[bestCms] => 34
[bestTime] => 48
[bestPeriod] => hours
[info] => 34cm in the last 48 hrs
)
Snow measurements are given in centimeters and are rounded to the nearest whole value.
Latest Weather Conditions
To fetch the latest weather reading from our weather stations use the following code.
$response = $client->getWeatherReport();
The above code will return an object such as this.
stdClass Object (
[result] => true
[report] => {"Base
Area":{"stationID":"1","stationLocation":"Base
Area","timestamp":"2013-12-19 10:35:07","Pressure":"30372","TempOut":"
-66","WindSpeed":"0","WindDir":"22","HumOut":"83","WetBulb":"-71.5"},"Temple
Lodge":{"stationID":"2","stationLocation":"Temple
Lodge","timestamp":"2013-12-19 10:35:14","Pressure":"30393","TempOut":"
-73","WindSpeed":"0","WindDir":"58","HumOut":"83","WetBulb":"-78.52"},"Paradise
Top":{"stationID":"3","stationLocation":"Paradise
Top","timestamp":"2013-12-19 10:35:20","Pressure":"30266","TempOut":"
-25","WindSpeed":"0","WindDir":"16","HumOut":"86","WetBulb":"-30.82"},"Gondola
Top":{"stationID":"4","stationLocation":"Gondola
Top","timestamp":"2013-12-19 10:35:26","Pressure":"30305","TempOut":"
13","WindSpeed":"1","WindDir":"24","HumOut":"84","WetBulb":"5.5399"},"Mid-Mountain":{"stationID":"5","stationLocation":"Mid-Mountain","timestamp":"2013-12-19
10:35:32","Pressure":"30334","TempOut":"
2","WindSpeed":"0","WindDir":"45","HumOut":"83","WetBulb":"-5.241"},"Old
Gondola Base":{"stationID":"7","stationLocation":"Old Gondola
Base","timestamp":"2013-12-19 10:35:38","Pressure":"30442","TempOut":"
-141","WindSpeed":"0","WindDir":"10","HumOut":"84","WetBulb":"-144.5"}}
)
The response object contains a boolean result showing if the request was completed or not and a JSON encoded string in the parameter report. The JSON string contains an array of stdClass Objects each representing a single station and its latest data set.
Once you have collected the response object you must decode the JSON string to access the objects within in the standard manner. Use the following code to do this.
$report = json_decode($response->report);
The resulting object will look like this
stdClass Object (
[Base Area] => stdClass Object (
[stationID] => 1
[stationLocation] => Base Area
[timestamp]
=> 2013-12-19 10:55:07
[Pressure] => 30382
[TempOut] => -46
[WindSpeed] => 2
[WindDir] => 19
[HumOut] => 83
[WetBulb] => -51.88
)
[Temple Lodge] => stdClass
Object (
[stationID] => 2
[stationLocation] => Temple Lodge
[timestamp] => 2013-12-19 10:55:13
[Pressure] => 30404
[TempOut] => -63
[WindSpeed] => 0
[WindDir] => 58
[HumOut] => 83
[WetBulb] => -68.60
)
[Paradise
Top] => stdClass Object (
[stationID] => 3
[stationLocation] => Paradise Top
[timestamp] => 2013-12-19
10:55:20
[Pressure] => 30282
[TempOut] => -28
[WindSpeed] => 0
[WindDir] => 16
[HumOut] => 86
[WetBulb] => -33.7
)
[Gondola Top] => stdClass
Object (
[stationID] => 4
[stationLocation] => Gondola Top
[timestamp] => 2013-12-19 10:55:26
[Pressure] => 30319
[TempOut] => 7
[WindSpeed] => 10
[WindDir] => 14
[HumOut] => 83
[WetBulb] => -0.760
)
[Mid-Mountain] => stdClass Object (
[stationID] => 5
[stationLocation] => Mid-Mountain
[timestamp] => 2013-12-19
10:55:32
[Pressure] => 30347
[TempOut] => 9
[WindSpeed] => 0
[WindDir] => 72
[HumOut] => 82
[WetBulb] => 1.04
)
[Old Gondola Base] => stdClass
Object (
[stationID] => 7
[stationLocation] => Old Gondola
Base
[timestamp] => 2013-12-19 10:55:38
[Pressure] => 30445
[TempOut] => -116
[WindSpeed] => 0
[WindDir] => 10
[HumOut] => 85
[WetBulb] => -119.9
)
)
The objects produced by the decoding of the JSON string each contain the same data with the object key/name being the station name.
The remaining values can be read as follows:
- stationID : Internal ID number for the station.
- stationLocation : A descriptive string indicating the location of the station.
- timestamp : The date and time the reading was collected in a standard format.
- Pressure : The barometric pressure in kPa
- TempOut : Outside temp in 10ths of a degree fahrenheit
- WindSpeed : Wind speed at time of reading in km/h
- WindDir : Mean wind direction for this station at time of reading in degrees with zero being north.
- HumOut : Relative Humidity (%)
- WetBulb : Outside wet bulb temp in 10ths of a degree fahrenheit
Event Information
Upcomimg events can be found in our events feed at http://api.skilouise.com/events-feed.php