{"id":22053312,"url":"https://github.com/bertrandom/purpleair","last_synced_at":"2026-04-22T21:34:17.151Z","repository":{"id":66843632,"uuid":"295666246","full_name":"bertrandom/purpleair","owner":"bertrandom","description":"Retrieve AQI (with AQandU conversion) from a PurpleAir sensor via the CLI or as a library to your node script","archived":false,"fork":false,"pushed_at":"2020-09-15T09:09:21.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-30T21:24:43.816Z","etag":null,"topics":["aqi","purple-air-api","purpleair"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/purpleair","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bertrandom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-09-15T08:39:30.000Z","updated_at":"2023-09-18T06:02:19.000Z","dependencies_parsed_at":"2023-05-29T03:15:33.609Z","dependency_job_id":null,"html_url":"https://github.com/bertrandom/purpleair","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"0490d1668314ae56d1ecefe08d5a98a638f1019e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bertrandom/purpleair","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandom%2Fpurpleair","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandom%2Fpurpleair/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandom%2Fpurpleair/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandom%2Fpurpleair/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertrandom","download_url":"https://codeload.github.com/bertrandom/purpleair/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandom%2Fpurpleair/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262941545,"owners_count":23388149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aqi","purple-air-api","purpleair"],"created_at":"2024-11-30T15:16:15.276Z","updated_at":"2026-04-22T21:34:12.128Z","avatar_url":"https://github.com/bertrandom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# purpleair\n\nRetrieve AQI (with [AQandU conversion](https://thebolditalic.com/understanding-purpleair-vs-airnow-gov-measurements-of-wood-smoke-pollution-562923a55226)) from a PurpleAir sensor via the CLI or as a library to your node script\n\nMost of this code was stolen from [https://aqi.wtf](https://github.com/skalnik/aqi-wtf)\n\n## determine your purpleair sensor ID\n\nOpen the PurpleAir map:\nhttps://www.purpleair.com/map?mylocation\n\nand click on the sensor closest to your location.\n\nThe URL bar will change to something like:\n\n`https://www.purpleair.com/map?opt=1/mAQI/a10/cC0\u0026select=62217#15.69/37.737125/-122.414218`\n\nThe sensor ID will be the value of the `select` parameter. In the above URL, the ID is 62217:\n\n`https://www.purpleair.com/map?opt=1/mAQI/a10/cC0\u0026select=`**`62217`**`#15.69/37.737125/-122.414218`\n\n\n## cli usage\n\nInstall the module globally\n\n```\nnpm install -g purpleair\n```\n\nThen call:\n\n```\npurpleair [sensor ID]\n```\n\nwhich will return the AQI.\n\nExample output:\n\n```\n\u003e purpleair 62217\n139\n```\n\nWith the AQI class:\n\n```\n\u003e purpleair --class 62217\n139 (unhealthy-for-sensitive-groups)\n```\n\nAs JSON:\n```\n\u003e purpleair --class --json 62217\n{\n  \"aqi\": 139,\n  \"sensorId\": 62217,\n  \"class\": \"unhealthy-for-sensitive-groups\"\n}\n```\n\n\n## library usage\n\nThere are three functions:\n\n* getSensor(sensorId)\n* getAQI(sensor)\n* getAQIClass(aqi)\n\nExample:\n```\nconst purpleair = require('purpleair');\n\nconst main = async () =\u003e {\n    try {\n\n        var sensor = await purpleair.getSensor(62217);\n        var aqi = await purpleair.getAQI(sensor);\n\n        console.log(aqi);\n\n        var aqiClass = purpleair.getAQIClass(aqi);\n\n        console.log(aqiClass);\n\n    } catch (err) {\n        console.error(err);\n    }\n};\n\nmain();\n```\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertrandom%2Fpurpleair","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertrandom%2Fpurpleair","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertrandom%2Fpurpleair/lists"}