I agree - but it is probably only a matter of time before they get you too
Iāll have to do some sums. . .
Official sites at aqicn are updated every hour, but it does seems a pity if you canāt get your own data in less time than that. . .
I have mine set to 30 mins.
Because a lot of users have āfreeā APIs you may have to consider writing a new API call for those of us who are being charged. Does that make sense?
Yes we do. Also temperature and humidity are used in the blocks/pop-up
Attached a zip of: PWS_load_files.php|09|2023-09-04|
Only for users with a new PurpleAir sensor who nowadays can get a paid-for API only.
We use 12 points for every data load.
Currently the script loads the data every 100 ā 120 seconds when a user / browser window is active
The cron-job is normally executed every 600 seconds.
Worst case (24 hours multiple open browser-windows) the 1.000.000 free points run out after 115 days. In real life the free poionts should last a few years.
One could change the line 347 from
$allowed_age = $purpleRefresh*$times;
to a lesser use, f.i. every 10 minutes
$allowed_age = 5 * $purpleRefresh*$times;
Then the free/bought points will last multiple years for sure.
Could you have two types of API calls? An initial one that gets a full set of data including name, latitude and longitude which are then stored. Subsequent calls donāt fetch those values which presumably will rarely, if ever, change. That would be a 25% saving on points for most calls.
But I have to change 3 scripts which retrieve the data in that case.
And write a āHowToā description
But AFAICS the general fields are not charged.
Only the sensor fields.
I think I get 12 points charged for 1 download of 22 items which has 12 sensor data and 10 general fields
I need more testing as i tried many different API-calls
I will do more testing tomorrow as todays figures are a mess.
Latest tests show 25 points for the API-call, sadly all fields are counted.
users who were so unlucky to recently buy a PurpleAir sensor better set the $purpleRefresh in line 50 of PWS_settings to 300.
The data will be refreshed every 5 minutes by the cron-job.
That will lower the daily points used to 25 (points) * 24 (hours) * 12 (cron) = 7.200 points / day
The free and 10$ points will last 138 days.
If you consider buying a PurpleAir sensor you have to spent another 30$ yearly to have your AQ measurements on your website.
Consider other AQ sensors which still allow to retrieve ones own data for free from the sellers network .
$purpleRefresh currently set at 600 (I donāt use the cron), and Iāve got down to 18 points per call by deleting name, lat, long, temp and hum (temp/hum worth 2 points each!). So that should give me (worst case) 18 * 24 * 6 = 2,592 points/day ā 386 days/million points. In practice my dashboard is only running for about 15 hours/day
Iāve āhard-wiredā name, lat and long into AQ_purpleair_c_block.php
PurpleAir API
In the past PurpleAir had a very simple free API without a key
They changed to one with a free key as larger players downloaded the data of all stations.
Now they charge new ācustomersā to get their own data.
And probably to old customers also in the near? future
PurpleAir CustomUpload
PurpleAir had/has code in its sensor to upload to your own website, similar to Ecowitt.
Although the āregister pageā still allows to enter credentials, it does not work in the past years. At least for my two PurpleAir sensors and for a dozen Leuven script users.
Luftdaten API
Still free. They use donations
Luftdaten CustomUpload
Not functional anymore but as long as we can download for free, nobody uses that custom-upload.
WL.com is free but limited functionality compared to the paid-for version
Ecowitt Allows custom upload and free API access to ecowitt.net
GAIA A12 ??? This time they promise a good API and maybe a local access.
Most sensors can be accessed for their data from the local network.
PurpleAir IP/json
Luftdaten IP/data.json
WL-AirLink IP/v1/current_conditions
But to get the data to the user-website can be a tedious task, so use a 24/7 weather-program for that.
I think that other AQ, lightning a.s.o. sensor-manufacturers will follow the same path as PurpleAir.
There is no money in offering a free website and allow others to download the data for free.
Similar to what we have seen with WeatherUnderground, but WU gives us a free API with a decent daily allowance plus a free weather-forecast.
PurpleAir is the first one I know of to ask money after you bought an expensive device
They not even allow our sensor we fully paid for, to upload the sensor-data to another website
I attach the setup for PurpleAir.
Maybe the newer PurpleAir-sensors can do the custom upload again.