@pfmiller When i add my API key, the private key and specify my sensor index i get
No sensors found in search area.
I dug into it a bit and it looks the the search query is not valid. I was able to hack it up a bit to get the search query to work, but the json response is WAY different then what your code is expecting. Let me know if its still worth supporting private devices or if itβs best to support public only.
JSON output of:
https://api.purpleair.com/v1/sensors/%sensorindex%?read_key=%Private key%
{
"api_version": "V1.0.10-0.0.17",
"time_stamp": 1654295776,
"data_time_stamp": 1654295737,
"sensor": {
"sensor_index": 46491,
"last_modified": 1579901318,
"date_created": 1579615688,
"last_seen": 1654295691,
"private": 1,
"is_owner": 0,
"name": "Norwalk Square Inside",
"icon": 0,
"location_type": 1,
"model": "PA-II",
"hardware": "2.0+BME280+PMSX003-B+PMSX003-A",
"led_brightness": 15,
"firmware_version": "6.01",
"firmware_upgrade": "6.06a",
"rssi": -57,
"uptime": 3,
"memory": 15536,
"position_rating": 5,
"latitude": 30.289534,
"longitude": -97.77127,
"altitude": 540,
"channel_state": 3,
"channel_flags": 0,
"channel_flags_manual": 0,
"channel_flags_auto": 0,
"confidence": 100,
"confidence_auto": 100,
"confidence_manual": 100,
"humidity": 31,
"humidity_a": 31,
"temperature": 88,
"temperature_a": 88,
"pressure": 991.8,
"pressure_a": 991.84,
"analog_input": 0.0,
"pm1.0": 17.5,
"pm1.0_a": 16.8,
"pm1.0_b": 18.2,
"pm1.0_atm": 17.5,
"pm1.0_cf_1": 17.5,
"pm2.5": 27.3,
"pm2.5_a": 26.2,
"pm2.5_b": 28.4,
"pm2.5_atm": 27.2,
"pm2.5_cf_1": 27.3,
"pm2.5_alt": 16.7,
"pm2.5_alt_a": 16.2,
"pm2.5_alt_b": 17.3,
"pm10.0": 30.9,
"pm10.0_a": 30.0,
"pm10.0_b": 31.8,
"pm10.0_atm": 30.9,
"pm10.0_cf_1": 30.9,
"scattering_coefficient": 46.3,
"scattering_coefficient_a": 46.2,
"scattering_coefficient_b": 46.3,
"deciviews": 18.8,
"deciviews_a": 18.8,
"deciviews_b": 18.8,
"visual_range": 59.5,
"visual_range_a": 59.6,
"visual_range_b": 59.5,
"0.3_um_count": 3083,
"0.3_um_count_a": 3082,
"0.3_um_count_b": 3085,
"0.5_um_count": 924,
"0.5_um_count_a": 883,
"0.5_um_count_b": 966,
"1.0_um_count": 189,
"1.0_um_count_a": 182,
"1.0_um_count_b": 196,
"2.5_um_count": 17,
"2.5_um_count_a": 16,
"2.5_um_count_b": 18,
"5.0_um_count": 3,
"5.0_um_count_a": 2,
"5.0_um_count_b": 4,
"10.0_um_count": 0,
"10.0_um_count_a": 1,
"10.0_um_count_b": 0,
"pm1.0_atm_a": 16.8,
"pm2.5_atm_a": 26.22,
"pm10.0_atm_a": 30.05,
"pm1.0_cf_1_a": 16.8,
"pm2.5_cf_1_a": 26.22,
"pm10.0_cf_1_a": 30.05,
"pm1.0_atm_b": 18.18,
"pm2.5_atm_b": 28.22,
"pm10.0_atm_b": 31.8,
"pm1.0_cf_1_b": 18.18,
"pm2.5_cf_1_b": 28.36,
"pm10.0_cf_1_b": 31.8,
"primary_id_a": 966657,
"primary_key_a": "HV4R1GXN3HCTB0C6",
"primary_id_b": 966659,
"primary_key_b": "6PIPXP9HQOFYX1WJ",
"secondary_id_a": 966658,
"secondary_key_a": "TEWT0HJJ8NMV4IEN",
"secondary_id_b": 966660,
"secondary_key_b": "ZRKBF1H9SN03X9L3",
"stats": {
"pm2.5": 27.3,
"pm2.5_10minute": 40.4,
"pm2.5_30minute": 36.0,
"pm2.5_60minute": 26.2,
"pm2.5_6hour": 27.2,
"pm2.5_24hour": 21.4,
"pm2.5_1week": 12.9,
"time_stamp": 1654295691
},
"stats_a": {
"pm2.5": 26.2,
"pm2.5_10minute": 38.8,
"pm2.5_30minute": 34.5,
"pm2.5_60minute": 25.2,
"pm2.5_6hour": 26.4,
"pm2.5_24hour": 20.8,
"pm2.5_1week": 12.6,
"time_stamp": 1654295691
},
"stats_b": {
"pm2.5": 28.4,
"pm2.5_10minute": 42.0,
"pm2.5_30minute": 37.5,
"pm2.5_60minute": 27.3,
"pm2.5_6hour": 28.1,
"pm2.5_24hour": 21.9,
"pm2.5_1week": 13.2,
"time_stamp": 1654295691
}
}
}