UV Index

Access current/forecast/historical UV data for any location on Earth including over 200,000 cities! Data is available in the JSON format.

Call current UV data for one location

Please remember that all Examples of API calls that listed on this page are just samples and do not have any connection to the real API service!

By geographic coordinates

API call:
http://api.openweathermap.org/data/2.5/uvi?appid={appid}&lat={lat}&lon={lon}
Parameters:

appid - personal API key

lat, lon - coordinates of the location of your interest (latitude/longitude)

Examples of API calls:

api.openweathermap.org/data/2.5/uvi?lat=37.75&lon=-122.37


Call forecast UV data for one location

By geographic coordinates

API call:
http://api.openweathermap.org/data/2.5/uvi/forecast?appid={appid}&lat={lat}&lon={lon}&cnt={cnt}
Parameters:

appid - personal API key

lat, lon - coordinates of the location of your interest (latitude/longitude)

cnt - number of returned days

Examples of API calls:

api.openweathermap.org/data/2.5/uvi/forecast?lat=37.75&lon=-122.37

Call historical UV data for one location

By geographic coordinates

API call:
http://api.openweathermap.org/data/2.5/uvi/history?appid={appid}&lat={lat}&lon={lon}&cnt={cnt}&start={start}&end={end}
Parameters:

appid - personal API key

lat, lon - coordinates of the location of your interest (latitude/longitude)

cnt - number of returned days

start - starting point of time period in UNIX time

end - final point of time period in UNIX time

Examples of API calls:

api.openweathermap.org/data/2.5/uvi/history?lat=37.75&lon=-122.37&start=1498049953&end=1498481991

Server response format

lat
float - latitude for returned data
lon
float - longitude for returned data
date_iso
string - date and time corresponding to returned date
date
integer - ISO 8601 timestamp
value
float - ultraviolet index

Example

{
 "lat": 38.75,
 "lon": 40.25,
 "date_iso": "2017-06-23T12:00:00Z",
 "date": 1498219200,
 "value": 10.16
}

Codes of requests

If API call is succefull - 200 HTTP-code is returned. If location is not found or wrong APPID is specified then HTTP-code 404 or HTTP-code 400 are returned accordingly.