Making API Calls with the PurpleAir API

Using the v1/sensors API with latitude and longitude NW/SE corners, the returned data seems to fill up with sensors with locations that are set to null. None of the sensors that show up on the map in the target area appear in the search results. Is there a way to ignore these?

Eg:

https://api.purpleair.com/v1/sensors?fields=name%2Clatitude%2Clongitude&location_type=0&nwlng=38&nwlat=-122.5&selng=37&selat=-121.5

Results in:

  "data" : [
[12831,"OB/Point Loma",null,null],
[144906,"ucm-83cc",null,null],
[144922,"ucm-89f9",null,null],
[144976,"ucm-94a7",null,null],
[145194,"508 Hoover Street, Nelson, BC",null,null],
[19659,"Elmhurst, IL",null,null],
[30561,"lineblock_outside2",null,null],
[35109,"807D3A615D8E",null,null],
[35121,"807D3A615C42",null,null],
[35147,"807D3A615C49",null,null],
[35189,"807D3A6152E5",null,null],
[35195,"84F3EB7C47FD",null,null],
[35229,"paqs-004",null,null],
[35271,"paqs-009",null,null],
[35281,"paqs-001",null,null],
[35295,"paqs-007",null,null],
[35303,"paqs-003",null,null],
[35319,"807D3A2BBA7C",null,null],
[36293,"LAC - Monitor 2",null,null],
[36299,"LAC - Monitor 4",null,null],
[36307,"LAC - Monitor 5",null,null],
[36325,"807d3a616167",null,null],
[36445,"LAC - Monitor 3",null,null],
[36677,"84:F3:EB:7B:C8:DC",null,null],
[36681,"68c63a8e59a",null,null],
[49191,"BCDDC264D0B1",null,null],
[49199,"ECFABC59A4F4",null,null],
[49213,"807D3A615D1E",null,null],
[69853,"OUTSIDE DC",null,null],
[79179,"S. Military Rd, Portland, OR",null,null],
[79323,"Lytton Springs",null,null],
[95087,"329 W 24th Pl",null,null],
[98265,"PSPS_8",null,null],
[98269,"PSPS_5",null,null],
[98663,"PSPS_7",null,null],
[98667,"PSPS_9",null,null],
[98675,"PSPS_10",null,null],
[98679,"PSPS_6",null,null],
[98851,"Barn",null,null],
[98899,"Winery",null,null],
[99313,"68:C6:3A:8E:59:1B",null,null],
[101093,"Crestone Charter School",null,null],
[104546,"paqs-011",null,null],
[108194,"FCF",null,null],
[110620,"RMC",null,null],
[111504,"1810 6th street Berkeley",null,null],
[111642,"Jay Road",null,null],
[112054,"archbishop mitty high school",null,null],
[112976,"10:52:1C:42:2A:29",null,null],
[112992,"10:52:1C:44:17:A1",null,null],
[113010,"10:52:1C:41:4E:4A",null,null],
[113674,"Prado",null,null],
[115125,"airport gardens",null,null],
[120397,"Redwood",null,null],
[121211,"Westwood hill",null,null],
[122689,"ucm-fd95",null,null],
[125695,"Orick",null,null]
  ]

1 Like