API data varies from Local Data

Hi,
I am quite new to accessing this API. When get the json from my sensor locally, I see what I see on the Purple Air Real Time Map - An AQI of 93.
When I access the data from the API, I see it as much lower - 32.6.
I don’t think I am accessing the wrong sensor via the API. The name is correct.
Any suggestions?
My data is below.
Thanks,
Doug
Local json data:
{
“SensorId”: “xxx”,
“DateTime”: “2025/03/14T09:42:42z”,
“Geo”: “xxx”,
“Mem”: 9568,
“memfrag”: 26,
“memfb”: 6920,
“memcs”: 448,
“Id”: 111,
“lat”: 27.6938,
“lon”: 85.294403,
“Adc”: 0.02,
“loggingrate”: 15,
“place”: “outside”,
“version”: “7.04”,
“uptime”: 6462,
“rssi”: -53,
“period”: 120,
“httpsuccess”: 108,
“httpsends”: 108,
“hardwareversion”: “3.0”,
“hardwarediscovered”: “3.0+OPENLOG+NO-DISK+RV3028+BME68X+KX122+PMSX003-A+PMSX003-B”,
“current_temp_f”: 106,
“current_humidity”: 9,
“current_dewpoint_f”: 37,
“pressure”: 866.79,
“current_temp_f_680”: 106,
“current_humidity_680”: 9,
“current_dewpoint_f_680”: 37,
“pressure_680”: 866.79,
“gas_680”: 63.18,
“p25aqic_b”: “rgb(255,148,0)”,
“pm2.5_aqi_b”: 97,
“pm1_0_cf_1_b”: 28.11,
“p_0_3_um_b”: 4859.39,
“pm2_5_cf_1_b”: 37.09,
“p_0_5_um_b”: 1410.06,
“pm10_0_cf_1_b”: 42.59,
“p_1_0_um_b”: 227.41,
“pm1_0_atm_b”: 23.69,
“p_2_5_um_b”: 18.35,
“pm2_5_atm_b”: 33.59,
“p_5_0_um_b”: 9.22,
“pm10_0_atm_b”: 41.83,
“p_10_0_um_b”: 2.41,
“p25aqic”: “rgb(255,173,0)”,
“pm2.5_aqi”: 93,
“pm1_0_cf_1”: 25.98,
“p_0_3_um”: 4561.66,
“pm2_5_cf_1”: 34.28,
“p_0_5_um”: 1340.34,
“pm10_0_cf_1”: 38.9,
“p_1_0_um”: 195.66,
“pm1_0_atm”: 22.62,
“p_2_5_um”: 17.91,
“pm2_5_atm”: 31.53,
“p_5_0_um”: 3.21,
“pm10_0_atm”: 38.86,
“p_10_0_um”: 0.34,
“pa_latency”: 574,
“response”: 201,
“response_date”: 1741945255,
“latency”: 1746,
“wlstate”: “Connected”,
“status_0”: 2,
“status_1”: 0,
“status_2”: 2,
“status_3”: 2,
“status_4”: 2,
“status_6”: 2,
“ssid”: “xxx”
}

API Data:
{
“api_version” : “V1.0.14-0.0.58”,
“time_stamp” : 1741945330,
“data_time_stamp” : 1741945279,
“sensor” : {
“sensor_index” : 212941,
“last_modified” : 1741073346,
“date_created” : 1707263094,
“last_seen” : 1741945253,
“private” : 0,
“is_owner” : 0,
“name” : “Rabi Bhawan”,
“icon” : 0,
“location_type” : 0,
“model” : “PA-II-FLEX”,
“hardware” : “3.0+OPENLOG+NO-DISK+RV3028+BME68X+KX122+PMSX003-A+PMSX003-B”,
“led_brightness” : 35,
“firmware_version” : “7.04”,
“rssi” : -55,
“uptime” : 105,
“pa_latency” : 702,
“memory” : 5872,
“position_rating” : 0,
“latitude” : 27.693815,
“longitude” : 85.294426,
“altitude” : 4279,
“channel_state” : 3,
“channel_flags” : 0,
“channel_flags_manual” : 0,
“channel_flags_auto” : 0,
“confidence” : 100,
“confidence_auto” : 100,
“confidence_manual” : 100,
“humidity” : 9,
“humidity_a” : 9,
“humidity_b” : 9,
“temperature” : 105,
“temperature_a” : 105,
“temperature_b” : 105,
“pressure” : 866.8,
“pressure_a” : 866.8,
“pressure_b” : 866.8,
“voc” : 63.2,
“voc_b” : 63.18,
“analog_input” : 0.02,
“pm1.0” : 23.2,
“pm1.0_a” : 22.6,
“pm1.0_b” : 23.7,
“pm2.5” : 32.6,
“pm2.5_a” : 31.5,
“pm2.5_b” : 33.6,
“pm2.5_alt” : 21.5,
“pm2.5_alt_a” : 20.4,
“pm2.5_alt_b” : 22.7,
“pm10.0” : 40.3,
“pm10.0_a” : 38.9,
“pm10.0_b” : 41.8,
“scattering_coefficient” : 70.6,
“scattering_coefficient_a” : 68.4,
“scattering_coefficient_b” : 72.9,
“deciviews” : 22.5,
“deciviews_a” : 22.2,
“deciviews_b” : 22.8,
“visual_range” : 41.2,
“visual_range_a” : 42.3,
“visual_range_b” : 40.0,
“0.3_um_count” : 4710,
“0.3_um_count_a” : 4561,
“0.3_um_count_b” : 4859,
“0.5_um_count” : 1375,
“0.5_um_count_a” : 1340,
“0.5_um_count_b” : 1410,
“1.0_um_count” : 211,
“1.0_um_count_a” : 195,
“1.0_um_count_b” : 227,
“2.5_um_count” : 17,
“2.5_um_count_a” : 17,
“2.5_um_count_b” : 18,
“5.0_um_count” : 6,
“5.0_um_count_a” : 3,
“5.0_um_count_b” : 9,
“10.0_um_count” : 1,
“10.0_um_count_a” : 0,
“10.0_um_count_b” : 2,
“pm1.0_cf_1” : 27.0,
“pm1.0_cf_1_a” : 25.98,
“pm1.0_cf_1_b” : 28.11,
“pm1.0_atm” : 23.2,
“pm1.0_atm_a” : 22.62,
“pm1.0_atm_b” : 23.69,
“pm2.5_atm” : 32.6,
“pm2.5_atm_a” : 31.53,
“pm2.5_atm_b” : 33.59,
“pm2.5_cf_1” : 35.7,
“pm2.5_cf_1_a” : 34.28,
“pm2.5_cf_1_b” : 37.09,
“pm10.0_atm” : 40.3,
“pm10.0_atm_a” : 38.86,
“pm10.0_atm_b” : 41.83,
“pm10.0_cf_1” : 40.7,
“pm10.0_cf_1_a” : 38.9,
“pm10.0_cf_1_b” : 42.59,
“primary_key_a” : “0NXCQB3BZQHVL6R2”,
“stats” : {“pm2.5” : 32.6, “pm2.5_10minute” : 28.2, “pm2.5_30minute” : 23.6, “pm2.5_60minute” : 28.2, “pm2.5_6hour” : 65.7, “pm2.5_24hour” : 90.8, “pm2.5_1week” : 45.8, “time_stamp” : 1741945253},
“stats_a” : {“pm2.5” : 31.5, “pm2.5_10minute” : 26.8, “pm2.5_30minute” : 22.2, “pm2.5_60minute” : 26.8, “pm2.5_6hour” : 64.1, “pm2.5_24hour” : 89.0, “pm2.5_1week” : 44.8, “time_stamp” : 1741945253},
“stats_b” : {“pm2.5” : 33.6, “pm2.5_10minute” : 29.6, “pm2.5_30minute” : 25.0, “pm2.5_60minute” : 29.7, “pm2.5_6hour” : 67.3, “pm2.5_24hour” : 92.7, “pm2.5_1week” : 46.9, “time_stamp” : 1741945253}
}
}

1 Like

Hi @Douglas_Sirkka

This is because AQI converted data isn’t available through the API. The pm2.5 value you’re getting through the API is the raw PM data presented in units of µg/m³.

Thank you @Kieran. I did look to see if this was the issue but didn’t see it in my Google/PurpleAir community search and ChatGPT didn’t catch it.
I just needed to make a simple widget that highlighted the live AQI instead of the average. I did this with Google Apps Script here.
Thanks again,
Doug

Hi @Kieran ,
I figured it was something like that but it didn’t come up in my Google/PurpleAir community search. I just needed to make a simple widget that highlighted the current AQI rather than the average which I did using Google Apps Script here.
Thanks again,
Doug