{"openapi":"3.1.0","info":{"title":"Sunrise & Sunset API","version":"1.0.0","description":"Sunrise, sunset, solar noon, day length and the civil, nautical and astronomical twilight phases for any latitude/longitude and date — plus a multi-day range. Useful for agriculture, solar energy, photography, outdoor scheduling, smart-home automation and astronomy apps.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/sunrise-api","description":"oanor gateway"}],"tags":[{"name":"Sun"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/range":{"get":{"operationId":"get_v1_range","tags":["Sun"],"summary":"Sun times for a date range","description":"","parameters":[{"name":"lat","in":"query","required":true,"description":"Latitude","schema":{"type":"string"},"example":"52.52"},{"name":"lng","in":"query","required":true,"description":"Longitude","schema":{"type":"string"},"example":"13.405"},{"name":"start","in":"query","required":true,"description":"Start YYYY-MM-DD","schema":{"type":"string"},"example":"2026-06-20"},{"name":"end","in":"query","required":true,"description":"End YYYY-MM-DD (max 31 days)","schema":{"type":"string"},"example":"2026-06-22"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"end":"2026-06-22","lat":52.52,"lng":13.405,"days":[{"date":"2026-06-20","sunset":"2026-06-20T19:35:19+00:00","sunrise":"2026-06-20T02:40:38+00:00","day_length":{"hours":16.91,"seconds":60881,"formatted":"16h 54m"},"solar_noon":"2026-06-20T11:07:58+00:00"},{"date":"2026-06-21","sunset":"2026-06-21T19:35:33+00:00","sunrise":"2026-06-21T02:40:50+00:00","day_length":{"hours":16.91,"seconds":60883,"formatted":"16h 54m"},"solar_noon":"2026-06-21T11:08:12+00:00"},{"date":"2026-06-22","sunset":"2026-06-22T19:35:44+00:00","sunrise":"2026-06-22T02:41:05+00:00","day_length":{"hours":16.91,"seconds":60879,"formatted":"16h 54m"},"solar_noon":"2026-06-22T11:08:25+00:00"}],"count":3,"start":"2026-06-20","times_in":"UTC"},"meta":{"timestamp":"2026-05-30T03:39:09.965Z","request_id":"1a1ef3a5-dd7f-498b-92da-d35915566254"},"status":"ok","message":"Sun times range retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/times":{"get":{"operationId":"get_v1_times","tags":["Sun"],"summary":"Sun times for one date","description":"","parameters":[{"name":"lat","in":"query","required":true,"description":"Latitude","schema":{"type":"string"},"example":"52.52"},{"name":"lng","in":"query","required":true,"description":"Longitude","schema":{"type":"string"},"example":"13.405"},{"name":"date","in":"query","required":false,"description":"YYYY-MM-DD (default today)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"lat":52.52,"lng":13.405,"date":"today","sunset":"2026-05-30T19:18:58+00:00","sunrise":"2026-05-30T02:48:54+00:00","times_in":"UTC","day_length":{"hours":16.5,"seconds":59404,"formatted":"16h 30m"},"solar_noon":"2026-05-30T11:03:56+00:00","civil_twilight":{"end":"2026-05-30T20:03:51+00:00","begin":"2026-05-30T02:04:01+00:00"},"nautical_twilight":{"end":"2026-05-30T21:15:21+00:00","begin":"2026-05-30T00:52:31+00:00"},"astronomical_twilight":{"end":"1970-01-01T00:00:01+00:00","begin":"1970-01-01T00:00:01+00:00"}},"meta":{"timestamp":"2026-05-30T03:39:21.837Z","request_id":"099adf8b-aa43-49bf-bac0-616c80f102cd"},"status":"ok","message":"Sun times retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":12000,"rps_limit":2,"hard_limit":true},{"slug":"basic","name":"Basic","price_cents_month":800,"monthly_call_quota":150000,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2400,"monthly_call_quota":750000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5900,"monthly_call_quota":3000000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/sunrise-api"}