# Sunrise and sunset notifications

> Whether sunrise and sunset notifications are open, the evaluation card a notification opens, feedback on how good a sky was, a scored preview for a saved place, and the unsubscribe link in those emails.

API reference · Reference · https://wxalerts.org/docs/api/notifications-sky/

Base URL: `https://api.wxalerts.org`

Notifications that tell a saved place when a coming sunrise or sunset is
forecast to be worth going out for. The settings (`sky` on a
[saved place](/docs/api/notifications-places/)) switch them on. These routes
are what a tapped notification opens and what the settings card shows. The
forecast for any point, with no account, is
[Sunrise and sunset outlook](/docs/api/sky/).

## Score object

`SkyScoreOut`, the shape of every scored event on this page.

| Field | Type | Description |
| --- | --- | --- |
| `kind` | string | `sunrise` or `sunset` |
| `local_date` | string | the date of the event at the point, `YYYY-MM-DD` |
| `event_time` | string | the instant of the event, UTC |
| `event_clock` | string | the same instant on the place's own clock, ready to show, such as `5:47 PM CST` |
| `score` | number or null | the colour score, 0 to 100: whether the low sun will light up cloud from below. `null` when it could not be scored |
| `category` | string or null | `poor` (below 25), `fair` (25 to below 50), `good` (50 to below 75) or `great` (75 and up) |
| `confidence` | string or null | `high`, `medium` or `low`, from the forecast source and its lead time |
| `reasons` | array of string | plain words for what made the colour score, best first |
| `clear_score` | number or null | the clear sun score, 0 to 100: whether the sun's own disc will be visible to the horizon. A cloudless sky is its best case, which the colour score rates poor by design. `null` on evaluations from before it existed |
| `clear_category` | string or null | the same scale as `category` |
| `clear_reasons` | array of string | plain words for the clear sun score. Can be empty |

## `GET /notifications/sky/status`

Whether sunrise and sunset notifications are open to everyone, or limited to a
beta list. The website reads it before it offers the feature to someone who
is not signed in.

Access: anonymous. No parameters. Cached: `Cache-Control: public, max-age=300`.

| Field | Type | Description |
| --- | --- | --- |
| `open` | boolean | `false` while a beta list limits who is offered it |

```json
{ "open": true }
```

## `GET /notifications/sky/evaluations/{evaluation_id}`

One sunrise or sunset that was scored for one of the account's places: the
card a tapped notification opens.

Access: signed in (session cookie or Bearer). Not cached (`no-store`).
Sign-in errors are on the [overview](/docs/api/notifications/).

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `evaluation_id` | path | integer | the evaluation's id |

Response `200`: the score object plus:

| Field | Type | Description |
| --- | --- | --- |
| `id` | integer | |
| `place_id` | integer | |
| `place_label` | string | |
| `product` | string | which forecast the place was judged on: `colour`, `clear` or `both` |
| `qualified` | boolean | whether it reached the place's minimum score and so was notified |
| `feedback` | integer or null | the rating given with the feedback route, 1 to 5, or `null` |

```json
{
  "id": 5120,
  "place_id": 41,
  "place_label": "Home",
  "kind": "sunset",
  "local_date": "2026-11-23",
  "event_time": "2026-11-23T23:27:10.000Z",
  "event_clock": "5:27 PM CST",
  "score": 79.0,
  "category": "great",
  "confidence": "high",
  "reasons": ["broken mid and high cloud to catch the colour", "a clear horizon toward the sun"],
  "clear_score": 44.5,
  "clear_category": "fair",
  "clear_reasons": ["cloud along the sun's path may hide it"],
  "product": "colour",
  "qualified": true,
  "feedback": null
}
```

| Status | Body | When |
| --- | --- | --- |
| `404` | `{"detail": "No such evaluation."}` | none on this account. Someone else's gives the same answer |
| `422` | standard list | `evaluation_id` is not an integer |

## `POST /notifications/sky/evaluations/{evaluation_id}/feedback`

Say how good the sky actually was. A second call overwrites the first.

Access: signed in, with `X-Requested-With: wxalerts` on a cookie.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `evaluation_id` | path | integer | |

Body:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `rating` | integer, 1 to 5 | yes | 1 dull, 5 spectacular |

```json
{ "rating": 4 }
```

Response `204`, no body.

| Status | Body | When |
| --- | --- | --- |
| `404` | `{"detail": "No such evaluation."}` | |
| `422` | standard list | `rating` missing or outside 1 to 5 |

## `GET /notifications/sky/places/{place_id}/preview`

The next sunrise and sunset at a saved place, scored now. What the settings
card shows beside the switches. It is scored on request and not stored.

Access: signed in. Not cached (`no-store`).

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `place_id` | path | integer | a saved place on this account |

| Field | Type | Description |
| --- | --- | --- |
| `place_id` | integer | |
| `place_label` | string | |
| `available` | boolean | whether the notifications this card switches on can go out here: offered to the account, inside a forecast grid, and in a region that is alerted. Hawaii and Guam are scored on the forecast pages but not alerted, so `available` is `false` there |
| `events` | array of score object | the next sunrise and the next sunset, soonest first. Empty when `available` is `false` |

```json
{
  "place_id": 41,
  "place_label": "Home",
  "available": true,
  "events": [
    {
      "kind": "sunset", "local_date": "2026-11-23",
      "event_time": "2026-11-23T23:27:10.000Z", "event_clock": "5:27 PM CST",
      "score": 62.0, "category": "good", "confidence": "high",
      "reasons": ["high cloud to catch the colour"],
      "clear_score": 31.0, "clear_category": "fair", "clear_reasons": []
    }
  ]
}
```

| Status | Body | When |
| --- | --- | --- |
| `404` | `{"detail": "No such place."}` | not a place on this account |

## `GET /notifications/sky/unsubscribe`

Turn off sunrise and sunset **emails** on every place of the account, from the
link in one of those emails. Push notifications are left as they are. For a
person clicking.

Access: none. The signed link token is the credential, and it does not expire.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `t` | query | string | yes | the link token from the email |

Response: an HTML page, `Cache-Control: no-store`. `200` "Unsubscribed"; `400`
"That link is not valid" with "Nothing has been changed."; `422` standard list
when `t` is missing.

## `POST /notifications/sky/unsubscribe`

The same operation for a mail client's one-click unsubscribe control. The token
is the `t` query parameter. Same HTML responses. No CSRF header and no body.
