Skip to content
GET /v1/astronomy

Astronomy (sunrise/sunset/UV)

Try it live

10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.

Custom headers (optional)
api.oanor.com/weather-api

It works. Grab an API key and use it in your project.

Get an API key

Code snippets

curl "https://api.oanor.com/weather-api/v1/astronomy" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/weather-api/v1/astronomy", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/weather-api/v1/astronomy");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/weather-api/v1/astronomy",
    headers={"x-oanor-key": "oanor_test_..."}
)

Example response

A real response from this endpoint, captured by the latest health check.

{
    "data": {
        "date": "2026-05-29",
        "location": {
            "name": "Berlin",
            "region": "State of Berlin",
            "country": "Germany",
            "latitude": 52.52437,
            "timezone": "Europe/Berlin",
            "longitude": 13.41053,
            "country_code": "DE"
        },
        "astronomy": {
            "sunset": "2026-05-29T21:15",
            "sunrise": "2026-05-29T04:52",
            "uv_index_max": 6.65,
            "daylight_duration_s": 58990.75,
            "sunshine_duration_s": 52577.04,
            "uv_index_clear_sky_max": 6.65
        }
    },
    "meta": {
        "timestamp": "2026-05-29T18:17:32.906Z",
        "request_id": "94d90a0a-d10d-4eb8-9c22-28487185fd26"
    },
    "status": "ok",
    "message": "Astronomy retrieved successfully",
    "success": true
}