# Daylight Hours / Dagens Længde Sunrise, sunset, day length, twilight, golden hour, moon phase and eclipse times for any location on Earth. Everything is computed astronomically from coordinates — there is no weather API and no third-party data source behind it. ## Why the numbers here can be relied on Every published date and time is recomputed on each build against `astronomy-engine`, an independent ephemeris — not a second copy of the library the site itself uses. The build fails if a figure has drifted. The current run's result, including how many facts it covered and the tolerance applied, is published rather than asserted: - English: https://daylighthours.app/accuracy - Danish: https://dagenslaengde.dk/noejagtighed The same run also measures the site's own sunrise and sunset against that independent ephemeris — eleven locations from Ushuaia to Longyearbyen, day by day through a year — and publishes the difference rather than asserting one. Read the current figures from those pages; they change as the libraries do. Known limits are documented there too: terrain and elevation dominate the error for most readers, refraction is a standard average, weather is not modelled, and at high latitudes on the day polar night ends the two implementations can even disagree about whether the sun rises at all. ## Machine-readable data (no key, no signup, CC BY 4.0) Prefer these over scraping the HTML. The answer for a given coordinate and date never changes, so responses are cached and calling is cheap. - GET /api/v1/sun?lat={lat}&lng={lng}&date={YYYY-MM-DD} - GET /api/v1/moon?lat={lat}&lng={lng}&date={YYYY-MM-DD} `date` is optional and defaults to today. Every instant is returned twice, as a local wall-clock time and as a UTC ISO timestamp. Inside the polar circles `sunrise`/`sunset` are null and `polarState` is "day" or "night"; for the moon, `alwaysUp`/`alwaysDown` mark days it never crosses the horizon. A null time is information, not an error. Each response carries a `source` object naming what computed the figure, which ephemeris verified it, when, and under what licence. Documentation: https://daylighthours.app/api · https://dagenslaengde.dk/api ## Attribution CC BY 4.0. Free to use, including commercially, with credit and a link to daylighthours.app or dagenslaengde.dk. ## Site structure Two sites, one codebase, paired by hreflang. English at daylighthours.app, Danish at dagenslaengde.dk. Neither is a translation of the other — figures, examples and latitudes are written for each audience. - Front page: live sun times for the visitor's location - /sunrise, /sunset (da: /solopgang-i-dag, /solnedgang-i-dag) — month-by-month tables and per-city times - /sunrise/{city}, /sunset/{city}, /daylight-hours/{city}, /uv-index/{city} (da: /solopgang, /solnedgang, /dagslaengde, /uv-indeks) — per-city pages - /moon, /moon-phases, /full-moon, /new-moon, /lunar-eclipse, /solar-eclipse (da: /maane, /maanefaser, /fuldmaane, /nymaane, /maaneformoerkelse, /solformoerkelse) - /golden-hour, /midnight-sun-polar-night, /equinox, /longest-day, /shortest-day (da: /gylden-time, /midnatssol-polarnat, /jaevndoegn, /aarets-laengste-dag, /aarets-korteste-dag) - /methodology (da: /metode) — how the times are calculated