# Stable UV Index site for US

**URL:** <https://discourse.nodered.org/t/stable-uv-index-site-for-us/63408>\
**Category:** General\
**Tags:** http-request, weather\
**Created:** [3 June 2022 03:18 UTC](https://discourse.nodered.org/t/stable-uv-index-site-for-us/63408 "2022-06-03T03:18:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bodylinksystems](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bodylinksystems/32/23396_2.png) [@bodylinksystems](https://discourse.nodered.org/u/bodylinksystems)\
**Post date:** [3 June 2022 03:18 UTC](https://discourse.nodered.org/t/stable-uv-index-site-for-us/63408/1 "2022-06-03T03:18:22Z")

</div>

I used to get my UV index from a site that is paid now. I can't seem to extract it via openweather, nor can I get it from the EPA ([UV Index Search | US EPA](https://enviro.epa.gov/enviro/uv_search_v2?zipcode=90210))-- since they use a .gif for the number (I would need to extract the ALT= text.) I'm looking to get the MAX UV level for that day, not necessarily the current as they usually offer the max UV number.

example EPA result:  
 ![UVI 10](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/1/018cc0849a5eca05a5dd97916aff98edb7135ea2.gif)

I have tried JSON, text, html selectors and the scraper tool. no joy. Have I forgotten how to node-red from one summer to the next?

My weather station worked fine last year, but the UV change has me scrambling a bit. Any tips are greatly appreciated. It's just my own personal little weather station based on an 8266, and a Pi3B+ running NR and MQTT -- and I'm using the UV to plan skin safety during the summer.

It seems alot of the pages I used to scrape are now generated on the fly so a new tactic must be used...

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [3 June 2022 04:04 UTC](https://discourse.nodered.org/t/stable-uv-index-site-for-us/63408/2 "2022-06-03T04:04:44Z")

</div>

They also have an open api available it seems

> **[Web Services | US EPA](https://www.epa.gov/enviro/web-services#hourlyzip)**
>
> Envirofacts is developing web services to facilitate the sharing of its functionality and information. All of the services that are available within Envirofacts will be listed on this page.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [3 June 2022 10:52 UTC](https://discourse.nodered.org/t/stable-uv-index-site-for-us/63408/3 "2022-06-03T10:52:44Z")

</div>

@bodylinksystems This looks something many could benefit from. Do you have plans to share your flow?

---

<div class="post-metadata">

**Author:** ![bodylinksystems](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bodylinksystems/32/23396_2.png) [@bodylinksystems](https://discourse.nodered.org/u/bodylinksystems)\
**Post date:** [3 June 2022 11:33 UTC](https://discourse.nodered.org/t/stable-uv-index-site-for-us/63408/4 "2022-06-03T11:33:49Z")

</div>

@zenofmud@bakman2 this is working for me right now. Hope it helps someone else

```auto
[{"id":"566f56af6f283360","type":"tab","label":"EPA Open API UV Scrape","disabled":false,"info":"","env":[]},{"id":"87ab3aba989a130c","type":"inject","z":"566f56af6f283360","name":"UV scrape","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"str"}],"repeat":"14400","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":200,"wires":[["38d55d4f2a2073de"]]},{"id":"38d55d4f2a2073de","type":"http request","z":"566f56af6f283360","name":"UVscrape","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://data.epa.gov/efservice/getEnvirofactsUVDAILY/ZIP/20050/JSON","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":300,"y":200,"wires":[["9a81606bfd8060ca"]]},{"id":"75deb0a6e30a1539","type":"ui_button","z":"566f56af6f283360","name":"","group":"ced86898.7b5518","order":11,"width":3,"height":1,"passthru":false,"label":"REFRESH UV","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"date","topic":"","x":120,"y":280,"wires":[["38d55d4f2a2073de"]]},{"id":"9a81606bfd8060ca","type":"change","z":"566f56af6f283360","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0].UV_INDEX","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":260,"wires":[["b77726646ede7f81"]]},{"id":"b77726646ede7f81","type":"switch","z":"566f56af6f283360","name":"UV array","property":"payload","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"false","repair":false,"outputs":1,"x":560,"y":300,"wires":[["6a181d4fbfe57811","c8ac4a906f5b2f2f"]]},{"id":"6a181d4fbfe57811","type":"ui_artlessgauge","z":"566f56af6f283360","group":"ced86898.7b5518","order":8,"width":3,"height":3,"name":"UV index","icon":"fa-medkit","label":"UV","unit":"index","layout":"radial","decimals":0,"differential":false,"minmax":false,"colorTrack":"#ff2801","colorFromTheme":true,"sectors":[{"val":0,"col":"#12ff00","t":"min","dot":0},{"val":4,"col":"#ffff00","t":"sec","dot":1},{"val":5,"col":"#ff8a00","t":"sec","dot":1},{"val":6,"col":"#ff0000","t":"sec","dot":1},{"val":7,"col":"#ff00bf","t":"sec","dot":1},{"val":10,"col":"#ff00bf","t":"max","dot":0}],"lineWidth":3,"bgcolorFromTheme":true,"x":640,"y":360,"wires":[]},{"id":"c8ac4a906f5b2f2f","type":"debug","z":"566f56af6f283360","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":710,"y":280,"wires":[]},{"id":"ced86898.7b5518","type":"ui_group","name":"Sensors","tab":"359cc23c.7c394e","order":1,"disp":false,"width":12,"collapse":false},{"id":"359cc23c.7c394e","type":"ui_tab","name":"POOL WX","icon":"fa-tint","order":1,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [17 June 2022 11:34 UTC](https://discourse.nodered.org/t/stable-uv-index-site-for-us/63408/5 "2022-06-17T11:34:39Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
