WXforum.net

Weather Software => WeatherLink/weatherlink.com by Davis Instruments => Topic started by: saratogaWX on January 09, 2018, 07:43:41 PM

Title: WeatherLink.com API for data retrieval
Post by: saratogaWX on January 09, 2018, 07:43:41 PM
Wim,
I sent you an email with the response I got from Davis about the API.  The good news is that there IS an API replacement to the xml.php script, and it is available in both XML and JSON format.  The bad news is that it now requires the Davis Device ID and Davis Key (along with the weatherlink.com password for the registered user 'owning' the station).

I've rewritten slightly the WLCOM-plugin to use the new API and tested it with both a V1 website system and a V2 website system (both are WeatherLink 6.0.3 software submissions).  See here (https://www.wxforum.net/index.php?topic=31970.msg340938#new) for more info.

What I don't know is how easy/hard it is to get the Device ID/Key for WLIP owners (since I don't have WLIP available).
Title: Re: WeatherLink.com API for data retrieval
Post by: saratogaWX on January 09, 2018, 07:52:33 PM
For the record, here was the query I posted to the Davis Webmaster:
Quote
Gentlefolks,

With the V1.0 of weatherlink.com, you offered the xml.php script to obtain weather station conditions using user:pass access.

That appears to be missing in the V2.0 of your website.  Wim van der Kuil and I both wrote plugins for our weather software PHP website templates to allow users of the IP interface to have their own personal weather websites while submitting data directly to weatherlink.com.

Are there any plans (or could plans be made) to offer a similar interface (authenticated by user:pass) to return either the current XML data or a JSON equivalent?  It would be really helpful if you could do this.

My template set:  https://saratoga-weather.org/wxtemplates/  and the WLCOM V1.0 plugin configuration at
https://saratoga-weather.org/wxtemplates/Settings-config-WLCOM.php

Thanks in advance!

--

Best regards,
Ken

I received their response today
Quote
As a registered Davis API user you are receiving this email as a notice of important and upcoming changes to WeatherLink.com and its API.  Very soon, but no earlier than Nov 27, 2017, we will release a new website at weatherlink.com.  This new site will have, among other new features, a new live weather data page, the ability to graph your historical data and one username for all your Davis equipment that is pushing data to us.

When this site goes live, any new user added to the Davis network will be registered into this new site.  Customers who have previously registered will stay on the original version of weatherlink.com until we migrate them over to the new site in the coming months.

How you use the API to access data from users registered on the new site will change. Since the new site allows for one username for many weather stations your API call now must reference not the username and password but the DID and the account password.

·         You can still use the old method to access data from users registered on the original site... at least for a few months until all original users are migrated to the new site.

·         The new method will retrieve data from both sites... systems added to the new website AND older systems added to the original website.  You can use this new URL for all registered users.

·         If you have problems making this change quickly there is a workaround that will allow you to register new users on the original website even after the new site goes live... at least for a few months until all original users are migrated to the new site.

You’ll notice below that the URL is essentially the same but you will substitute the DID into the “user” field.

OLD method – Can only be used to access data registered on the original website.

XML
Current Conditions
http://api.weatherlink.com/v1/NoaaExt.xml?user=username&pass=password&apiToken=tokenID

Station Meta Data
http://api.weatherlink.com/v1/StationStatus.xml?user=username&pass=password&apiToken=tokenID

JSON
Current Conditions
http://api.weatherlink.com/v1/NoaaExt.json?user=username&pass=password&apiToken=tokenID

Station Meta Data
http://api.weatherlink.com/v1/StationStatus.json?user=username&pass=password&apiToken=tokenID

NEW method – can access data on both the original website and the new website

XML
Current Conditions
http://api.weatherlink.com/v1/NoaaExt.xml?user=DID&pass=password&apiToken=tokenID

Station Meta Data
http://api.weatherlink.com/v1/StationStatus.xml?user=DID&pass=password&apiToken=tokenID

JSON
Current Conditions
http://api.weatherlink.com/v1/NoaaExt.json?user=DID&pass=password&apiToken=tokenID

Station Meta Data
http://api.weatherlink.com/v1/StationStatus.json?user=DID&pass=password&apiToken=tokenID


DID=DeviceID
tokenID = Key

The XML returned from the query uses the same structure as the prior xml.php script returned, so no changes were needed there :)
Title: Re: WeatherLink.com API for data retrieval
Post by: dalecoy on January 09, 2018, 07:55:22 PM
What I don't know is how easy/hard it is to get the Device ID/Key for WLIP owners (since I don't have WLIP available).

I don't have a WLIP.  I had no problem legitimately getting a DID and Key.
Title: Re: WeatherLink.com API for data retrieval
Post by: Jáchym on January 09, 2018, 08:01:38 PM
MT only uses current conditions from the XML, will that remain?
Title: Re: WeatherLink.com API for data retrieval
Post by: saratogaWX on January 09, 2018, 08:55:37 PM
Yes, the structures are mostly identical.  I've attached my stations old and new API queries to see them both.
Title: Re: WeatherLink.com API for data retrieval
Post by: wvdkuil on January 10, 2018, 03:35:47 AM
Wim,
 . . shortened . .

What I don't know is how easy/hard it is to get the Device ID/Key for WLIP owners (since I don't have WLIP available).
That DID is printed on a sticker on their WLIP.
Current owners of a WLIP do not have an apiToken, key or tokenID.
They do not need to as they are only accessing their own data.
They access their data using the xml request with username / password which were set up when they registered at weatherlink.com after their WLIP started sending data.

Big question: Do all these users need to get their own API-key?
Preliminary answer: Or is it the version 2 key they will get when they are moved to v2.

username  => v1 username as used on the website to get the blue window?
https://www.weatherlink.com/user/wvdkuil/index.php?view=main&headers=1

password => v1 password as used on the website to get to the account info?

How do these WLIP v1 users get the apiToken.
All data is on v1, no v2 account possible as that will be automatically done later this year ?

Today we use this simple https://www.weatherlink.com/xml.php?user=wvdkuil&pass=******

We could, if we get an apiToken, use for our v1 data:
http://api.weatherlink.com/v1/NoaaExt.xml?user=wvdkuil&pass=******&apiToken=?????

Changing the scripts for the differences is not a big deal, but what is the procedure for an owner to get that API-key now to test the new links? AND can they use the same API

=== New and remaining questions:
Pro account needed for WLIP owners?
My test v2 account is now the basic one after the trial period AND that does not allow me to access my own data. Just the bullitin
Quote
Upgrade to WeatherLink Pro to view Data
The Data section allows you to access all your raw sensor data at the click of a button. You can sort by date/time or data type and export any data set directly to an Excel-friendly .csv file. Upgrade to WeatherLink Pro to start using charts today!
$3.95 / month
Maybe that is the cause that I will not get the api working at all.

Are the high-low values updated 1/ hour?
As the archive records are uploaded only 1/hour, does that also affects the high-low values in the API data? The v1 high-lows seems to be updated more frequent.

Still in a positive as their seems to be a solution, and ample time to get the scrips adapted to function before and after the roll-over from v1 to v2.

Wim
Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on January 10, 2018, 03:49:36 AM
What I don't know is how easy/hard it is to get the Device ID/Key for WLIP owners (since I don't have WLIP available).

Every device uploading to the weatherlink.com platform has a DID (either the MAC address for hardware devices like WLIP  - printed on the device's label - or Connect or a 'virtual' one in the case of the WLfW software).

I'm not sure that the tokenID is the same as the key, which may just be a string for initial sign-up. It may be a separate UUI-type token that you need to obtain from Davis on a per-account basis (remember that on WLC2, one account can have many stations reporting to it). Certainly, the CSV downloads from WLC2 need a UUI-type token.
Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on January 10, 2018, 04:04:31 AM
Just checked out the JSON URL and it seems to work OK with one of our stations on the 2.0 platform, for which we have the special token. For anyone interested the JSON array returned (probably needs parsing externally) is:

{"credit":"Davis Instruments Corp.","credit_URL":"http:\/\/www.davisnet.com","disclaimer_url":"http:\/\/www.davisnet.com\/about\/terms.asp","copyright_url":"http:\/\/www.davisnet.com\/about\/terms.asp","privacy_policy_url":"http:\/\/www.davisnet.com\/about\/privacy.asp","image":{"url":"http:\/\/www.weatherlink.com\/images\/Logo_Davis_reflxblu.jpg","title":"Davis WeatherLink","link":"http:\/\/www.weatherlink.com"},"suggested_pickup":"15 minutes after the hour","suggested_pickup_period":"60","dewpoint_c":"6.7","dewpoint_f":"44.0","dewpoint_string":"44.0 F (6.7 C)","heat_index_c":"7.2","heat_index_f":"45.0","heat_index_string":"45.0 F (7.2 C)","location":"Ely, England, UK","latitude":"52.40168","longitude":"0.26157","observation_time":"Last Updated on Jan 10 2018, 9:01 am GMT","observation_time_rfc822":"Wed, 10 Jan 2018 09:01:49 +0000","pressure_in":"29.569","pressure_mb":"1001.3","pressure_string":"1001.3 mb","relative_humidity":"96","station_id":"Prodata","temp_c":"6.9","temp_f":"44.5","temperature_string":"44.5 F (6.9 C)","wind_degrees":"206","wind_dir":"Southwest","wind_kt":"0.0","wind_mph":"0.0","windchill_c":"7.2","windchill_f":"45.0","windchill_string":"45.0 F (7.2 C)","davis_current_observation":{"DID":"001D0A00023B","station_name":"Ely-JGD","observation_age":18,"dewpoint_day_high_f":"44","dewpoint_day_high_time":"7:41am","dewpoint_day_low_f":"42","dewpoint_day_low_time":"12:00am","dewpoint_month_high_f":"50","dewpoint_month_low_f":"25","dewpoint_year_high_f":"50","dewpoint_year_low_f":"25","heat_index_day_high_f":"45","heat_index_day_high_time":"7:41am","heat_index_month_high_f":"52","heat_index_year_high_f":"52","pressure_day_high_in":"29.602","pressure_day_high_time":"12:00am","pressure_day_low_in":"29.540","pressure_day_low_time":"4:59am","pressure_month_high_in":"30.359","pressure_month_low_in":"29.015","pressure_tendency_string":"Rising Slowly","pressure_year_high_in":"30.359","pressure_year_low_in":"29.015","rain_day_in":"0.0000","rain_month_in":"0.5200","rain_rate_day_high_in_per_hr":"0.0000","rain_rate_hour_high_in_per_hr":"0.0000","rain_rate_in_per_hr":"0.0000","rain_rate_month_high_in_per_hr":"1.1300","rain_rate_year_high_in_per_hr":"1.1300","rain_storm_in":"0.0000","rain_year_in":"0.5200","relative_humidity_day_high":"96","relative_humidity_day_high_time":"7:35am","relative_humidity_day_low":"94","relative_humidity_day_low_time":"12:00am","relative_humidity_month_high":"97","relative_humidity_in":"34","relative_humidity_in_day_high":"36","relative_humidity_in_day_high_time":"6:13am","relative_humidity_in_day_low":"31","relative_humidity_in_day_low_time":"12:00am","relative_humidity_in_month_high":"52","relative_humidity_in_month_low":"25","relative_humidity_in_year_high":"52","relative_humidity_in_year_low":"25","sunrise":"8:04am","sunset":"4:16pm","temp_day_high_f":"44.5","temp_day_high_time":"7:41am","temp_day_low_f":"43.1","temp_day_low_time":"12:00am","temp_month_high_f":"51.0","temp_month_low_f":"29.8","temp_year_high_f":"51.0","temp_year_low_f":"29.8","temp_in_day_high_f":"67.1","temp_in_day_high_time":"9:00am","temp_in_day_low_f":"56.6","temp_in_day_low_time":"6:32am","temp_in_f":"67.1","temp_in_month_high_f":"70.3","temp_in_month_low_f":"52.4","temp_in_year_high_f":"70.3","temp_in_year_low_f":"52.4","wind_day_high_mph":"7.0","wind_day_high_time":"12:36am","wind_month_high_mph":"10.0","wind_ten_min_avg_mph":"0.0","wind_ten_min_gust_mph":"0.0","wind_year_high_mph":"10.0","windchill_day_low_f":"43","windchill_day_low_time":"12:00am","windchill_month_low_f":"30","windchill_year_low_f":"30"},"time_to_generate":"0.007430 seconds"}

Edit: Re-parsed version:

{
"credit":"Davis Instruments Corp.",
"credit_URL":"http://www.davisnet.com",
"disclaimer_url":"http://www.davisnet.com/about/terms.asp",
"copyright_url":"http://www.davisnet.com/about/terms.asp",
"privacy_policy_url":"http://www.davisnet.com/about/privacy.asp",
"image":{
"url":"http://www.weatherlink.com/images/Logo_Davis_reflxblu.jpg",
"title":"Davis WeatherLink",
"link":"http://www.weatherlink.com"
},
"suggested_pickup":"15 minutes after the hour",
"suggested_pickup_period":"60",
"dewpoint_c":"6.7",
"dewpoint_f":"44.0",
"dewpoint_string":"44.0 F (6.7 C)",
"heat_index_c":"7.2",
"heat_index_f":"45.0",
"heat_index_string":"45.0 F (7.2 C)",
"location":"Ely, England, UK",
"latitude":"52.40168",
"longitude":"0.26157",
"observation_time":"Last Updated on Jan 10 2018, 9:01 am GMT",
"observation_time_rfc822":"Wed, 10 Jan 2018 09:01:49 +0000",
"pressure_in":"29.569",
"pressure_mb":"1001.3",
"pressure_string":"1001.3 mb",
"relative_humidity":"96",
"station_id":"Prodata",
"temp_c":"6.9",
"temp_f":"44.5",
"temperature_string":"44.5 F (6.9 C)",
"wind_degrees":"206",
"wind_dir":"Southwest",
"wind_kt":"0.0",
"wind_mph":"0.0",
"windchill_c":"7.2",
"windchill_f":"45.0",
"windchill_string":"45.0 F (7.2 C)",
"davis_current_observation":{
"DID":"001D0A00023B",
"station_name":"Ely-JGD",
"observation_age":18,
"dewpoint_day_high_f":"44",
"dewpoint_day_high_time":"7:41am",
"dewpoint_day_low_f":"42",
"dewpoint_day_low_time":"12:00am",
"dewpoint_month_high_f":"50",
"dewpoint_month_low_f":"25",
"dewpoint_year_high_f":"50",
"dewpoint_year_low_f":"25",
"heat_index_day_high_f":"45",
"heat_index_day_high_time":"7:41am",
"heat_index_month_high_f":"52",
"heat_index_year_high_f":"52",
"pressure_day_high_in":"29.602",
"pressure_day_high_time":"12:00am",
"pressure_day_low_in":"29.540",
"pressure_day_low_time":"4:59am",
"pressure_month_high_in":"30.359",
"pressure_month_low_in":"29.015",
"pressure_tendency_string":"Rising Slowly",
"pressure_year_high_in":"30.359",
"pressure_year_low_in":"29.015",
"rain_day_in":"0.0000",
"rain_month_in":"0.5200",
"rain_rate_day_high_in_per_hr":"0.0000",
"rain_rate_hour_high_in_per_hr":"0.0000",
"rain_rate_in_per_hr":"0.0000",
"rain_rate_month_high_in_per_hr":"1.1300",
"rain_rate_year_high_in_per_hr":"1.1300",
"rain_storm_in":"0.0000",
"rain_year_in":"0.5200",
"relative_humidity_day_high":"96",
"relative_humidity_day_high_time":"7:35am",
"relative_humidity_day_low":"94",
"relative_humidity_day_low_time":"12:00am",
"relative_humidity_month_high":"97",
"relative_humidity_in":"34",
"relative_humidity_in_day_high":"36",
"relative_humidity_in_day_high_time":"6:13am",
"relative_humidity_in_day_low":"31",
"relative_humidity_in_day_low_time":"12:00am",
"relative_humidity_in_month_high":"52",
"relative_humidity_in_month_low":"25",
"relative_humidity_in_year_high":"52",
"relative_humidity_in_year_low":"25",
"sunrise":"8:04am",
"sunset":"4:16pm",
"temp_day_high_f":"44.5",
"temp_day_high_time":"7:41am",
"temp_day_low_f":"43.1",
"temp_day_low_time":"12:00am",
"temp_month_high_f":"51.0",
"temp_month_low_f":"29.8",
"temp_year_high_f":"51.0",
"temp_year_low_f":"29.8",
"temp_in_day_high_f":"67.1",
"temp_in_day_high_time":"9:00am",
"temp_in_day_low_f":"56.6",
"temp_in_day_low_time":"6:32am",
"temp_in_f":"67.1",
"temp_in_month_high_f":"70.3",
"temp_in_month_low_f":"52.4",
"temp_in_year_high_f":"70.3",
"temp_in_year_low_f":"52.4",
"wind_day_high_mph":"7.0",
"wind_day_high_time":"12:36am",
"wind_month_high_mph":"10.0",
"wind_ten_min_avg_mph":"0.0",
"wind_ten_min_gust_mph":"0.0",
"wind_year_high_mph":"10.0",
"windchill_day_low_f":"43",
"windchill_day_low_time":"12:00am",
"windchill_month_low_f":"30",
"windchill_year_low_f":"30"
},
"time_to_generate":"0.007430 seconds"
}
Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on January 10, 2018, 04:08:52 AM
And XML here:

<current_observation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:noNamespaceSchemaLocation="http://www.weather.gov/view/current_observation.xsd">
<credit>Davis Instruments Corp.</credit>
<credit_URL>http://www.davisnet.com</credit_URL>
<disclaimer_url>http://www.davisnet.com/about/terms.asp</disclaimer_url>
<copyright_url>http://www.davisnet.com/about/terms.asp</copyright_url>
<privacy_policy_url>http://www.davisnet.com/about/privacy.asp</privacy_policy_url>
<image>
<url>
http://www.weatherlink.com/images/Logo_Davis_reflxblu.jpg
</url>
<title>Davis WeatherLink</title>
<link>http://www.weatherlink.com</link>
</image>
<suggested_pickup>15 minutes after the hour</suggested_pickup>
<suggested_pickup_period>60</suggested_pickup_period>
<dewpoint_c>6.7</dewpoint_c>
<dewpoint_f>44.0</dewpoint_f>
<dewpoint_string>44.0 F (6.7 C)</dewpoint_string>
<heat_index_c>7.2</heat_index_c>
<heat_index_f>45.0</heat_index_f>
<heat_index_string>45.0 F (7.2 C)</heat_index_string>
<location>Ely, England, UK</location>
<latitude>52.40168</latitude>
<longitude>0.26157</longitude>
<observation_time>Last Updated on Jan 10 2018, 9:06 am GMT</observation_time>
<observation_time_rfc822>Wed, 10 Jan 2018 09:06:49 +0000</observation_time_rfc822>
<pressure_in>29.569</pressure_in>
<pressure_mb>1001.3</pressure_mb>
<pressure_string>1001.3 mb</pressure_string>
<relative_humidity>96</relative_humidity>
<station_id>Prodata</station_id>
<temp_c>7.0</temp_c>
<temp_f>44.6</temp_f>
<temperature_string>44.6 F (7.0 C)</temperature_string>
<wind_degrees>206</wind_degrees>
<wind_dir>Southwest</wind_dir>
<wind_kt>0.0</wind_kt>
<wind_mph>0.0</wind_mph>
<windchill_c>7.2</windchill_c>
<windchill_f>45.0</windchill_f>
<windchill_string>45.0 F (7.2 C)</windchill_string>
<davis_current_observation>
<DID>001D0A00023B</DID>
<station_name>Ely-JGD</station_name>
<observation_age>54</observation_age>
<dewpoint_day_high_f>44</dewpoint_day_high_f>
<dewpoint_day_high_time>7:41am</dewpoint_day_high_time>
<dewpoint_day_low_f>42</dewpoint_day_low_f>
<dewpoint_day_low_time>12:00am</dewpoint_day_low_time>
<dewpoint_month_high_f>50</dewpoint_month_high_f>
<dewpoint_month_low_f>25</dewpoint_month_low_f>
<dewpoint_year_high_f>50</dewpoint_year_high_f>
<dewpoint_year_low_f>25</dewpoint_year_low_f>
<heat_index_day_high_f>45</heat_index_day_high_f>
<heat_index_day_high_time>7:41am</heat_index_day_high_time>
<heat_index_month_high_f>52</heat_index_month_high_f>
<heat_index_year_high_f>52</heat_index_year_high_f>
<pressure_day_high_in>29.602</pressure_day_high_in>
<pressure_day_high_time>12:00am</pressure_day_high_time>
<pressure_day_low_in>29.540</pressure_day_low_in>
<pressure_day_low_time>4:59am</pressure_day_low_time>
<pressure_month_high_in>30.359</pressure_month_high_in>
<pressure_month_low_in>29.015</pressure_month_low_in>
<pressure_tendency_string>Rising Slowly</pressure_tendency_string>
<pressure_year_high_in>30.359</pressure_year_high_in>
<pressure_year_low_in>29.015</pressure_year_low_in>
<rain_day_in>0.0000</rain_day_in>
<rain_month_in>0.5200</rain_month_in>
<rain_rate_day_high_in_per_hr>0.0000</rain_rate_day_high_in_per_hr>
<rain_rate_hour_high_in_per_hr>0.0000</rain_rate_hour_high_in_per_hr>
<rain_rate_in_per_hr>0.0000</rain_rate_in_per_hr>
<rain_rate_month_high_in_per_hr>1.1300</rain_rate_month_high_in_per_hr>
<rain_rate_year_high_in_per_hr>1.1300</rain_rate_year_high_in_per_hr>
<rain_storm_in>0.0000</rain_storm_in>
<rain_year_in>0.5200</rain_year_in>
<relative_humidity_day_high>96</relative_humidity_day_high>
<relative_humidity_day_high_time>7:35am</relative_humidity_day_high_time>
<relative_humidity_day_low>94</relative_humidity_day_low>
<relative_humidity_day_low_time>12:00am</relative_humidity_day_low_time>
<relative_humidity_month_high>97</relative_humidity_month_high>
<relative_humidity_in>35</relative_humidity_in>
<relative_humidity_in_day_high>36</relative_humidity_in_day_high>
<relative_humidity_in_day_high_time>6:13am</relative_humidity_in_day_high_time>
<relative_humidity_in_day_low>31</relative_humidity_in_day_low>
<relative_humidity_in_day_low_time>12:00am</relative_humidity_in_day_low_time>
<relative_humidity_in_month_high>52</relative_humidity_in_month_high>
<relative_humidity_in_month_low>25</relative_humidity_in_month_low>
<relative_humidity_in_year_high>52</relative_humidity_in_year_high>
<relative_humidity_in_year_low>25</relative_humidity_in_year_low>
<sunrise>8:04am</sunrise>
<sunset>4:16pm</sunset>
<temp_day_high_f>44.6</temp_day_high_f>
<temp_day_high_time>9:03am</temp_day_high_time>
<temp_day_low_f>43.1</temp_day_low_f>
<temp_day_low_time>12:00am</temp_day_low_time>
<temp_month_high_f>51.0</temp_month_high_f>
<temp_month_low_f>29.8</temp_month_low_f>
<temp_year_high_f>51.0</temp_year_high_f>
<temp_year_low_f>29.8</temp_year_low_f>
<temp_in_day_high_f>67.2</temp_in_day_high_f>
<temp_in_day_high_time>9:05am</temp_in_day_high_time>
<temp_in_day_low_f>56.6</temp_in_day_low_f>
<temp_in_day_low_time>6:32am</temp_in_day_low_time>
<temp_in_f>67.2</temp_in_f>
<temp_in_month_high_f>70.3</temp_in_month_high_f>
<temp_in_month_low_f>52.4</temp_in_month_low_f>
<temp_in_year_high_f>70.3</temp_in_year_high_f>
<temp_in_year_low_f>52.4</temp_in_year_low_f>
<wind_day_high_mph>7.0</wind_day_high_mph>
<wind_day_high_time>12:36am</wind_day_high_time>
<wind_month_high_mph>10.0</wind_month_high_mph>
<wind_ten_min_avg_mph>0.0</wind_ten_min_avg_mph>
<wind_ten_min_gust_mph>0.0</wind_ten_min_gust_mph>
<wind_year_high_mph>10.0</wind_year_high_mph>
<windchill_day_low_f>43</windchill_day_low_f>
<windchill_day_low_time>12:00am</windchill_day_low_time>
<windchill_month_low_f>30</windchill_month_low_f>
<windchill_year_low_f>30</windchill_year_low_f>
</davis_current_observation>
<time_to_generate>0.007274 seconds</time_to_generate>
</current_observation>
Title: Re: WeatherLink.com API for data retrieval
Post by: wvdkuil on January 10, 2018, 09:37:37 AM
Stop worrying, be happy.

The old non-api xml link
https://www.weatherlink.com/xml.php?user=_USERNAME_&pass=_PASSWORD_

and the new api links
http://api.weatherlink.com/v1/NoaaExt.xml?user=_USERNAME_&pass=_PASSWORD_&apiToken=_KEY_
http://api.weatherlink.com/v1/NoaaExt.xml?user=_DID_&pass=_PASSWORD_&apiToken=_KEY_
all report the same weather-data.

The new links have a few overhead fields extra and 1 extra weather-item, the  <wind_ten_min_gust_mph>

A current WLIP user at the v1 website needs to
1. sign on at weatherlink.com v2 and create a new account
     with a new (for them)  e-mail address, username and password
     Do not use your current v1 account as you are redirected to the v1 site.
2. ADD 1 "weather-station" of the same type as your current one but use the USB logger option
3. The result is a "Weatherlink Network" box (check Ken's post above)
     with  a  "DeviceID"  and  "key" , which is the "apiKey" or "tokenID" or whatever its name
The only important part for now is that "key", you can forget that "DeviceID"

If you forgot the real DID of your WLIP and it is not easy accessible, create the link below and  execute in your bowser:
http://api.weatherlink.com/v1/NoaaExt.xml?user=_USERNAME_&pass=_PASSWORD_&apiToken=_KEY_
_USERNAME_  = the name used on v1 of weatherlink.com to view the blue screen
_PASSWORD_ = the password to access(together with your name) your weatherlink account
_KEY_  = the one you got with your new account
You will get the xml data for your current WLIP and scan that for a new non-weather field <DID>001D0A000070</DID>
Now you have your DID also.

If you have you own weatherscript to load the weathelink.com data, replace the
https://www.weatherlink.com/xml.php?user=_USERNAME_&pass=_PASSWORD_
with the new api link with your DID , password and key
http://api.weatherlink.com/v1/NoaaExt.xml?user=_DID_&pass=_PASSWORD_&apiToken=_KEY_
All data should be loaded OK. 
You can forget about a move from v1 to v2 as the link is already a v2 one, it is OK for now and then.

The Leuven script tagsWLCOM.php will be available 20 January.  After some extra testing time , but mostly because my wife insist on going on our planned 1 week vacation tomorrow morning.

Wim
Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on January 10, 2018, 09:49:53 AM
_KEY_  = the one you got with your new account

Can I just check: Have you confirmed that that short key actually works and that you don't need a new longer token?

ie does the download work for you from the 2.0 platform?
Title: Re: WeatherLink.com API for data retrieval
Post by: wvdkuil on January 10, 2018, 10:01:23 AM
_KEY_  = the one you got with your new account

Can I just check: Have you confirmed that that short key actually works and that you don't need a new longer token?

ie does the download work for you from the 2.0 platform?
Yes, the download works for both my new basic WLfW test station and for my (2) WLIP v1 stations and for another WLIPv1 station.

So it seems this new key can access all previous WLIP v1 stations as long as you know
1.  the username or DID
and
2. the v1 password.

I added on the same v2 account another USB station, received a new DID and key, used that new key, with the WLIP DID and password, and again: correct  data retrieved as with the previous key.

Which seems to be OK as the non-API link used until now can access all stations for which you have the correct username and password.

Wim
Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on January 10, 2018, 12:03:26 PM
Yes, the download works for both my new basic WLfW test station and for my (2) WLIP v1 stations and for another WLIPv1 station.

Hmm, that's a little odd - not what I would have expected. Actually it looks like the key isn't being checked at all at present - seems to work for me just omitting the key term from the URL altogether. I suspect that this situation may just be temporary and that a different, longer key may be needed in future. Maybe it's an additional check that Davis haven't decided whether to include or not as yet.
Title: Re: WeatherLink.com API for data retrieval
Post by: wicked on January 10, 2018, 12:08:41 PM
For users like myself who have used only 2.0. Can I utilize the API links above with just me username and password or do I need to get an API token?
Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on January 10, 2018, 12:21:50 PM
For users like myself who have used only 2.0. Can I utilize the API links above with just me username and password or do I need to get an API token?

You need DID (not username) and password for 2.0.

Re the token, we don't know at present. Looks like the system has been designed to check for the token (but personally I don't this is the same as the sign-up key), but that check doesn't seem to be enabled at present AFAICS (unless some access token or IP address is being transparently remembered by my PC behind the scenes). You might be able to access with just the DID and a/c pw.
Title: Re: WeatherLink.com API for data retrieval
Post by: wicked on January 10, 2018, 01:05:52 PM
For users like myself who have used only 2.0. Can I utilize the API links above with just me username and password or do I need to get an API token?

You need DID (not username) and password for 2.0.

Re the token, we don't know at present. Looks like the system has been designed to check for the token (but personally I don't this is the same as the sign-up key), but that check doesn't seem to be enabled at present AFAICS (unless some access token or IP address is being transparently remembered by my PC behind the scenes). You might be able to access with just the DID and a/c pw.

mine also works with using my DID and password for 2.0 with no token.  thanks!
Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on January 10, 2018, 01:08:08 PM
mine also works with using my DID and password for 2.0 with no token.  thanks!

Interesting... Just be aware that this might not last (ie not needing the token).
Title: Re: WeatherLink.com API for data retrieval
Post by: wicked on January 10, 2018, 01:13:53 PM
mine also works with using my DID and password for 2.0 with no token.  thanks!

Interesting... Just be aware that this might not last (ie not needing the token).

I am guessing that you are saying that possibly in the future you will need a "pro" account which will give you the token, correct?
Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on January 10, 2018, 02:39:50 PM
I am guessing that you are saying that possibly in the future you will need a "pro" account which will give you the token, correct?

No, not necessarily, though it's a possibility. But the (direct) CSV downloads need a different type of token.
Title: Re: WeatherLink.com API for data retrieval
Post by: waiukuweather on January 10, 2018, 08:49:37 PM
easy change, works for me,thanks guys !
Title: Re: WeatherLink.com API for data retrieval
Post by: Aardvark on January 10, 2018, 11:43:39 PM
Wim,  before you leave,
So in the file wsUserSettings.php
where it has the user name and PW   now, we would replace that with the new username and password and it should work?   
Title: Re: WeatherLink.com API for data retrieval
Post by: wvdkuil on January 11, 2018, 01:52:28 AM
Wim,  before you leave,
So in the file wsUserSettings.php
where it has the user name and PW   now, we would replace that with the new username and password and it should work?
No, the link in the script itself had to be changed.  There is no hurry at all, just need some time to test. I have one testsite, my own backup site. If that works for a week, and if I get an answer about the api-key it is time to test on a real production site as yours. I contact you ASAP.
Wim
Title: Re: WeatherLink.com API for data retrieval
Post by: waiukuweather on January 11, 2018, 02:02:48 AM
the apitoken you set as the key that is on the side of the IP data logger
and the username you set as the DID number
and then the password is the password you have when logging into weatherlink.com
Title: Re: WeatherLink.com API for data retrieval
Post by: wicked on February 20, 2018, 12:38:46 PM
I may be missing this - but the json and xml files do not have/report THSW index.  I do see heat index.  Anyone know why this is not passed?
Title: Re: WeatherLink.com API for data retrieval
Post by: dalecoy on February 20, 2018, 02:25:34 PM
I may be missing this - but the json and xml files do not have/report THSW index.  I do see heat index.  Anyone know why this is not passed?

Because current THSW index is not available.
Title: Re: WeatherLink.com API for data retrieval
Post by: wicked on February 20, 2018, 03:27:32 PM
I may be missing this - but the json and xml files do not have/report THSW index.  I do see heat index.  Anyone know why this is not passed?

Because current THSW index is not available.

Is this by design or some limitation? I find THSW very useful.

I use WL2.0 And wanted to build a custom webpage and was hoping to show THSW.

In WL2.0 the only place to get THSW is in the chart area. They do not show it on the bulletin page, the mobilize page or the mobilize app. It does in fact show it in their weatherlink app - although update frequency seems once an hour at best.

What’s interesting is that for mobilize (both app and web) the field is there but it only populates “- -“

So it seems they have the data since it’s show accurately in the chart (and my VP2 console) and I opened a ticket with them for the app not populating the field.



Screen shots:

Mobilize app - iPhone:

 [ You are not allowed to view attachments ]



WL iphone app:

 [ You are not allowed to view attachments ]



WL2.0 website - chart tab:

 [ You are not allowed to view attachments ]



WL2.0 website - mobilize tab:

 [ You are not allowed to view attachments ]
Title: Re: WeatherLink.com API for data retrieval
Post by: dalecoy on February 20, 2018, 04:11:58 PM
I may be missing this - but the json and xml files do not have/report THSW index.  I do see heat index.  Anyone know why this is not passed?

Because current THSW index is not available.

Is this by design or some limitation? I find THSW very useful.

I use WL2.0 And wanted to build a custom webpage and was hoping to show THSW.

In WL2.0 the only place to get THSW is in the chart area. They do not show it on the bulletin page, the mobilize page or the mobilize app. It does in fact show it in their weatherlink app - although update frequency seems once an hour at best.

What’s interesting is that for mobilize (both app and web) the field is there but it only populates “- -“

So it seems they have the data since it’s show accurately in the chart (and my VP2 console) and I opened a ticket with them for the app not populating the field.


I hope you are successful - but this link from 8 years ago says I had been asking for that for over 3 years....

http://www.wxforum.net/index.php?topic=6666.msg63732#msg63732

THW may be available, along with "Daily High THSW".  (I'm just going by the available tags in WeatherLink software)
Title: Re: WeatherLink.com API for data retrieval
Post by: Aardvark on February 20, 2018, 04:37:28 PM
I find THSW  very useful for those days I want the air conditioner on and the wife doesn't.  I put it up on the Kitchen Console and we have coolness in the summer.
I do  believe that Weatherdisplay has those tags. 

However, neither does Weatherlink 1.0; Weatherlink 2.0 or the app for whatever platform you use, have that sent or calculated.   I suspect someone could dig out the formula and write a script that has that calculation.  I do see that the WL 2.0 phone app has that.  Perhaps the best route would be to contact Davisnet and ask them to put that tag out there.   They did say that the desktop (computer) based software was no longer to be supported.

Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on February 20, 2018, 04:47:22 PM
They did say that the desktop (computer) based software was no longer to be supported.

To be accurate, Davis have intimated that local Weatherlink is not likely to be significantly developed any further, which is something different from not being supported. So if there's anything new with Windows, USB drivers etc that is incompatible with WL603 then a new WL version with fixes is likely to appear. Indeed I think there might be one pending to deal with some potential issue, but can't quite remember what.
Title: Re: WeatherLink.com API for data retrieval
Post by: Aardvark on March 16, 2018, 03:36:50 PM
This is what I found for WL 2.0  Not sure if it is only for pro or not, but on their user site there is a place to generate the API for your WL2.0
Title: Re: WeatherLink.com API for data retrieval
Post by: kunnskap on May 04, 2018, 04:52:48 PM
Hello,

I am a French developer. I created Oras, a free application that retrieves data sent by Weatherlink dataloggers. For this, Oras retrieves the data from the website api.weatherlink.com

Basically, this software is a request from my brother (https://www.facebook.com/MeteoVaroise/), who needed to recover and export this data. I make it available for free if it can be used by others.

The development is in stand-by for the moment, but other functionalities will be able to see the day according to the returns of the users (in particular, other possibilities of export of the recovered data).

For the moment it is not yet translated into English, only in French.

You can download Oras here : http://anthonylaurito.fr/devbox/ (http://anthonylaurito.fr/devbox/)

Thank you
Anthony
Title: Re: WeatherLink.com API for data retrieval
Post by: neavilag on June 26, 2018, 09:24:31 PM
Hi All, I have been using the WL api to get data from stations reporting every 1h, but sometimes the station has no connection so I miss data that I am storing my side.

I see that missed data was transmitted in WL, Since API only shows most recent value not history I cannot "fill" missed values without going to download data and process

is there an API endpoint to get history like querying ?from=20180601&to=20180602 for example ?

regards
Title: Re: WeatherLink.com API for data retrieval
Post by: saratogaWX on June 26, 2018, 10:03:36 PM
AFAIK, they've not announced a historical retrieval function in the API .. 5/18/2018 doc here https://www.weatherlink.com/static/docs/APIdocumentation.pdf
Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on June 27, 2018, 03:17:39 AM
It's in binary rather than in JSON or XML format, but of course the web download protocol (explained in the Serial API document) does just this - ie retrieves all summary/archive data over a specified date range from wl.com. For anyone wanted to maintain an independent database of weather data it's probably a better approach than trying to capture all the individual real-time readings.
Title: Re: WeatherLink.com API for data retrieval
Post by: neavilag on June 27, 2018, 09:36:12 AM
Thank you for your reply saratogaWx

Thank you johnD, can you give me more info/links about this binary output.

Regards
It's in binary rather than in JSON or XML format, but of course the web download protocol (explained in the Serial API document) does just this - ie retrieves all summary/archive data over a specified date range from wl.com. For anyone wanted to maintain an independent database of weather data it's probably a better approach than trying to capture all the individual real-time readings.

Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on June 27, 2018, 10:22:03 AM
Download the Serial Tech Ref document from the Davis support site and look at the Web Download section.

Although this document largely applies to downloads direct from the logger, the web download section deal with downloads from wl.com. Remember if you're on the 2.0 platform then you need the DID in place of user name plus the account password.
Title: Re: WeatherLink.com API for data retrieval
Post by: sho23 on August 14, 2018, 04:12:04 PM
I'm having trouble trying to use the api links listed above.

I have the DID and Key from the side of the WeatherlinkIP
I have the Username and Password to log into weatherlink.com.

https://api.weatherlink.com/v1/NoaaExt.xml?user=DID&pass=Password&apiToken=Key

What am I doing wrong?

There is also no option to generate the token (see attached)
Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on August 14, 2018, 04:27:30 PM
I think they've temporarily broken the little utility that provides the APIToken in yesterday's 2.0 update. But you can still find if you go to the Device|Station URL tab and 'Copy' one of the links. This will paste the full URL to the clipboard so paste this into eg a blank notepad and copy the APIToken from there.
Title: Re: WeatherLink.com API for data retrieval
Post by: sho23 on August 14, 2018, 07:26:42 PM
I think they've temporarily broken the little utility that provides the APIToken in yesterday's 2.0 update. But you can still find if you go to the Device|Station URL tab and 'Copy' one of the links. This will paste the full URL to the clipboard so paste this into eg a blank notepad and copy the APIToken from there.

Using the DID and the account password, combined with the long string of copy pasted values from the links ... did not work either.
Maybe I should just wait for another 1-2 weeks.
Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on August 15, 2018, 03:06:24 AM
If you have the correct credentials then it should work - I've just checked the XML option and it works fine for me.

But it's very easy to have a minor error in the way that the overall URL string is assembled, eg a space between the '=' sign and the following data item (there should be no spaces). Unless the syntax of the URL string is _exactly_ correct then the platform will return an error.
Title: Re: WeatherLink.com API for data retrieval
Post by: sho23 on August 20, 2018, 11:36:25 AM
The option to generate token is now working.

I'm sure it's just something stupid I missed, but I've tried the following..
Where
DID and KEY are from the WeatherlinkIP
Pass is used to login to Weatherlink.com
TOKEN is generated on Weatherlink account information page.

1. https://api.weatherlink.com/v1/NoaaExt.xml?user=DID&pass=PASS&apiToken=TOKEN
2. https://api.weatherlink.com/v1/NoaaExt.xml?user=_DID_&pass=_PASS_&apiToken=_TOKEN_
3. https://api.weatherlink.com/v1/NoaaExt.xml?user=DID&pass=PASS&apiToken=KEY
4. https://api.weatherlink.com/v1/NoaaExt.xml?user=_DID_&pass=_PASS_&apiToken=_KEY_

Sadly none of them worked... my pass have symbols in it - shouldn't matter, right?
Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on August 20, 2018, 11:41:58 AM
Sadly none of them worked... my pass have symbols in it - shouldn't matter, right?

Hmm, wouldn't guarantee it - something at the back of my mind says I might have had past problems with special characters in WL passwords, but can't recall exact details. Are you not able to reset the pw to simple alphanumeric and check?
Title: Re: WeatherLink.com API for data retrieval
Post by: sho23 on August 20, 2018, 01:11:59 PM
Hmm, wouldn't guarantee it - something at the back of my mind says I might have had past problems with special characters in WL passwords, but can't recall exact details. Are you not able to reset the pw to simple alphanumeric and check?

YES

https://api.weatherlink.com/v1/NoaaExt.xml?user=DID&pass=PASS&apiToken=TOKEN

It does not accept symbols - alphanumeric works. I wish there was a note about it.
Title: Re: WeatherLink.com API for data retrieval
Post by: wvdkuil on August 20, 2018, 01:40:20 PM
Hmm, wouldn't guarantee it - something at the back of my mind says I might have had past problems with special characters in WL passwords, but can't recall exact details. Are you not able to reset the pw to simple alphanumeric and check?

YES

https://api.weatherlink.com/v1/NoaaExt.xml?user=DID&pass=PASS&apiToken=TOKEN

It does not accept symbols - alphanumeric works. I wish there was a note about it.
For a password you type yourself in a field you can use a lot more characters then only alphanumeric ones.

But you are using an URL and there are a lot of characters which are forbidden to be used in an URL as they can have special meanings. If you want to use those "strange / special " characters in an URL you have to encode them.

Google is your friend, this is an example: https://perishablepress.com/stop-using-unsafe-characters-in-urls/

Wim
Title: Re: WeatherLink.com API for data retrieval
Post by: sho23 on August 22, 2018, 12:17:03 PM

For a password you type yourself in a field you can use a lot more characters then only alphanumeric ones.

But you are using an URL and there are a lot of characters which are forbidden to be used in an URL as they can have special meanings. If you want to use those "strange / special " characters in an URL you have to encode them.

Google is your friend, this is an example: https://perishablepress.com/stop-using-unsafe-characters-in-urls/

Wim

Aye. I had an inkling about that but decided to doubt myself. I was quadruple checking everything else. Did I swap the 0 with a O, or I with L, or what.
Oh well, lesson learned. Thanks!
Title: Re: WeatherLink.com API for data retrieval
Post by: stefano90 on November 02, 2018, 10:09:49 AM
Hi all,

I hear that in the near future Davis will begin to throttle API requests and Basic units can only be queried every 15 minutes.  Pro units can be queries every 5 minutes and Pro+ units can be queried every 1 minute.

Now this limitation is only for thirdy-part upload but if this will be happens is a very bad news. I have already started with some protest emails.
Title: Re: WeatherLink.com API for data retrieval
Post by: johnd on November 07, 2018, 04:27:40 AM
I hear that in the near future Davis will begin to throttle API requests and Basic units can only be queried every 15 minutes.  Pro units can be queries every 5 minutes and Pro+ units can be queried every 1 minute.

Now this limitation is only for thirdy-part upload but if this will be happens is a very bad news.

It does seem that this is likely to happen in the coming months and TBH from what I hear I doubt that the plan is likely to be altered. So this change is definitely to be expected at some point during 2019, maybe Q2?

Personally, I've never been very convinced by the need for 1-minute updates - still much too slow for live wind data and yet other weather parameters typically don't change much from one minute to the next. But 5-minute updates are more useful.