Free Real-time UV Index API

Free Global Real-time UV Index API providing the current UV Index and 5 day Hourly UV Index Forecast for the whole world.


API Server Status OpenAPI 3.1 YAML

Our free (no key required) API exposes a single endpoint that returns the current UV Index and hourly UV Index Forecast for the next ~120 hours for the given latitude/longitude.

API Documentation

Live API Playground →

GET https://currentuvindex.com/api/v1/uvi?latitude=40.6943&longitude=-73.9249

Request Parameters

Name Type Required Description
latitude number Yes The latitude of the location for which you want the UV Index. Valid values are between -90 and 90.
longitude number Yes The longitude of the location for which you want the UV Index. Valid values are between -180 and 180.

Response (JSON Format)

type Response =
  | {
      ok: true
      latitude: number
      longitude: number
      now: { time: string; uvi: number }
      forecast: { time: string; uvi: number }[]
    }
  | {
      ok: false
      message: string
    }

Example Successful Response

{
  "ok": true,
  "latitude": 40.6943,
  "longitude": -73.9249,
  "now": {
    "time": "2024-05-17T07:00:00Z",
    "uvi": 0
  },
  "forecast": [
    {
      "time": "2024-05-17T08:00:00Z",
      "uvi": 0
    },
    {
      "time": "2024-05-17T09:00:00Z",
      "uvi": 0
    },
    {
      "time": "2024-05-17T10:00:00Z",
      "uvi": 0
    }
  ]
}

Note: The forecast array above has been trimmed for brevity; the actual response contains hourly forecast for the next ~120 hours.

Example Error Response

https://currentuvindex.com/api/v1/uvi?latitude=40.6943&longitude=-181.0
{
  "ok": false,
  "message": "invalid longitude"
}

Note: Whenever an error is returned, `ok` will be `false` and the HTTP status code will be 4xx or 5xx.


Authentication

Accessing our UV Index API requires no signup or API Key.

Rate Limit

Since our UV Index API does not require specifying an API key, our rate limits are based on the caller's IP address. The current rate limit is 500 requests per IP per day, which is reset at 00:00 UTC.

License

The data returned by our UV Index API is licensed under the CC BY 4.0 license. In short, you are free to use the data for personal and commercial purposes, as long as you give appropriate credit, with a link to https://currentuvindex.com. Read more about the source of our data here.

Disclaimer

The data returned by our UV Index API is provided "as is" without warranty or guarantee of any kind, express or implied. We do not accept any responsibility or liability for the accuracy, content, completeness, legality, or reliability of the data returned by our UV Index API.


What is UV Index?

The UV Index, short for Ultraviolet Index, is a measurement scale used to indicate the intensity of ultraviolet radiation from the sun at a particular place and time. The values range from 0 to 11 and above. The higher the index value, the greater the potential for damage to the skin and eyes, and the less time it takes for harm to occur.

Historical Weather Data

Our API currently only provides the current UV Index and upto 120 hours of UV Index forecast. We are working on adding historical UV Index data to our API. If you are interested in historical UV Index data, please check back later.


Do you have any questions or suggestions regarding our API? We'd love to hear from you!

Contact Us