Sunrise & Sunset Times Today in Vietnam
Sunrise, sunset, solar noon, day length, twilights, golden hour and moon phase for any Vietnamese province or coordinates, for up to 31 days.
Result
Press “Run” to see the result.
The sun times API computes, for a date, the sunrise and sunset, solar noon and the sun’s elevation at noon, the day length, civil, nautical and astronomical twilight, and the golden hour (sun between −4° and +6°, the soft light photographers look for), plus the moon phase in Vietnamese and English, its illumination and the next new and full moon.
Give a province (province=hn, a name such as Đà Nẵng, a 2-digit code, or in the path /v1/sun-times/hcm) or any lat and lon. Times are local, UTC+7 by default (tz changes it), and days (up to 31) returns a series starting at date (default: today in Vietnam).
Everything is calculated with the NOAA solar equations, accurate to about a minute, without any external service, so answers are instant. Near the poles the sunrise is null when the sun does not rise.
Use this in your code
curl "https://apibox.io.vn/v1/sun-times?province=Hà Nội&date=2026-11-11" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch('https://apibox.io.vn/v1/sun-times?province=Hà Nội&date=2026-11-11', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const data = await res.json();
console.log(data);import requests
res = requests.get(
"https://apibox.io.vn/v1/sun-times?province=Hà Nội&date=2026-11-11",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/sun-times?province=Hà Nội&date=2026-11-11');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));API documentation → Get a free API key
FAQ
How accurate is it?
About one minute; local relief (mountains, buildings) is not taken into account.
Which point of a province is used?
The province’s administrative centre; send lat and lon for an exact place.
Can I get a whole month?
Yes, days=31 returns 31 days starting at date.