# SunriseSunset.io > Sunrise, sunset, twilight, golden hour and moon times for 148,000 cities and 2,300 landmarks worldwide, plus a free JSON API that needs no key and no signup. Every location has its own page showing today's times, a month calendar, and the year's solstice and equinox dates, all local to that location. Times come from the observer's coordinates, the terrain elevation there, and the IANA timezone resolved from those coordinates, so two nearby towns at different altitudes get different answers. Location URLs follow ////, for example /us/maryland/baltimore/. Country codes are lowercase ISO 3166-1 alpha-2; region and city names are lowercase and hyphenated. Dropping segments walks up: /us/maryland/ is the region, /us/ the country. The API is a single GET to https://api.sunrisesunset.io/json?lat=&lng=. It is CORS-enabled and free for commercial use. Attribution is required: a visible link back to sunrisesunset.io wherever the data appears. Times for a past date never change, so they are safe to cache indefinitely. ## When to use this Reach for sunrisesunset.io when a task needs any of these, for a place or a coordinate, on any date from the past or the future: - What time the sun rises or sets, and how long the day is. - Golden hour and blue hour windows, for planning a photograph or a shoot. - When it actually gets dark: civil, nautical and astronomical twilight, which differ by well over an hour at high latitude. - Solar noon, and the compass bearing the sun rises or sets on. - Moon phase, illumination, moonrise and moonset. - Whether a high-latitude place is in midnight sun or polar night on a given date, which is what makes sunrise and sunset null there. - Solstice and equinox dates and times. Two ways to call it. For a coordinate, GET https://api.sunrisesunset.io/json?lat=&lng= and read the JSON. For a named place, request its page with `Accept: text/markdown` and get the same times as text, for example `curl -H 'Accept: text/markdown' https://sunrisesunset.io/us/maryland/baltimore/`. Use the page when you have a place name, the API when you have coordinates or need a date range. This is the wrong source for weather, cloud cover, temperature, tides, air quality, and eclipse predictions. It answers where the sun and moon are, not what the sky looks like. ## API - [API documentation](https://sunrisesunset.io/api/): Every parameter and response field, with worked examples and the edge cases that break first drafts, such as null times during polar day and utc_offset being in minutes. - [OpenAPI 3.0 specification, JSON](https://sunrisesunset.io/openapi.json): Machine-readable description of the API. Import into Postman or Insomnia, or generate a typed client from it. - [OpenAPI 3.0 specification, YAML](https://sunrisesunset.io/api/openapi.yaml): The same document in YAML. ## Locations - [Browse every country](https://sunrisesunset.io/explore/): Entry point into all 247 countries, 5,077 regions and 148,215 cities. - [City search](https://sunrisesunset.io/search?s=QUERY): Free-text search across every indexed place. - [Sitemap index](https://sunrisesunset.io/sitemap-index.xml): Every indexable URL on the site, split into per-type sitemaps. ## Articles - [Does the Sun Rise in the East? Only Twice a Year](https://sunrisesunset.io/does-the-sun-rise-in-the-east/): The sun rises due east on about two days a year and spends the rest of the year off to one side. In New York the sunrise point swings 63 degrees along the horizon. In Fairbanks it swings 140. - [Golden Hour and Blue Hour: How Long They Actually Last](https://sunrisesunset.io/golden-hour-blue-hour/): Golden hour is 40 minutes at the equator and over two hours in Stockholm in December. Blue hour is closer to ten minutes than an hour. The real numbers by latitude and season. - [The Shortest Day of the Year (and Why Your Earliest Sunset Already Happened)](https://sunrisesunset.io/shortest-day-of-the-year/): The December solstice is the shortest day, but the earliest sunset comes weeks before it and the latest sunrise weeks after. How far apart they fall depends on your latitude. - [What is the Summer Solstice and When Is It?](https://sunrisesunset.io/summer-solstice/): The summer solstice is the moment the sun reaches its farthest point north. Exact dates and times through 2030, how much daylight you get, and what the solstice is not. - [Astronomical Definitions: A Comprehensive Guide](https://sunrisesunset.io/astronomical-definitions/): Plain-English definitions for sunrise, solar noon, the three twilights, dusk and dawn, moon phases, eclipses, equinoxes and solstices, with the details most guides get wrong. - [How Long After Sunset Does It Get Dark? Twilight Times](https://sunrisesunset.io/when-does-it-get-dark/): Usable light often fades 20 to 40 minutes after sunset. Full darkness takes longer. Compare twilight times by city and season, and find your local dusk time. - [How Elevation Affects Sunset and Dusk Times](https://sunrisesunset.io/elevation-affect-sunset-times/): Climbing higher pushes sunset later, by roughly 5 minutes at 1,000 meters. Here is the actual math, why the popular rule of thumb is wrong, and why dusk gets shorter. - [Why Watching the Sunset Makes You Happier (The Science of Light)](https://sunrisesunset.io/sunset-happy/): Sunset viewing does lift your mood, but not for the reasons most articles claim. Here is what the research actually shows about evening light, cortisol, and awe. - [Sunset vs Dusk: The Difference and How Far Apart They Are](https://sunrisesunset.io/sunset-vs-dusk/): Dusk is not the same as sunset. It comes about 20 minutes to an hour later, when the sun is 6 degrees below the horizon. The gap by city and season, and what dusk means on a sign or in a law. - [How is Sunrise Calculated? (Refraction, Algorithms, and Math)](https://sunrisesunset.io/how-is-sunrise-calculated/): Sunrise occurs when the sun's upper limb hits the horizon. Learn the math behind the 90.833 degree zenith angle, atmospheric refraction, and the hour angle formula. - [Does Air Pollution Actually Make Sunsets Better?](https://sunrisesunset.io/pollution-sunset/): Common wisdom says pollution makes sunsets prettier. In most cases it does the opposite, muting the reds and oranges. Volcanic ash is the rare exception. - [Why Are Winter Sunsets So Colorful?](https://sunrisesunset.io/sunsets-winter/): Winter sunsets can look richer when clear air and high clouds let the colors through. Learn how haze, humidity, and the sun's angle affect the view. - [Are Sunsets the Same Everywhere?](https://sunrisesunset.io/sunsets-same-everywhere/): No. A sunset takes 2 minutes at the equator and 9 minutes in Alaska, and dry desert air produces far richer color than humid coastal air. What changes and why. - [Can There Be a Beautiful Sunset Without Clouds?](https://sunrisesunset.io/sunset-without-clouds/): Yes, and a cloudless sky shows you things a cloudy one hides: Earth's shadow, the Belt of Venus, the purple light, and the green flash. What to look for and when. ## Full content - [Every article in one file](https://sunrisesunset.io/llms-full.txt): The complete text of all 14 articles above, for reading in a single request. ## Optional - [Privacy policy](https://sunrisesunset.io/privacy/) - [Terms of service](https://sunrisesunset.io/terms/)