{"id":13715986,"url":"https://github.com/jasonsnell/PurpleAir-AQI-Scriptable-Widget","last_synced_at":"2025-05-07T05:31:56.587Z","repository":{"id":39642350,"uuid":"297759774","full_name":"jasonsnell/PurpleAir-AQI-Scriptable-Widget","owner":"jasonsnell","description":"Generate Scriptable app widget to query PurpleAir sensor and display local AQI.","archived":false,"fork":false,"pushed_at":"2023-09-27T21:58:41.000Z","size":348,"stargazers_count":168,"open_issues_count":1,"forks_count":38,"subscribers_count":23,"default_branch":"main","last_synced_at":"2024-11-14T04:34:34.940Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jasonsnell.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,"roadmap":null,"authors":null}},"created_at":"2020-09-22T20:06:54.000Z","updated_at":"2024-11-12T04:31:22.000Z","dependencies_parsed_at":"2024-01-05T23:42:18.637Z","dependency_job_id":"b70b9f46-ec65-4a4f-9199-b9781daba8d4","html_url":"https://github.com/jasonsnell/PurpleAir-AQI-Scriptable-Widget","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonsnell%2FPurpleAir-AQI-Scriptable-Widget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonsnell%2FPurpleAir-AQI-Scriptable-Widget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonsnell%2FPurpleAir-AQI-Scriptable-Widget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonsnell%2FPurpleAir-AQI-Scriptable-Widget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasonsnell","download_url":"https://codeload.github.com/jasonsnell/PurpleAir-AQI-Scriptable-Widget/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252823041,"owners_count":21809700,"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":[],"created_at":"2024-08-03T00:01:05.803Z","updated_at":"2025-05-07T05:31:51.570Z","avatar_url":"https://github.com/jasonsnell.png","language":"JavaScript","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"# PurpleAir-AQI-Scriptable-Widget\n\n\u003cimg src=\"https://sixcolors.com/wp-content/uploads/2021/08/new-aqi.jpg\" width=\"600\" /\u003e\n\n\n\nProject operated by Jason Snell \u003cjsnell@sixcolors.com\u003e with enormous contributions from Matt Silverlock, Rob Silverii, Adam Lickel, Alexander Ogilvie, Brian Donovan, Jon Sadka, bennywij, and anonymous others!\n\n## About this project\n\nThis project generates a widget that displays local air quality on the home screen of devices running iOS or iPadOS 14. It is displayed via the [Scriptable](https://scriptable.app) app by Simon Støvring.\n\nThe widget uses data from the [PurpleAir network](https://www2.purpleair.com) of low-cost, consumer air quality sensors. While in America the EPA has a large, established network of sensors, the nearest sensor to you may not be experiencing the same conditions as you are, especially in extreme events such as wildfires. This widget exists because the nearest EPA sensor to me (Jason Snell) did not accurately reflect my local air quality during heavy wildfire smoke conditions. You can [read more about the origin of this project](https://sixcolors.com/post/2020/08/how-bad-is-the-air-out-there/) if you like.\n\nIf you just want an app that does this, I recommend [Paku](http://paku.app). It's got a widget almost identical to this one, and you don't have to fuss with it! I wrote this widget before apps like Paku existed.\n\n## How to use this\n\nTo use this widget, make a new script inside Scriptable and paste in the contents of `purpleair-aqi.js`. \n\nYou can run the script from within the app, or add a new Small widget on your home screen, set it to Scriptable, and choose the script by tapping and holding on the widget, choosing Edit Widget, and choosing the script by tapping on the Script field. \n\nPurpleAir **has changed its API**. This widget now requires a PurpleAir API key. If you don't have one, you'll need to request one from \u003chttps://www2.purpleair.com/pages/contact-us\u003e and enter your READ KEY in the API key variable in the script.\n\nThe widget is designed to use Location Services to find the nearest PurpleAir station to your location. If that's not working, you can specify a PurpleAir station manually by tapping and holding on the widget, choosing Edit Widget, and then entering the PurpleAir ID of the station you want to monitor in the Parameter field.\n\n## How does this widget calculate AQI?\n\nThis widget uses an EPA calculation designed for low-cost sensors like PurpleAir in areas where wood smoke is an issue, such as during wildfires. You can [read about the backstory here](https://thebolditalic.com/understanding-purpleair-vs-airnow-gov-measurements-of-wood-smoke-pollution-562923a55226) and [see the EPA document here](https://cfpub.epa.gov/si/si_public_record_report.cfm?dirEntryId=349513\u0026Lab=CEMM\u0026simplesearch=0\u0026showcriteria=2\u0026sortby=pubDate\u0026timstype=\u0026datebeginpublishedpresented=08/25/2018).\n\nPurpleAir refers to this calculation as **US EPA**, which you can choose from the Conversion popup on the PurpleAir web map.\n\n## What matters more, the numbers or the words/colors?\n\nThe words and colors! The real point of AQI isn't the number, it's the level -- the words and color. But we all like numbers, so it displays a number too. Also, the widget does display a trend if one exists, so if you're in volatile conditions, you should be able to tell at a glance if your air quality is improving or worsening.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonsnell%2FPurpleAir-AQI-Scriptable-Widget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasonsnell%2FPurpleAir-AQI-Scriptable-Widget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonsnell%2FPurpleAir-AQI-Scriptable-Widget/lists"}