Sign in Get your free API key

Earth Sunrise Sunset

Get sunrise and sunset times in UTC based on a latitude and longitude coordinate.

Get your free API key
No credit card required
Other tools

Usage

Returns sunrise and sunset times for a date and latitude longitude point, in UNIX time (UTC).

Parameters

day
The day of the month.

month
The numerical code for the month, 1 = January, 2 = February

year
The year in full format. For example, 2020.

lat
The latitude to calculate sunrise and sunset.

lng
The longitude to calculate sunrise and sunset.

key
Your Vay API key string. This value always starts with vay_. If you do not have an API key, you can get one for free here. No credit card required.
Returns

astronomicalSunrise
Astronomical Sunrise in Unix time.

astronomicalSunset
Astronomical Sunset in Unix time.

civilSunrise
Civil Sunrise in Unix time.

civilSunset
Civil Sunset in Unix time.

nauticalSunrise
Nautical Sunrise in Unix time.

nauticalSunset
Nautical Sunset in Unix time.

officialSunrise
Official Sunrise in Unix time.

officialSunset
Official Sunset in Unix time.
GET
/sun/time
cURL
curl https://api.vay.studio/sun/time \
-d day=6 \
-d month=3 \
-d year=2020 \
-d lat=32.715736 \
-d lng=-117.161087 \
-d key=YOUR_API_KEY \
-G
Response
{
	"errorCode": 0,
	"error": "",
	"result": {
		"astronomicalSunrise": 1583498858,
		"astronomicalSunset": 1583464340,
		"civilSunrise": 1583502284,
		"civilSunset": 1583460913,
		"nauticalSunrise": 1583500572,
		"nauticalSunset": 1583462625,
		"officialSunrise": 1583503762,
		"officialSunset": 1583459435
	}
}
Made with ❤️ in Encinitas, CA
© Copyright 2020 Vay Technologies LLC.