Developer API · v1

UV Index API

Real-time UV index, hourly forecasts and historical data for cities worldwide — as clean JSON. Authenticate with a bearer token and you're ready to build.

Authentication

Every request needs a personal API token (Laravel Sanctum). Create one from your account, then send it as a bearer token:

Authorization: Bearer <your-token>
Accept: application/json
Rate limited (per-token) Served from cache — fast & quota-friendly Cities by slug (e.g. istanbul)

Endpoints

Base URL https://uvindex.io/api/v1

GET /v1/uv/{city} Latest UV index, today's max, and reading times for a city.
GET /v1/uv/{city}/forecast Hour-by-hour UV index for the rest of the day.
GET /v1/uv/{city}/history Historical monthly UV averages for the past year.

Example — cURL

curl -H "Authorization: Bearer $TOKEN" \
     -H "Accept: application/json" \
     https://uvindex.io/api/v1/uv/istanbul

Example — JavaScript

const res = await fetch(
  "https://uvindex.io/api/v1/uv/istanbul",
  { headers: {
      Authorization: `Bearer ${token}`,
      Accept: "application/json",
  }}
);
const data = await res.json();

Sample response

{
  "result": {
    "uv": 5.7,
    "uv_time": "2026-07-01T10:29:00Z",
    "uv_max": 9.2,
    "uv_max_time": "2026-07-01T12:10:00Z"
  }
}