<!-- block-id: intro -->

## Ultraviolet Index (Deprecated)

> The product retired on **1st April 2021**, please find UV data in [One Call API 4.0](/api/one-call-4.md). One Call API includs current, hourly forecast for 7 days and 5 days historical UV data.

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

<!-- block-id: current -->

## Call current UV data

<!-- block-id: geo -->

| Parameters of API call |  |  |
| --- | --- | --- |
| `lat, lon` | Yes | Geographical coordinates (latitude, longitude) |
| `appid` | Yes | Your unique API key (you can always find it on your account page under the ["API key" tab](https://home.openweathermap.org/api_keys)) |

### Example of API response

```json
{
"lat":37.75,
"lon":-122.37,
"date_iso":"2017-06-26T12:00:00Z",
"date":1498478400,
"value":10.06
}
```

<!-- block-id: forecast -->

## Call forecast UV data

The data is available for 8 days ahead.

<!-- block-id: fgeo -->

| Parameters of API call |  |  |
| --- | --- | --- |
| `lat, lon` | Yes | Geographical coordinates (latitude, longitude) |
| `appid` | Yes | Your unique API key (you can always find it on your account page under the ["API key" tab](https://home.openweathermap.org/api_keys)) |
| `cnt` | optional | A number of timestamps in response. |

### Example of API call

```json
[
      {
          "lat":37.75,
          "lon":-122.37,
          "date_iso":"2017-06-27T12:00:00Z",
          "date":1498564800,
          "value":10.1
      },
      {
          "lat":37.75,
          "lon":-122.37,
          "date_iso":"2017-06-28T12:00:00Z",
          "date":1498651200,
          "value":10.19
      },
      ...
      {
          "lat":37.75,
          "lon":-122.37,
          "date_iso":"2017-07-04T12:00:00Z",
          "date":1499169600,
          "value":10.05
      }
  ]
```

<!-- block-id: history -->

## Call historical UV data

<!-- block-id: hgeo -->

| Parameters |  |  |
| --- | --- | --- |
| `lat, lon` | Yes | Geographical coordinates (latitude, longitude) |
| `appid` | Yes | Your unique API key (you can always find it on your account page under the ["API key" tab](https://home.openweathermap.org/api_keys)) |
| `cnt` | optional | A number of timestamps in response. |
| `start` | optional | Starting point of time period in UNIX time |
| `end` | optional | Final point of time period in UNIX time |

### Example of API call

```json
[
    {
        "lat":37.75,
        "lon":-122.37,
        "date_iso":"2017-06-22T12:00:00Z",
        "date":1498132800,
        "value":9.92
    },
    {
        "lat":37.75,
        "lon":-122.37,
        "date_iso":"2017-06-23T12:00:00Z",
        "date":1498219200,
        "value":10.09
    },
    {
        "lat":37.75,
        "lon":-122.37,
        "date_iso":"2017-06-24T12:00:00Z",
        "date":1498305600,
        "value":10.95
    },
    {
        "lat":37.75,
        "lon":-122.37,
        "date_iso":"2017-06-25T12:00:00Z",
        "date":1498392000,
        "value":11.03
    },
    {
        "lat":37.75,
        "lon":-122.37,
        "date_iso":"2017-06-26T12:00:00Z",
        "date":1498478400,
        "value":10.06
    }
]
```

> The data is available starting from the 2017-06-22.

<!-- block-id: responseformat -->

## Server response format

> Please remember that data is provided only for 12:00 p.m.

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

- `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 longitude for returned data

<!-- block-id: codes -->

### Codes of requests

> If API call is successful - 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.