Basically it takes into account things like ozone measurements from satellites, latitude, forecasted cloud cover, and distance from sun (time of year).
See section “Calculating the UV index” here:
https://www.epa.gov/sunsafety/learn-about-uv-index
It’s not intended to be realtime. It’s more about understanding, generally, what the risk is.
A sibling comment mentions the ozone layer, but I severely doubt it varies enough to be a source of inaccuracy.
“Solar urticaria is a rare condition where the skin reacts to specific wavelengths of light rather than the overall UV intensity. The UV index is a general measure of the total amount of erythema-causing UV radiation (mainly UVB) that can cause sunburn in the average person.
But in solar urticaria, the trigger might be UVA, visible light, or even a narrow band of wavelengths — and the UV index doesn’t capture that nuance.
So it’s not that the forecast is wrong — just that the UV index isn’t designed to reflect the sensitivity profile of solar urticaria.”
In other words, you’re (literally) a special case. :)