freeapis

Sunrise and Sunset

Sunset and sunrise times for a given latitude and longitude

Authentication
No auth
HTTPS
Yes
CORS
No
Data source
public-apis + marcelscruz

Overview

The Sunrise-Sunset API returns sunrise, sunset, dawn, dusk and solar-noon times for any latitude/longitude — free, keyless, and dependency-free. A handy utility for photography planning, smart-home lighting, and outdoor apps.

Quick Start

Sun times for a location (verified live):

curl "https://api.sunrise-sunset.org/json?lat=36.72&lng=-4.42"
{
  "results": {
    "sunrise": "5:40:22 AM",
    "sunset": "7:08:21 PM",
    "solar_noon": "12:24:21 PM",
    "day_length": "13:27:59",
    "civil_twilight_begin": "5:12:21 AM",
    "civil_twilight_end": "7:36:22 PM",
    "nautical_twilight_begin": "4:38:36 AM",
    "nautical_twilight_end": "8:10:07 PM",
    "astronomical_twilight_begin": "4:03:07 AM",
    "astronomical_twilight_end": "8:45:37 PM"
  },
  "status": "OK"
}

Specify a date:

curl "https://api.sunrise-sunset.org/json?lat=36.72&lng=-4.42&date=2026-12-21"

24-hour format:

curl "https://api.sunrise-sunset.org/json?lat=36.72&lng=-4.42&formatted=0"

Authentication

None — keyless.

Rate Limits & Notes

  • Free; no documented hard limit — be polite.
  • Times are local to the requested coordinates (the API returns them in the location’s timezone).
  • formatted=0 returns ISO-8601 timestamps instead of human strings.
  • Requires decimal lat/lng; date is optional (defaults to today).

FAQ

Is Sunrise-Sunset free? Yes — free and keyless.

Are times in my timezone? They’re in the timezone of the requested coordinates — not your local timezone.

Can I get ISO timestamps? Yes — add formatted=0.

More in Science & Math

APIAuthHTTPSCORS
arcsecond.io

Multiple astronomy data sources

No authYesUnknown↗
arXiv

Curated research-sharing platform: physics, mathematics, quantitative finance, and economics

No authunknownUnknown↗
arXiv

Curated research-sharing platform: physics, mathematics, quantitative finance, and economics

No authYesUnknown↗
Bootprint

Random facts and images of space

No authYesUnknown↗
CodeCogs

Render LaTeX equations in PNG, GIF, SVG, EMF, PDF, JSON, or download formats with styling options

No authYesUnknown↗