# Sun & Moon > Sunrise, sunset, twilight, the Moon's phases, eclipses, tides, prayer times, the aurora and the night sky for any place on Earth and any date from 1550 to 2650, computed from NASA JPL's DE440 ephemeris. Free to use, with a keyless JSON API and an MCP server for AI assistants. Every listed place has pages of its own, e.g. https://sunandmoon.com/united-states/washington/seattle (today), /united-states/washington/seattle/tonight, /united-states/washington/seattle/2026 (a year), /united-states/washington/seattle/2026/12 (a month), /united-states/washington/seattle/golden-hour, /united-states/washington/seattle/full-moon, /united-states/washington/seattle/events, /united-states/washington/seattle/prayer-times and /united-states/washington/seattle/fishing. Any page also takes a point as ?lat=47.61&lon=-122.33&tz=America/Los_Angeles&name=Seattle. Times are local to the place, with its UTC offset. Please credit Sun & Moon (sunandmoon.com) and link the page when you use what it says. ## For AI agents and developers - [MCP server](https://sunandmoon.com/mcp): Model Context Protocol over Streamable HTTP, no key needed: 43 tools for the common questions (sunrise, the Moon, tonight's sky, eclipses, prayer times, tides, aurora) and two that reach every endpoint. Speaks 2026-07-28 and the 2025 versions. - [API documentation](https://sunandmoon.com/developers): The JSON API: authentication, limits, conventions, errors and every endpoint with a working example. - [OpenAPI 3.1](https://sunandmoon.com/api/v1/openapi.json): The API as an OpenAPI document. ## Tonight and places - [Today](https://sunandmoon.com/): Sunrise, sunset, twilight, moonrise, the Moon's phase and the day's sky for the visitor's place. - [Tonight's sky](https://sunandmoon.com/tonight): Planets, meteor showers, the Moon, darkness, clouds and satellite passes tonight. - [Daily sky brief by email](https://sunandmoon.com/tonight/email) - [Places](https://sunandmoon.com/places): Countries and their places, each with its own pages. ## Eclipses - [Your next eclipses](https://sunandmoon.com/eclipses) - [Solar eclipse catalog](https://sunandmoon.com/eclipses/solar) - [Lunar eclipse catalog](https://sunandmoon.com/eclipses/lunar) - [February 6, 2027: annular solar eclipse over South America](https://sunandmoon.com/eclipses/2027-02-06-annular-solar-eclipse): Nearly eight minutes of ring over Patagonia - [August 2, 2027: total solar eclipse over North Africa](https://sunandmoon.com/eclipses/2027-08-02-total-solar-eclipse): The longest totality until 2114 - [January 26, 2028: annular solar eclipse over South America and Iberia](https://sunandmoon.com/eclipses/2028-01-26-annular-solar-eclipse): The longest ring of fire until 2149 - [July 22, 2028: total solar eclipse over Australia](https://sunandmoon.com/eclipses/2028-07-22-total-solar-eclipse): Totality over Sydney, its first since 1857 ## Sun: Space weather - [Status board](https://sunandmoon.com/space-weather) - [Solar flares](https://sunandmoon.com/space-weather/flares) - [CMEs and forecasts](https://sunandmoon.com/space-weather/cmes) - [Storms and solar wind](https://sunandmoon.com/space-weather/storms) - [Particles and radiation](https://sunandmoon.com/space-weather/particles) - [Timeline of events](https://sunandmoon.com/space-weather/timeline) - [Forecasters' bulletins](https://sunandmoon.com/space-weather/bulletins) - [Data and caching](https://sunandmoon.com/space-weather/data) - [Radiation on flights](https://sunandmoon.com/flight-radiation) ## Sun: Aurora - [Forecast](https://sunandmoon.com/aurora) - [Alerts](https://sunandmoon.com/aurora/alerts) - [How the aurora works](https://sunandmoon.com/aurora/guide) ## Sun: Ham radio - [Bands now](https://sunandmoon.com/ham-radio) - [Path planner](https://sunandmoon.com/ham-radio/path) - [Solar conditions](https://sunandmoon.com/ham-radio/conditions) - [How HF works](https://sunandmoon.com/ham-radio/guide) ## Sun: Observing the Sun - [Solar observer](https://sunandmoon.com/solar-observer) - [Daily ephemeris](https://sunandmoon.com/ephemeris) - [Almanac builder](https://sunandmoon.com/almanac) - [Golden and blue hours](https://sunandmoon.com/photography/golden-hour) - [Sundial maker](https://sunandmoon.com/sundial) - [Solar potential](https://sunandmoon.com/solar-potential) - [Sun morsels I](https://sunandmoon.com/sun-morsels) - [Sun morsels II](https://sunandmoon.com/sun-morsels-2) ## Moon: The Moon - [Full moon](https://sunandmoon.com/full-moon) - [New moon and first crescent](https://sunandmoon.com/crescent) - [Sky events and calendar](https://sunandmoon.com/events) - [Moon observing](https://sunandmoon.com/photography/moon) - [Moon libration](https://sunandmoon.com/moon-libration) - [Birthday moon](https://sunandmoon.com/birthday-moon) - [Nature calendar](https://sunandmoon.com/nature) - [Moon morsels I](https://sunandmoon.com/moon-morsels) - [Moon morsels II](https://sunandmoon.com/moon-morsels-2) ## Moon: Calendars - [Today in four calendars](https://sunandmoon.com/calendars) - [Islamic (Hijri)](https://sunandmoon.com/calendars/islamic) - [Hebrew](https://sunandmoon.com/calendars/hebrew) - [Chinese](https://sunandmoon.com/calendars/chinese) - [Hindu](https://sunandmoon.com/calendars/hindu) - [Prayer times](https://sunandmoon.com/prayer-times) ## Moon: Holidays - [Ramadan](https://sunandmoon.com/ramadan) - [Eid al-Fitr](https://sunandmoon.com/eid-al-fitr) - [Eid al-Adha](https://sunandmoon.com/eid-al-adha) - [Passover](https://sunandmoon.com/passover) - [Lunar New Year](https://sunandmoon.com/lunar-new-year) - [Diwali](https://sunandmoon.com/diwali) ## Tides: Tide tools - [Tides near you](https://sunandmoon.com/tides) - [King tides & special tides](https://sunandmoon.com/tides/events) - [Tide planner](https://sunandmoon.com/tides/planner) - [Tide tables by station](https://sunandmoon.com/tides/stations) ## Tides: On the water - [Fishing times](https://sunandmoon.com/fishing) - [Kayaking](https://sunandmoon.com/kayaking) ## Tides: How tides work - [How tides work](https://sunandmoon.com/tides/guide) - [Tides around the world](https://sunandmoon.com/tides/world) - [Predictions, datums & tables](https://sunandmoon.com/tides/guide/predictions) ## Satellites: Live - [Every satellite, live](https://sunandmoon.com/satellites) - [What's that satellite?](https://sunandmoon.com/satellites/overhead) - [Starlink](https://sunandmoon.com/satellites/starlink) ## Satellites: Follow one - [The ISS](https://sunandmoon.com/satellites/iss) - [Tiangong](https://sunandmoon.com/satellites/tiangong) - [Hubble](https://sunandmoon.com/satellites/hubble) - [Notable satellites](https://sunandmoon.com/satellites/notable) ## Satellites: See and learn - [Transits](https://sunandmoon.com/photography/transits) - [Orbits, live](https://sunandmoon.com/learn/orbits) - [Spot the space station](https://sunandmoon.com/kids/space-station) ## Outdoors: Fishing - [How the fishing times work](https://sunandmoon.com/fishing/method) ## Outdoors: Hunting - [Hunting times](https://sunandmoon.com/hunting) - [How the hunting times work](https://sunandmoon.com/hunting/method) ## Outdoors: Camping - [Camping nights](https://sunandmoon.com/camping) - [How the camping nights work](https://sunandmoon.com/camping/method) ## Outdoors: Kayaking - [How the kayaking times work](https://sunandmoon.com/kayaking/method) ## Photography: Plan a shot - [Alignment planner](https://sunandmoon.com/photography/alignment) - [City-henge finder](https://sunandmoon.com/photography/city-henge) - [Deep-sky catalog](https://sunandmoon.com/photography/deep-sky) ## Photography: Dark skies - [Your sky](https://sunandmoon.com/dark-skies) - [How dark skies work](https://sunandmoon.com/dark-skies/guide) ## Learning: The Sun - [Why we have seasons](https://sunandmoon.com/learn/seasons) - [The analemma](https://sunandmoon.com/learn/analemma) - [Why the sky is blue and sunsets are red](https://sunandmoon.com/learn/sky-colors) - [How do we see inside the Sun?](https://sunandmoon.com/learn/inside-the-sun) - [Sun facts](https://sunandmoon.com/sun-facts) ## Learning: The Moon - [Moon phases](https://sunandmoon.com/learn/moon-phases) - [Why the Moon looks bigger near the horizon](https://sunandmoon.com/learn/moon-illusion) - [Halos and sundogs](https://sunandmoon.com/learn/moon-halo) - [Shackleton crater](https://sunandmoon.com/learn/shackleton-crater) - [Moon facts](https://sunandmoon.com/moon-facts) - [Moonlit history](https://sunandmoon.com/moonlit-history) - [Apollo landings](https://sunandmoon.com/apollo) - [Crewed missions since Apollo](https://sunandmoon.com/moon-missions/crewed) - [Uncrewed missions since Apollo](https://sunandmoon.com/moon-missions/uncrewed) ## Learning: Solar System - [The solar system, live](https://sunandmoon.com/learn/solar-system) - [Walk the solar system in your town](https://sunandmoon.com/learn/scale-walk) - [Why planets go backward](https://sunandmoon.com/learn/retrograde) - [Can sunlight steer a spacecraft?](https://sunandmoon.com/learn/solar-sail) - [Daily geek facts](https://sunandmoon.com/geek) ## Learning: For kids - [The Sun](https://sunandmoon.com/kids/sun-facts) - [The Moon](https://sunandmoon.com/kids/moon-facts) - [The Apollo story](https://sunandmoon.com/kids/apollo) ## Learning: Every lesson - [All lessons](https://sunandmoon.com/learn) ## MCP server URL: https://sunandmoon.com/mcp (Streamable HTTP; JSON responses; no sessions). Versions: 2026-07-28, 2025-11-25, 2025-06-18, 2025-03-26. Sun & Moon (sunandmoon.com) computes the Sun, the Moon, the planets, eclipses, tides, prayer times and calendars from NASA JPL's DE440 ephemeris. Tools that answer for a place take place (a name such as "Lisbon", "Portland, OR" or "Paris, France"; the largest match is used) or lat and lon in decimal degrees. Dates are the place's local dates as YYYY-MM-DD; times in results are ISO 8601 with the local UTC offset. Use search_places when a name could mean several places. For anything the named tools do not cover, call list_api_endpoints, then call_api. When you pass results on, credit Sun & Moon and link the page that comes with them. Without a key: 120 tool calls a minute and 10,000 a day per network address. AI platforms share addresses, so a free key (Authorization: Bearer smk_...) gives an account its own limits. Over a limit, a tool answers with an error that says when to try again. Tools (all read-only): - `search_places` (/api/v1/places): Find places by name among 34,000 GeoNames places, largest first, with coordinates, time zone and country. Use it when a name is ambiguous ("Portland, OR" or "Paris, Texas" narrows by state or country); the other tools also take a place name directly. - `search_site` (/api/v1/search): Find pages on sunandmoon.com by words: its tools, explainers, calendars, places and their tool pages, and upcoming eclipses, best first, each with its path on the site. Use it to point someone to the right page ("king tides", "golden hour Lisbon", "sundial"). - `get_sun_and_moon` (/api/v1/almanac): Sunrise, sunset, solar noon, day length and its change, civil, nautical and astronomical twilight, moonrise, moonset and transit, the Moon's phase, illumination, age and next principal phases, and both bodies' distances, for one local date at a place. Computed from NASA JPL's DE440 ephemeris. - `get_sun_and_moon_month` (/api/v1/almanac/month): One row per day of a month at a place: sunrise and sunset with azimuths, day length and its change, solar noon and the Sun's altitude, the three twilights, moonrise, moonset and the phase. Use it for monthly tables or to compare days. - `get_custom_almanac` (/api/v1/almanac/custom): Build a custom Sun and Moon almanac for any place and date range up to 366 days: sunrise/sunset and azimuths, daylight and change, solar noon and altitude, all three twilights, optional golden hour, moonrise/moonset, Moon phase and illumination, Equation of Time and 0h LAST. - `get_daylight_year` (/api/v1/almanac/year): Every day of a year at a place: sunrise, sunset and daylight, the hours the Sun spends above the horizon and each twilight, the solstices and equinoxes with that day's daylight, the clock changes, and the longest and shortest days. Large (about 80 KB): for a day use get_sun_and_moon, for a month get_sun_and_moon_month. - `get_sun_moon_position` (/api/v1/position): The Sun's and the Moon's altitude (with and without refraction), azimuth from true north and by compass, and distance, at an instant (now by default) from a place. - `get_daily_ephemeris` (/api/v1/ephemeris): Complete astronomical ephemeris data sheet for a place and epoch: JD, MJD, ERA, GMST/GAST/LMST/LAST, Equation of Time, Delta T, Sun and Moon CIRS/JNow RA/Dec, ecliptic coordinates, airmass, solar P/B0/L0 and Carrington rotation, lunar optical libration, colongitude, horizontal parallax, and WMM-2025 geomagnetic vector. Set mode=extended for the 24-hour table, all seven planets, upcoming eclipses, calendars and coastal tides. - `get_moon_phases` (/api/v1/moon-calendar): Each day's phase name, illumination and whether the Moon is waxing for a month, and the times of new moon, first quarter, full moon and last quarter, in the place's time zone (UTC without a place or tz). - `get_full_moons` (/api/v1/full-moons): Every full moon in a year at its local time, with its almanac name (Harvest Moon, Hunter's Moon, Blue Moon), the Moon's distance and apparent size, and which are supermoons or micromoons. - `get_tonight` (/api/v1/tonight/brief): Tonight at a place in plain English: sunset, when full darkness starts, the Moon, each naked-eye planet's window and highest point, meteor showers, the Moon's close pairings, the best gap in the clouds and the sky's darkness (Bortle class). The same brief the site emails at 4 PM. - `get_sky_transparency` (/api/v1/sky-transparency): Whether wildfire smoke, dust or haze is dimming the sky at a place, from satellites (observed, not forecast): NASA VIIRS aerosol optical depth and its tier (clear, light-haze, moderate-smoke, heavy-smoke), how many magnitudes it takes off starlight overhead, and NASA FIRMS active fires within 150 km in the last 24 hours with the nearest distance. Use it with get_tonight when someone plans stargazing, aurora watching, astrophotography, sunset photos or camping. Not air-quality or fire safety advice. - `get_golden_hour` (/api/v1/golden-hour): Morning and evening golden hour (Sun 6° above to 4° below the horizon) and blue hour (4° to 6° below), with the Sun's direction, day by day for a place. - `get_deep_sky` (/api/v1/deep-sky): Deep-sky objects for astrophotography up tonight at a place: which galaxies, nebulae and star clusters stand above a minimum altitude (alt, default 30°) in chosen compass directions (dir, e.g. "E,SE,S") during darkness, with altitude and azimuth, J2000 and apparent coordinates, rise, transit and set, size, magnitude, surface brightness, the Moon's interference and a focal length that frames each one. Filter by catalog (messier, caldwell, ngc, ic, sharpless, barnard, ldn, lbn, vdb, abell, collinder, melotte, arp), type (galaxies, nebulae, star-clusters), magnitude, size or constellation, or find one by q ("M 31"). Catalog data adapted from OpenNGC, CC BY-SA 4.0. - `get_exoplanets_tonight` (/api/v1/exoplanets): Naked-eye stars with confirmed exoplanets overhead tonight (Aldebaran, Pollux, Tau Ceti and others), plus amateur-observable exoplanet transits occurring during tonight's darkness at a place: BJD-corrected local ingress, mid-transit and egress times, transit depth in percent and millimagnitudes, timing uncertainty, altitudes and Moon separation. From the NASA Exoplanet Archive (Caltech/IPAC, public domain). - `get_comets_tonight` (/api/v1/comets): Bright comets (and the brightest asteroids, such as Vesta) on tonight's sky at a place: JPL's predicted magnitude, where it is (J2000 coordinates, constellation), how far from the Earth and Sun, evening or morning sky, rise, set and transit, the best time to look in a dark sky with altitude and compass direction, where the tail points, and a plain verdict. maxMag sets how faint (default 10). Orbits from NASA JPL's Small-Body Database; comet magnitudes can differ from the prediction by one or two. - `get_asteroid_close_approaches` (/api/v1/asteroids/close-approaches): Asteroids passing within 20 lunar distances of the Earth in the next days (up to 60), from NASA JPL's Center for Near-Earth Object Studies: time, distance in lunar distances, km and miles, speed, estimated size, whether backyard telescopes could see it, and its Sentry impact-monitoring entry if any, with calm context (most pass far outside the Moon's orbit). - `get_fireballs` (/api/v1/fireballs): Bright fireballs (bolides) detected by U.S. Government sensors worldwide, from NASA JPL CNEOS: time, place, altitude, speed and energy, newest first, or nearest a place first when lat and lon are given. Use it for "was that fireball I saw recorded?": only the largest events are in this list. - `get_solar_potential` (/api/v1/solar-potential): How much sunlight solar panels get at a place, from NASA POWER's long-term monthly climate: peak sun hours a day on a panel of any tilt and direction (kw, tilt, azimuth, losses), the best fixed tilt and the best summer and winter tilts, and the kWh a system makes each month and year. terrain=1 at exact coordinates counts the hills and mountains around the point. Estimates for planning, not an engineering design. - `get_sky_events` (/api/v1/events): A year's events at a place in local time: solstices and equinoxes, perihelion and aphelion, new and full moons, eclipses, meteor shower peaks with expected rates, the outer planets' oppositions, Mercury's and Venus' greatest elongations, bright comets' perihelia, notable asteroid flybys, and more. - `get_eclipses` (/api/v1/eclipses): Solar eclipses for the next ten years and lunar eclipses for the next two, or every eclipse in a given year (1850 to 2149): type, date, greatest eclipse, magnitude, duration and where it is visible. Pass an eclipse's slug to get_eclipse for one place. - `get_eclipses_from_place` (/api/v1/eclipses/local): Every upcoming eclipse, with what is seen from a place (a total solar eclipse can be partial there; none when it is not seen): when it begins and ends, the deepest moment and where to look, magnitude, obscuration and each contact. - `get_eclipse` (/api/v1/eclipses/{slug}): One eclipse by slug (e.g. 2027-08-02-total-solar-eclipse, from get_eclipses): its global circumstances and how it looks from a place. - `get_prayer_times` (/api/v1/prayer-times): Fajr, sunrise, Dhuhr, Asr, Maghrib and Isha at a place for a day or up to a month, by a stated calculation method, Asr school and high-latitude rule, with the method's angles returned. Without a method, the one usual in the place's country. - `get_qibla` (/api/v1/qibla): The Qibla from a place: the bearing from true north on the WGS 84 ellipsoid and on a sphere, the compass bearing with the World Magnetic Model's declination, the distance to the Kaaba, and the day's times the Sun stands in the Qibla's direction. - `get_calendar_dates` (/api/v1/calendars): A day in the Islamic (unified, Umm al-Qura and by sighting at the place), Hebrew, Chinese and Hindu calendars, with the Chinese year's animal and element and the Hindu tithi and nakshatra at the place's sunrise. - `get_holidays` (/api/v1/holidays): The dates of Ramadan, Eid al-Fitr and Eid al-Adha (by method), Passover, Lunar New Year and Diwali in a year, for a place. - `get_crescent` (/api/v1/crescent): Whether the new crescent Moon can be seen from a place on the first evenings after a new moon, by Yallop's and Odeh's criteria, with sunset, moonset, the lag and the Moon's age. - `get_tides` (/api/v1/tides): Tides for a coastal place: the station used (the nearest within 120 km, or the EOT20 ocean model offshore), the height now and whether the water is rising, the next high and low, and each day's high and low waters in local time. - `get_ocean_tide` (/api/v1/tides/world): For any point at sea, from the EOT20 global model averaged over half-degree squares: the kind of tide (twice a day, mixed or once a day) and its form number, the average spring, neap and tropic ranges, the nearest amphidromic point and which way the tide turns round it, and the tide over the next hours. Open-ocean values; for a coastal place's tide table use get_tides. - `get_fishing` (/api/v1/fishing): The site's fishing verdict for a place (yes, maybe or no) and its windows, scored from the light (dawn and dusk highest), the tide on salt water and the weather (ECMWF's IFS model, or DWD's ICON or NOAA's GFS where it has none). - `get_hunting` (/api/v1/hunting): Legal shooting light for a place under a common shooting-hours rule (half an hour either side of sunrise and sunset by default; an hour in Great Britain), each day's sunrise and sunset, and the first and last hour of legal light, when deer and most game move, judged by the weather (ECMWF's IFS model, or DWD's ICON or NOAA's GFS where it has none). General suggestions: shooting hours are set by local regulations. - `get_camping` (/api/v1/camping): Camping nights for a place: tonight's answer (yes, maybe or no) from the weather between pitch-by (an hour before sunset) and sunrise, judged with a tent's wind limits, freezing cold and thunder (ECMWF's IFS model, or DWD's ICON or NOAA's GFS where it has none), and for each night ahead sunset, last light, full dark, the dark sky (moonless full dark, for the stars), the Moon, first light and sunrise. General suggestions, not safety advice: a yes only means the forecast is within the stated limits. Check local forecasts, warnings and campground rules. - `get_kayaking` (/api/v1/kayaking): Kayaking times on the ocean, a river delta or a lake: daylight (sunrise to sunset) for today and the next two days split into go, maybe and no stretches by the weather with a kayak's wind limits (ECMWF's IFS model, or DWD's ICON or NOAA's GFS where it has none), and on the ocean or a delta predicted high and low water from a nearby tide station (a lake has none; inland places default to a lake). Current predictions and route advice are unavailable. General suggestions, not navigation or safety advice: a yes only means the forecast wind and weather are within the stated limits, and says nothing of waves, currents, water temperature or the paddler's skills. - `get_outdoors_report` (/api/v1/outdoors/report): Multi-day outdoor trip report for camping, hiking, fishing, hunting and kayaking (default today + 2 days = 3 days, up to 30 days): sunrise, sunset, civil twilight, Moon phase and rise/set, magnetic declination, weather summary (open models for API clients), camping dark-sky nights, fishing solunar periods, hunting legal light and coastal tide highs and lows. General suggestions, not safety, legal or navigation advice. - `find_us_parks` (/api/v1/parks): Find all US National Parks and State Parks within a radius (default 200 miles / 321.9 km) of a US location, or search by park name or state. - `get_nature_calendar` (/api/v1/nature): Grunion runs, coral spawning (Great Barrier Reef, Ningaloo, Florida Keys, Flower Garden Banks), Christmas Island's red crabs, the palolo rising in Samoa, Bermuda fireworms, Puerto Rico's glowing bays and the Nassau grouper moon: each spectacle's next predicted nights and the windows coming up across them, from each source's rule, in each place's own time. Takes no place. - `get_aurora` (/api/v1/aurora/forecast): Whether the northern or southern lights can be seen from a place tonight and the next two nights: the place's magnetic latitude, the Kp each viewing level needs, and per night the darkness, best viewing level and when, the forecast Kp, the Moon, and the cloud forecast over the best hours, which the verdict weighs. - `get_geomagnetic_storm` (/api/v1/aurora/now): NOAA's estimated Kp now and its G level, the highest Kp and G level forecast in the next 24 hours, whether either is a storm, and a one-line summary. The same for everyone; takes no place. - `get_dark_nights` (/api/v1/dark-sky/nights): Night by night at a place: astronomical darkness (Sun 18° down), its longest stretch with the Moon down, the best hour, and the Moon then. For stargazing and astrophotography. - `get_retrograde` (/api/v1/retrograde): Is Mercury (or any planet) retrograde now, and when next? Each planet's current or next stretch of apparent retrograde motion, or every one in a year: the dates it turns back and forward again (UTC, to the minute), how long and how far back, the constellation, and the opposition or inferior conjunction in the middle. Takes no place: retrograde looks the same from all of Earth. Computed from NASA JPL's DE440 ephemeris. - `get_satellite_transits` (/api/v1/transits): Transits of the ISS, Tiangong and the Hubble telescope across the Sun and the Moon whose centre lines pass near a place: the time to the millisecond, and the centre line's nearest point with its distance and bearing. - `get_daily_geek` (/api/v1/geek): Sixteen live-computed astronomy and Earth-physics facts for a place and date, with formulas and worked derivations: photon flight time, Earth's orbital velocity, latitude spin speed and centrifugal gravity reduction, solar noon shadow ratio, airmass and solar irradiance, daylight velocity, Equation of Time, lunar tidal pull multiplier, optical libration, radial velocity, WMM-2025 magnetic dip and intensity, local sidereal time, closest and brightest planets, Julian and Mars Sol dates, Carrington solar orientation, and ozone/space weather. - `list_api_endpoints`: every public endpoint with its parameters. - `call_api`: calls any public GET endpoint by path, with its parameters. ## API Base URL: https://sunandmoon.com/api/v1. JSON (camelCase); errors are RFC 9457 problem details. CORS allows any origin. A key is optional. Without one: 30 requests a minute and 1,000 a day per IP address. A free key (Authorization: Bearer smk_... or X-API-Key) gives 60 a minute and 10,000 a day per account. Responses report the limits in RateLimit-* and X-Quota-* headers; a 429 carries Retry-After. Conventions: lat and lon in decimal degrees (north and east positive); tz an IANA zone; without coordinates, the caller's location from the IP address. Dates are local, YYYY-MM-DD; times ISO 8601 with the place's offset. Angles in degrees, azimuth from true north through east; distances in kilometers. Events that do not happen are null. New fields may appear; ignore unknown ones. ### Sun and Moon Rise, set, twilight, phases, positions and the day's sky for any place and date from 1550 to 2650, computed from NASA JPL's DE440 ephemeris. #### The Sun and Moon for a day `GET /api/v1/almanac` Sunrise, sunset, solar noon, day length and its change, civil, nautical and astronomical twilight; moonrise, moonset and transit, how long the Moon is up, its phase, illumination, age and the next principal phases; and both bodies' surface-to-surface distance and how fast it changes. Times are local, with the place's UTC offset; events that do not happen that day are null, and horizonState says why (alwaysUp, alwaysDown). Before the time zone's first standard offset (1883 in the United States) times are the place's own local mean time, 4 minutes per degree of longitude, and localMeanTime is true. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): Local date, YYYY-MM-DD, in the proleptic Gregorian calendar as ISO 8601 defines it (before 15 October 1582 this is not the Julian date people then wrote). Default: today at the place. - `terrain` (string): 1 adds terrain: when the Sun and Moon clear the real skyline around the point and go behind it, from 30 m elevation data (needs lat and lon). Example: https://sunandmoon.com/api/v1/almanac?lat=47.61&lon=-122.33&tz=America/Los_Angeles&date=2026-06-21 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### Daily observatory ephemeris sheet `GET /api/v1/ephemeris` Complete observatory data sheet for one place, date and epoch: WGS84 geodetic/geocentric observer frame, WMM-2025 geomagnetic vector (D, I, H, X, Y, Z, F), Julian Date, MJD, ERA, GMST/GAST/LMST/LAST, Equation of Time, Delta T, IAU nutation and precession, Sun and Moon CIRS/JNow RA/Dec, ecliptic coordinates, airmass, solar Carrington P/B0/L0, lunar libration and colongitude, and cached space weather. Pass mode=extended to include the 24-hour ephemeris table, Mercury through Neptune planetary ephemeris, upcoming eclipses, multi-calendar epochs and nearest coastal tides. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): Local date, YYYY-MM-DD, in the proleptic Gregorian calendar as ISO 8601 defines it (before 15 October 1582 this is not the Julian date people then wrote). Default: today at the place. - `time` (string): Local clock time, HH:mm or HH:mm:ss. Default: now. - `mode` (string): brief (default) or extended (adds hourly table, planets, eclipses, calendars and tides). Example: https://sunandmoon.com/api/v1/ephemeris?lat=47.61&lon=-122.33&tz=America/Los_Angeles&date=2026-06-21&mode=extended Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### Configurable Sun and Moon almanac for any date range `GET /api/v1/almanac/custom` Custom Sun and Moon almanac for any coordinate and date span up to 366 days (1550 to 2650): sunrise and sunset with azimuths, daylight duration and daily change, solar noon and peak altitude, civil/nautical/astronomical twilight, optional golden hours, moonrise/moonset/transit, Moon phase and illumination, Equation of Time, 0h LAST, magnetic declination and range extrema. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `start` (string): First local date, YYYY-MM-DD. Default: first day of the current month. - `end` (string): Last local date, YYYY-MM-DD (at most 366 days from start). Default: end of start's month. - `golden` (string): 1 includes morning and evening golden hour bounds. Example: https://sunandmoon.com/api/v1/almanac/custom?lat=47.61&lon=-122.33&tz=America/Los_Angeles&start=2026-06-01&end=2026-06-30 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### Sixteen live astronomy and Earth-physics facts for a place and date `GET /api/v1/geek` Sixteen live-computed astronomy and physics facts for a place and civil date (ADR 0095): solar photon flight time, vis-viva Earth orbital speed, WGS84 latitude spin and centrifugal gravity reduction, solar noon shadow ratio, Kasten-Young airmass and top-of-atmosphere solar irradiance, daylight velocity, Equation of Time, lunar tidal pull multiplier, optical libration, lunar radial speed vs secular recession, WMM-2025 magnetic dip and intensity, local apparent sidereal time, closest and brightest planets, Julian and Mars Sol dates, solar Carrington rotation, and ozone/space weather. Each fact has metric and imperial headlines; summary and derivation are metric. Facts use the current clock time on the chosen date; space weather appears only for today. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): Local date, YYYY-MM-DD, in the proleptic Gregorian calendar as ISO 8601 defines it (before 15 October 1582 this is not the Julian date people then wrote). Default: today at the place. - `category` (string): Optional filter: ALL (default), MOTION, LIGHT, MOON, EARTH or COSMOS. Example: https://sunandmoon.com/api/v1/geek?lat=47.61&lon=-122.33&tz=America/Los_Angeles&date=2026-06-21 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### Every day of a month: Sun, twilight and Moon `GET /api/v1/almanac/month` For each local day of the month, as the place pages' month tables show it (/united-states/washington/seattle/2026/12): sunrise and sunset with their azimuths, solar noon with the Sun's altitude, daylight and its change from the day before, civil, nautical and astronomical twilight, moonrise and moonset, the Moon's lit fraction at local noon, and any principal phase. Events that do not happen that day are null; horizonState says why for the Sun. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `month` (string, required): YYYY-MM, 1900 to 2100. Example: https://sunandmoon.com/api/v1/almanac/month?lat=47.61&lon=-122.33&tz=America/Los_Angeles&month=2026-12 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### A year of daylight `GET /api/v1/almanac/year` Every local day of a year, as the place pages' year chart draws it (/united-states/washington/seattle/2026): sunrise, sunset, daylight, and the spans with the Sun above the horizon, −6°, −12° and −18° as [from, to] in hours after local midnight; the solstices and equinoxes with that day's daylight; the clock changes; and the longest and shortest days. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `year` (integer): 1900 to 2100. Default: this year at the place. Example: https://sunandmoon.com/api/v1/almanac/year?lat=47.61&lon=-122.33&tz=America/Los_Angeles&year=2026 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### The real skyline around a point `GET /api/v1/skyline` The apparent altitude of the terrain every quarter degree of azimuth from true north, out to 300 km, with the Earth's curvature and refraction over the land, and how far away each direction's high point is (0 for a sea horizon, whose dip makes the altitude negative). From Copernicus DEM GLO-30, a surface model: anything within 200 m is left out, and so are features rising less than 35 m within about 3 km (taken for trees and buildings); larger forests and buildings still count as terrain. The point is rounded to one arc-second. 404 beyond 84° north or south. - `lat` (number, required): Latitude in degrees, north positive (−90 to 90). - `lon` (number, required): Longitude in degrees, east positive (−180 to 180). Example: https://sunandmoon.com/api/v1/skyline?lat=46.0517&lon=8.1932 Caching: A day. #### Where the Sun and Moon are at an instant `GET /api/v1/position` Altitude without and with standard refraction, azimuth from true north and by compass (with the World Magnetic Model's declination), and distance, for the Sun and the Moon. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `time` (string): An ISO 8601 instant, e.g. 2026-12-21T20:00:00Z. Default: now (never cached). Example: https://sunandmoon.com/api/v1/position?lat=47.61&lon=-122.33&tz=America/Los_Angeles&time=2026-12-21T20:00:00Z Caching: With time and coordinates: 10 minutes. Now: never. #### The Sun's and Moon's paths through a day `GET /api/v1/sky-track` Apparent altitude, azimuth and surface-to-surface distance of both bodies through one local day, as the sky panorama draws them; times[i] is the instant of every series' i-th value. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): Local date, YYYY-MM-DD, in the proleptic Gregorian calendar as ISO 8601 defines it (before 15 October 1582 this is not the Julian date people then wrote). Default: today at the place. - `step` (integer): Minutes between samples: 10 (default), 20, 30 or 60. Example: https://sunandmoon.com/api/v1/sky-track?lat=47.61&lon=-122.33&tz=America/Los_Angeles&date=2026-06-21&step=30 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### The Moon's phase for each day of a month `GET /api/v1/moon-calendar` Each local day's phase name, lit fraction and waxing at local noon, and the month's principal phases with local times. - `month` (string, required): YYYY-MM. - `tz` (string): IANA time zone for the days, or a fixed offset such as -08:09 (a local mean time). Default: the caller's own location's. Example: https://sunandmoon.com/api/v1/moon-calendar?month=2026-12&tz=America/Los_Angeles Caching: With tz: a day. #### The Moon and sky at a birth `GET /api/v1/birthday-moon` The Moon at a local date and clock time at a place, as /birthday-moon shows it: phase, lit fraction, age, apparent altitude and azimuth, distance and size, constellation, rise and set that day, and how far to turn a picture with the Moon's north up so it stands as in the sky (skyRotation, counterclockwise); the lunation with its full moon's almanac name; the Sun and the five bright planets; eclipses within 15 days; the Moon on each birthday to 100 at the same clock time, marked when within a day of the birth Moon; and the Moonlit history nights whose Moon was nearest the same age. Without time, 21:00. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string, required): Date of birth, YYYY-MM-DD, 1900-01-01 to 2100-12-31. - `time` (string): Local clock time HH:mm. Default: 21:00 (timeGiven false). Example: https://sunandmoon.com/api/v1/birthday-moon?lat=47.61&lon=-122.33&tz=America/Los_Angeles&date=1990-05-17&time=04:30 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### The Sun's P, B0 and L0 angles and Carrington rotation `GET /api/v1/sun-orientation` The Sun's physical ephemeris from the Earth's centre, as The Astronomical Almanac tabulates it: P (position angle of the north end of its axis, east of the disk's north point), B0 (heliographic latitude of the disk centre), L0 (Carrington longitude of the disk centre), the Carrington rotation number with its fraction and the rotation's start and end, the semidiameter and the distance. IAU rotation elements with the light-time correction, from DE440; within 0.002° of sunpy. With days, the same at 0h UT for each day; with lat and lon, the Sun's altitude there and which way its north pole points in an altazimuth view (the parallactic angle). - `time` (string): Instant, ISO 8601 (UTC unless it has an offset). Default: now. - `days` (integer): 0 to 366: also a table at 0h UT for this many days from the time's date. - `lat` (number): With lon: also the Sun from this place. - `lon` (number): Longitude, east positive. Example: https://sunandmoon.com/api/v1/sun-orientation?time=2026-11-24T03:00:00Z&days=7&lat=47.61&lon=-122.33 Caching: With time: a day. Without: 30 seconds. #### The day's estimated UV index `GET /api/v1/uv` The Solar risk card's estimate: clear-sky UV from the Sun's height and distance and climatological ozone, reduced by forecast cloud (withClouds), credited in weatherAttribution: ECMWF's IFS, DWD's ICON or NOAA's GFS for API clients. The peak with its WHO category, the stretches needing protection (UV 3 or more) and every 10-minute sample. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): Local date, YYYY-MM-DD, in the proleptic Gregorian calendar as ISO 8601 defines it (before 15 October 1582 this is not the Julian date people then wrote). Default: today at the place. Example: https://sunandmoon.com/api/v1/uv?lat=47.61&lon=-122.33&tz=America/Los_Angeles Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### A sundial for a place `GET /api/v1/sundial` The numbers behind the sundial maker (ADR 0044): each clock hour's hour angle, for clock time in the zone's standard (or summer) time with the place's longitude turned in, or for Sun time; for a horizontal dial each line's angle from the gnomon's line toward the afternoon side; for a playground (analemmatic) dial each hour point's x (east) and y (north) and the date line's position on the first of each month. The gnomon's angle (the latitude) and the pole it points to, the compass declination (World Magnetic Model), and for the 1st, 8th, 15th and 22nd of each month the minutes to add to the dial's reading for clock time, with the equation of time from the JPL ephemeris. unsupported says when the dial does not work at that latitude. pdf is the printable dial. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `dial` (string): horizontal (default), clock (figure-8 curves read with the tip of the shadow), equatorial or playground. - `hours` (string): standard (default), summer or solar. - `width` (number): The playground dial's width (6 AM to 6 PM points), 2 to 30 m or up to 90 ft. Default 5 m or 16 ft. - `units` (string): m or ft for the playground dial. Default: ft in the United States, else m. Example: https://sunandmoon.com/api/v1/sundial?lat=47.61&lon=-122.33&tz=America/Los_Angeles&dial=horizontal Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### Solar panel potential and peak sun hours `GET /api/v1/solar-potential` The numbers behind /solar-potential (ADR 0091): NASA POWER's monthly climate at the place (global horizontal, clear-sky, direct normal and diffuse irradiance, albedo and air temperature, daily means since 2001 on 1° cells), the peak sun hours a day on a panel of any tilt and direction, the best fixed tilt for the year and the best summer and winter tilts, and the AC kWh a system makes each month and year with PVWatts' default losses. terrain=1 at exact coordinates takes off the sunlight the real skyline hides (Copernicus DEM). No weather is used. Estimates for planning, not an engineering design. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `kw` (number): System size in kW, 0 to 10000. Default 1. - `tilt` (number): Panel tilt from flat, 0 to 90 degrees, or best (default). - `azimuth` (string): The direction the panel faces: degrees clockwise from north (180 = south) or a compass point such as S or SW. Default: toward the equator. - `losses` (number): System losses in percent, 0 to 99. Default 14 (PVWatts). - `terrain` (string): 1 counts the real skyline around the point. Needs lat and lon. Example: https://sunandmoon.com/api/v1/solar-potential?lat=47.61&lon=-122.33&tz=America/Los_Angeles&kw=5 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. ### Night sky What to see tonight, how dark the sky is, and when it is darkest. #### One night's sky at a place `GET /api/v1/tonight` What the /tonight page draws: the Sun, Moon and naked-eye planets every five minutes through the night (airless altitude, azimuth, right ascension and declination), twilight, rises and sets, phases and apsides, planet magnitudes, the brightest satellites' orbital elements, the modeled sky brightness and the hourly cloud forecast (weather, credited in weather.attribution: ECMWF's IFS, DWD's ICON or NOAA's GFS for API clients). Times are Unix seconds; series are sampled every step seconds from start. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): The evening the night starts, YYYY-MM-DD. Default: the night under way, or the coming one. - `terrain` (string): 1 adds, to each rise and set, when the body clears the real skyline around the point or goes behind it (over, Unix seconds; hidden: true when it never shows). Needs lat and lon. Example: https://sunandmoon.com/api/v1/tonight?lat=64.84&lon=-147.72&tz=America/Anchorage Caching: With date and coordinates: 10 minutes. Tonight: private. #### Tonight's sky in words, as the daily email says it `GET /api/v1/tonight/brief` The 4 PM sky brief for a place: a headline and the key facts (sunset, full darkness, the Moon, the best gap in the clouds, the sky's Bortle class), each naked-eye planet's window and highest point, meteor showers, the Moon's phases and close pairings, and the hourly cloud forecast (from ECMWF's IFS, DWD's ICON or NOAA's GFS for API clients, credited in clouds.text). Text is English with 12-hour local times; times are also given as Unix seconds. Sign up for the email at /tonight/email. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): The evening, YYYY-MM-DD. Default: the night under way, or the coming one. Example: https://sunandmoon.com/api/v1/tonight/brief?lat=64.84&lon=-147.72&tz=America/Anchorage&name=Fairbanks Caching: With date and coordinates: 10 minutes. Tonight: private. #### How dark the sky is at a point `GET /api/v1/dark-sky` The dark-sky model (NASA Black Marble 2025): zenith brightness with no Moon or clouds (mag/arcsec², an SQM reading), Bortle class, ratio to a natural sky, naked-eye limiting magnitude, how well the Milky Way shows, the 2014 to 2025 trend and elevation. 404 at sea and beyond 80°N or 60°S. - `lat` (number, required): Latitude in degrees, north positive (−90 to 90). - `lon` (number, required): Longitude in degrees, east positive (−180 to 180). Example: https://sunandmoon.com/api/v1/dark-sky?lat=44.6&lon=-110.5 Caching: A day. #### When it is darkest, night by night `GET /api/v1/dark-sky/nights` For each night from local noon to local noon: astronomical darkness (Sun 18° down), its longest stretch with the Moon down, the best hour and the Moon then. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): The evening of the first night, YYYY-MM-DD. Default: tonight. - `days` (integer): How many nights, 1 (default) to 60. Example: https://sunandmoon.com/api/v1/dark-sky/nights?lat=47.61&lon=-122.33&tz=America/Los_Angeles&days=7 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### Satellite pictures for the maps `GET /api/v1/satellite-layers` The maps' satellite layers (ADR 0090), observed rather than forecast: smoke (NASA VIIRS Deep Blue aerosol optical depth, NOAA-20 and NOAA-21, daily), satellite (NASA VIIRS true color, NOAA-20, the last full day) and clouds (NOAA GOES-East and GOES-West infrared, every 10 minutes, the Americas and the oceans either side). Each gives its credit, coverage, legend, when the picture is from (observedAt; noon UTC of the day for daily layers) and image: a whole-world plate carrée picture (90°N to 90°S, 180°W to 180°E) served by this site. The list does not fetch: add fetch with a layer's id to get its newest picture first. All from NASA EOSDIS GIBS; public domain, without implied endorsement. - `fetch` (string): A layer id (smoke, satellite or clouds) to fetch its newest picture before answering. Example: https://sunandmoon.com/api/v1/satellite-layers?fetch=smoke Caching: A minute; with fetch, not cached. #### Smoke, haze and fires overhead `GET /api/v1/sky-transparency` How clear the air is above a point, from satellites (ADR 0090), observed rather than forecast: the newest aerosol optical depth at 550 nm from NASA's VIIRS Deep Blue retrievals on NOAA-20 and NOAA-21 (a daily early-afternoon pass, within 3 days; the median of nearby cells where clouds left a gap; null where there is none), its tier (clear under 0.2, light-haze, moderate-smoke from 0.5, heavy-smoke from 1), the extra dimming of starlight overhead in magnitudes (1.086 × the optical depth; about twice that at 30° altitude), and NASA FIRMS VIIRS active fires of the last 24 hours within radiusKm: how many 0.05° cells burned, the nearest in km, their total fire radiative power in MW and the latest detection. Gas flares, industry and volcanoes that show up nearly every day are left out. The site's pages show a notice only when the air is hazy or a fire is within 80 km. Not air-quality or fire safety information: follow local alerts. - `lat` (number, required): Latitude in degrees, north positive (−90 to 90). - `lon` (number, required): Longitude in degrees, east positive (−180 to 180). Example: https://sunandmoon.com/api/v1/sky-transparency?lat=47.61&lon=-122.33 Caching: Ten minutes: the data refreshes every three hours. #### When the planets go retrograde `GET /api/v1/retrograde` Apparent retrograde motion (ADR 0062): the stretches when a planet slides west against the stars because Earth is overtaking it (Mars outward) or it is overtaking Earth (Mercury, Venus). Each period gives the station where it turns back and the one where it turns east again (time to the minute, apparent ecliptic longitude of date, IAU constellation), its length in days, how far it slides back in degrees, and the middle: opposition or inferior conjunction, with the distance then. now is true while a period is under way. Without year: each planet's current or next period. Times are UTC and the same from anywhere on Earth; computed from the JPL DE440 ephemeris. /learn/retrograde explains it. - `year` (integer): Every period that begins in this UTC year, 1901 to 2099. Default: each planet's current or next. - `planet` (string): mercury, venus, mars, jupiter, saturn, uranus or neptune. Default: all seven. Example: https://sunandmoon.com/api/v1/retrograde?year=2027&planet=mercury Caching: An hour. #### Bright comets on a night at a place `GET /api/v1/comets` Comets predicted at maxMag or brighter (default 10), and main-belt asteroids such as Vesta and Ceres within reach, at least 15° from the Sun at the middle of the night (ADR 0092). Each gives JPL's predicted magnitude (magnitudeSource "predicted (JPL)": comets can differ by one or two), astrometric J2000 coordinates and constellation for the middle of the night, distance from the Earth (au, km, mi) and Sun, evening or morning sky, the tail's position angle (degrees east of north, away from the Sun), perihelion, rise, set and transit in local time, the best moment with the Sun 12° down (altitude, azimuth, compass point) and a plain verdict. Positions are computed from JPL Small-Body Database orbits refreshed twice a day, two-body from the osculating epoch, with the Earth from DE440: within about 5″ of JPL Horizons over 30 days in tests. Empty when no comet is that bright. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): The evening the night starts, YYYY-MM-DD. Default: the night under way, or the coming one. - `maxMag` (number): Faintest predicted magnitude, −10 to 16 (default 10). Example: https://sunandmoon.com/api/v1/comets?lat=47.61&lon=-122.33&tz=America/Los_Angeles&maxMag=12 Caching: With date and coordinates: 10 minutes. Tonight: private. #### Asteroids passing the Earth `GET /api/v1/asteroids/close-approaches` Earth close approaches from NASA JPL CNEOS's Close-Approach Data, from yesterday through the coming days, nearest first in time: designation, time (UTC) and its uncertainty as CNEOS writes it, distance from the Earth's centre in lunar distances (384,400 km), km, miles and au with the uncertainty range, relative speed, absolute magnitude H and size (measured, or estimated from H for albedos 0.25 to 0.05, in m and ft), peakMagnitude (the brightest it could look, ignoring phase), the Sentry impact-monitoring entry when CNEOS lists one, and a calm one-line context. Refreshed twice a day. - `days` (integer): How many days ahead, 1 to 60 (default 60). - `maxLd` (number): Only approaches within this many lunar distances, up to 20 (default 20). Example: https://sunandmoon.com/api/v1/asteroids/close-approaches?days=30&maxLd=5 Caching: An hour. #### Fireballs seen by U.S. Government sensors `GET /api/v1/fireballs` Bright fireballs (bolides) from NASA JPL CNEOS's Fireball Data: peak brightness time (UTC), latitude and longitude, altitude, speed (km/s and mph), radiated optical energy (joules) and estimated impact energy (kilotons of TNT). Only the largest events, worldwide; a few dozen a year. Newest first, or nearest first with lat and lon (distanceKm, distanceMi). Some fields are null when not reported. - `days` (integer): How many days back, 1 to 365 (default 365). - `lat` (number): Latitude to sort by distance from, with lon. - `lon` (number): Longitude, with lat. Example: https://sunandmoon.com/api/v1/fireballs?days=90 Caching: An hour. ### Photography Golden and blue hours, the Moon for observers, the Sun and Moon behind a landmark, the days the Sun lines up with a city's streets, and space stations crossing the Sun and Moon. #### Golden and blue hours, day by day `GET /api/v1/golden-hour` The golden hour (the Sun's center from 6° above to 4° below the horizon) and blue hour (4° to 6° below) of each local day, morning and evening, with the Sun's azimuth at each end (where the light comes from), sunrise and sunset. Near the poles a window can last all day (part allDay) or all night (allNight); one cut by midnight says so. Airless altitudes, as for twilight. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): Local date, YYYY-MM-DD, in the proleptic Gregorian calendar as ISO 8601 defines it (before 15 October 1582 this is not the Julian date people then wrote). Default: today at the place. - `days` (integer): How many days from date, 1 (default) to 14. - `terrain` (string): 1 adds when the Sun's top clears the real skyline and goes behind it (needs lat and lon). Example: https://sunandmoon.com/api/v1/golden-hour?lat=47.61&lon=-122.33&tz=America/Los_Angeles&date=2026-06-21&days=3 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### The Moon for observers, and the Moon 100 `GET /api/v1/moon-observing` One night's Moon at a place: the moment it stands highest in the darkest sky it gets, its phase, libration, the Sun's colongitude and the subsolar latitude then, and how it stands on the sky (axisAngle: its north pole's position angle; parallacticAngle: the zenith's; both from celestial north toward east, so a picture turned by axisAngle minus parallacticAngle from lunar north up stands as in the sky); and for each of a hundred features (names, positions and sizes from the IAU gazetteer) the Sun's altitude over it, its light (hidden beyond the limb, dark, on the terminator, lit or under a high Sun), whether it is at its best, and the next evening it will be, within searchDays. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): The evening the night starts, YYYY-MM-DD. Default: the night under way, or the coming one. Example: https://sunandmoon.com/api/v1/moon-observing?lat=47.61&lon=-122.33&tz=America/Los_Angeles&date=2026-11-28 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### When the Sun or Moon passes behind a landmark `GET /api/v1/alignment` From the place (lat, lon) to a landmark (tlat, tlon) with its own height: the distance and bearing on the ellipsoid, the top's apparent elevation with the Earth's curvature and refraction, ground heights from a 30 m elevation model, and every moment in the span the Sun's or Moon's center passes within tolerance of the top, with how far right or left and above or below. When none does, the closest pass within 3°. - `lat` (number, required): Latitude in degrees, north positive (−90 to 90). - `lon` (number, required): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `tlat` (number, required): The landmark's latitude. - `tlon` (number, required): The landmark's longitude. - `height` (number): The landmark's height above its ground, in meters (0, a summit, by default). - `date` (string): The first local day to search, YYYY-MM-DD. Default: now. - `days` (integer): How many days to search, 1 to 366 (default 365). - `tolerance` (number): How close a pass counts, in degrees from the top: 0.05 to 3 (default 0.5). - `body` (string): sun, moon or both (default). Example: https://sunandmoon.com/api/v1/alignment?lat=47.6295&lon=-122.3599&tz=America/Los_Angeles&tlat=47.6205&tlon=-122.3493&height=184&days=90 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### Where to stand to see the Sun or Moon on a landmark `GET /api/v1/alignment/stand` Through one local day, every step minutes while the body is 0.3° to 20° up: the spot on the line from the landmark away from the body, as far out as makes the landmark's top stand at the body's altitude (curvature, refraction and the ground there from the elevation model), from 50 m to 60 km away. - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `tlat` (number, required): The landmark's latitude. - `tlon` (number, required): The landmark's longitude. - `height` (number): The landmark's height above its ground, in meters. - `date` (string): Local date, YYYY-MM-DD, in the proleptic Gregorian calendar as ISO 8601 defines it (before 15 October 1582 this is not the Julian date people then wrote). Default: today at the place. - `body` (string): sun or moon (default). - `step` (integer): Minutes between spots, 1 to 60 (default 5). Example: https://sunandmoon.com/api/v1/alignment/stand?tlat=47.6205&tlon=-122.3493&height=184&tz=America/Los_Angeles&date=2027-03-27&body=moon Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### The days the Sun lines up with a city's streets `GET /api/v1/city-henge` For 366 days from date: where the Sun stands when its whole disk sits on the horizon (full) and when it is half set (half), rising and setting, with refraction, over a horizon of the given height. And the street grid within radius of the place, read from OpenStreetMap: its directions (peaks of street length by direction), some of their streets, and the days the rising or setting Sun lines up with each, full and half disk (Manhattanhenge for any city). - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): Local date, YYYY-MM-DD, in the proleptic Gregorian calendar as ISO 8601 defines it (before 15 October 1582 this is not the Julian date people then wrote). Default: today at the place. - `horizon` (number): The horizon's height at the streets' ends, in degrees (−2 to 10, default 0). - `radius` (number): How far around the place to read streets, 200 to 3,000 m (default 1,500). Example: https://sunandmoon.com/api/v1/city-henge?lat=40.758&lon=-73.9855&tz=America/New_York&horizon=0.6 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### The straight streets around a point `GET /api/v1/city-henge/streets` Straight stretches of street (60 m and longer) within radius of a point, from the street map's OpenStreetMap tiles: each as [lat1, lon1, lat2, lon2, bearing, meters, name index], with the names listed once. 404 where the street map is unavailable. - `lat` (number, required): Latitude in degrees, north positive (−90 to 90). - `lon` (number, required): Longitude in degrees, east positive (−180 to 180). - `radius` (number): 200 to 3,000 m (default 1,500). Example: https://sunandmoon.com/api/v1/city-henge/streets?lat=40.758&lon=-73.9855&radius=800 Caching: A day: the data changes only with a deployment. #### Galaxies, nebulae and clusters up tonight `GET /api/v1/deep-sky` The deep-sky catalog for one night at a place, with the page's filters: objects above alt for at least min minutes in the chosen directions inside the window (astronomical darkness by default), most photogenic first. Each with its J2000 and apparent (of date) right ascension and declination, apparent altitude and azimuth at the night's moment (time, else now or the middle of darkness), rise, transit, set and its best moment, size, magnitude, surface brightness, the Moon's interference, clear minutes from the forecast the server already holds, a focal length that frames it and a difficulty from the place's sky brightness. The catalog fields are adapted from OpenNGC (Mattia Verga) and shared under CC BY-SA 4.0: keep credit and license when you reuse them. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): The evening the night starts, YYYY-MM-DD. Default: the night under way, or the coming one. - `time` (string): A local clock time in the night, HH:mm, for altitude and azimuth. Default: now during the night, else the middle of darkness. - `alt` (number): Minimum altitude in degrees, −5 to 89 (default 30). - `terrain` (string): 1: the object must also clear the real skyline around the point (30 m elevation data); needs lat and lon. night.terrain says whether it was used. - `min` (integer): Minimum minutes meeting the rule, 0 to 1440 (default 30). - `dir` (string): Directions, comma-separated (N, NE, E, SE, S, SW, W, NW), each 45° wide; the object must be in one of them. A 16-point name such as NNE takes in both neighbors. Default: all. - `window` (string): dark (astronomical darkness, default), night (sunset to sunrise) or custom with from and to (HH:mm). - `cat` (string): Catalogs, comma-separated: messier, caldwell, ngc, ic, sharpless, barnard, ldn, lbn, vdb, abell, collinder, melotte, arp, other. - `type` (string): Types, comma-separated: galaxies, nebulae, planetary-nebulae, supernova-remnants, star-clusters, star-patterns. - `mag` (number): Brighter than this magnitude. - `minsize` (number): Larger than this many arcminutes. - `maxsize` (number): Smaller than this many arcminutes. - `sb` (number): Surface brightness under this, mag/arcsec². - `con` (string): Constellation, IAU abbreviation (Ori, Cyg). - `moonsep` (number): At least this many degrees from the Moon when it is up. - `sensor` (string): With focal: ff, apsc, canon-apsc, m43, imx571, imx585 or imx533; keeps objects that fit the frame. - `focal` (number): Focal length in millimeters, with sensor. - `all` (string): 1 for every object, not only the photogenic set (about 2,000). - `hidden` (string): 1 to include objects that miss the rule tonight. - `sort` (string): score (default), time, altitude, hours, magnitude, size or name. - `q` (string): Find by designation (M31, NGC 7000) or name; ignores the other filters. - `offset` (integer): Skip this many (default 0). - `limit` (integer): How many, 1 to 500 (default 100). Example: https://sunandmoon.com/api/v1/deep-sky?lat=47.61&lon=-122.33&tz=America/Los_Angeles&date=2026-11-28&alt=40&dir=E,SE,S&limit=10 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### One deep-sky object tonight, and how to find it `GET /api/v1/deep-sky/{id}` One object of the deep-sky catalog on one night at a place: all the fields of /api/v1/deep-sky, and a star hop phrased from the horizon at the moment it is drawn for (when the object is up, else its best): hand-written routes for the Messier and Caldwell objects, routes generated from bright stars for the rest. CC BY-SA 4.0, adapted from OpenNGC. - `id` (string, in path, required): m31, c14, ngc7000, ic434, or a designation such as M 31. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): The evening the night starts, YYYY-MM-DD. - `time` (string): A local clock time in the night, HH:mm. - `alt` (number): Minimum altitude for visibleMinutes, −5 to 89 (default 30). - `terrain` (string): 1: visibleMinutes also need the object over the real skyline around the point; needs lat and lon. Example: https://sunandmoon.com/api/v1/deep-sky/m31?lat=47.61&lon=-122.33&tz=America/Los_Angeles&date=2026-11-28 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### Naked-eye stars with known planets and exoplanet transits tonight `GET /api/v1/exoplanets` Confirmed exoplanets around naked-eye stars (V <= 6.5) overhead tonight and amateur-observable exoplanet transits (V <= 12.5, depth >= 0.4%, ephemeris uncertainty <= 30 min) at a place, from the NASA Exoplanet Archive (Caltech/IPAC, public domain). Host stars include J2000 and of-date coordinates, distance in light-years, best time, altitude, azimuth and whether they clear the local Bortle naked-eye limit. Each planet's period and epoch come from one paper that another paper agrees with (ephemerisReference); planets whose papers disagree are left out. Transits include BJD-corrected local ingress, mid-transit and egress times, full vs partial status, depth in percent and millimagnitudes, timing uncertainty, altitudes, Moon separation and clear minutes from the held forecast. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): The evening the night starts, YYYY-MM-DD. Default: the night under way, or the coming one. - `alt` (number): Minimum altitude in degrees for host stars, 0 to 85 (default 15). - `transitAlt` (number): Minimum altitude in degrees for transits, 0 to 85 (default 20). - `maxMag` (number): Faintest transit host magnitude, 4 to 15 (default 12.5). - `minDepth` (number): Minimum transit depth in percent, 0.1 to 20 (default 0.4). Example: https://sunandmoon.com/api/v1/exoplanets?lat=47.61&lon=-122.33&tz=America/Los_Angeles&date=2026-11-30 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### When the ISS, Tiangong or Hubble crosses the Sun or Moon near a place `GET /api/v1/transits` Transits of the ISS, China's Tiangong and the Hubble telescope across the Sun and the Moon whose centre lines pass within radius of the place: when the satellite crosses the middle of the disk at the centre line's nearest point (time, to the millisecond), where that is (nearest, distanceKm and bearingDegrees from the place), how wide the strip is from which it crosses the disk at all (pathWidthKm, across the path) and how long it takes on the centre line, the Sun's or Moon's altitude, azimuth and radius there, the satellite's distance and size, and the same transit from the place itself (here: closest approach, inPath, durationSeconds). centerLine, leftEdge and rightEdge are [longitude, latitude] pairs for a map. Paths are computed for the ground height at the place (groundHeightMeters); shiftPer100MetersKm is how far the path moves toward the Sun or Moon for ground 100 m higher. confidence follows the time since the elements' epoch: firm within a day, likely within three, else early; recheck the day before, as reboosts move the station. Elements are CelesTrak's, refreshed every two hours; the Sun and Moon come from the JPL ephemeris. weather is the cloud forecast at the transit's time for the 0.25° cell around the nearest point (status ok with cloudPercent and summary, beyond when no run reaches it yet, none when there is none), from ECMWF's IFS, DWD's ICON or NOAA's GFS, credited in weatherAttribution. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `radius` (number): Kilometres from the place the centre line may pass, 1 to 250. Default 80. - `days` (integer): Days ahead, 1 to 14. Default 10. Example: https://sunandmoon.com/api/v1/transits?lat=47.61&lon=-122.33&tz=America/Los_Angeles&radius=100 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. ### Satellites Every active satellite from CelesTrak's catalog, sorted by orbit, purpose, owner country and constellation, with its current mean elements for SGP4. Refreshed every two hours. #### Active satellites, filtered and counted `GET /api/v1/satellites` Every active satellite in CelesTrak's catalog (about 17,000, two thirds of them Starlink), filtered by any mix of orbit (leo, meo, geo, heo), trait (sun-synchronous, polar, geostationary, molniya, tundra, retrograde), purpose (communications, navigation, weather, earth-observation, science, crewed, amateur-radio, military, technology, unknown), country (the owner's ISO 3166 code, international or unknown), owner (CelesTrak's SATCAT owner code), constellation (starlink, oneweb, amazon-leo, qianfan, guowang, gps, galileo, beidou and others) or q (part of the name, a COSPAR ID or a catalog number). Each list parameter takes values separated by commas; a satellite matches any of them. byOrbit, byPurpose, byCountry and byConstellation count the whole filtered set; satellites holds one page of it, by catalog number. Purposes come from CelesTrak's group lists, then from program names; satellites neither describes are unknown rather than guessed. Orbits are classed from the mean elements: geo is a period within half an hour of a sidereal day and eccentricity under 0.1 (inclined geosynchronous orbits included), heo an eccentricity of 0.25 or more. dockedTo is the catalog number of the station an object is docked to. - `orbit` (string): leo, meo, geo or heo, separated by commas. - `trait` (string): sun-synchronous, polar, geostationary, molniya, tundra or retrograde. - `purpose` (string): communications, navigation, weather, earth-observation, science, crewed, amateur-radio, military, technology or unknown. - `country` (string): ISO 3166 codes (US, CN), international or unknown. - `owner` (string): CelesTrak SATCAT owner codes (US, PRC, CIS, ESA, SES). - `constellation` (string): starlink, oneweb, amazon-leo, qianfan, guowang, iridium, gps, glonass, galileo, beidou and others. - `q` (string): Part of a name, a COSPAR ID (1998-067) or a catalog number. - `starlink` (boolean): false leaves Starlink out. Default: included. - `limit` (integer): Satellites in the page, 1 to 1000. Default 100. - `offset` (integer): Satellites to skip. Default 0. Example: https://sunandmoon.com/api/v1/satellites?purpose=navigation&orbit=meo&limit=5 Caching: 10 minutes. #### One satellite and its elements `GET /api/v1/satellites/{id}` One active satellite by catalog number: what the list gives, its current mean elements in the OMM's terms (and the two TLE lines while its number fits in five digits), and the objects docked to it (the ISS's and Tiangong's visiting vehicles). - `id` (integer, in path, required): NORAD catalog number, e.g. 25544 for the ISS. Example: https://sunandmoon.com/api/v1/satellites/25544 Caching: 10 minutes. #### When the ISS, Tiangong or Hubble passes over a place `GET /api/v1/satellites/{id}/passes` Passes of the ISS (25544), Tiangong (48274) or Hubble (20580) over the place for the next ten days: where each rises through 10°, peaks and sets (time, altitude, azimuth, distance and whether sunlit), and for a visible pass (sunlit, at least 10° up, with the Sun 6° or more below the place's horizon) the moments it is first and last seen and its brightest magnitude, estimated from a standard magnitude at 1000 km and half lit. Predicted with SGP4 from CelesTrak's elements (refreshed every two hours); checked against Skyfield to within 1.5 seconds. A reboost moves later passes by a minute or more: check the day before. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `days` (integer): Days ahead, 1 to 10. Default 10. - `visible` (boolean): false lists every pass above 10°, also those in daylight or in the Earth's shadow. Default: visible ones only. - `id` (integer, in path, required): 25544, 48274 or 20580. Example: https://sunandmoon.com/api/v1/satellites/25544/passes?lat=47.61&lon=-122.33&tz=America/Los_Angeles Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### Starlink's shells, life cycle and launches `GET /api/v1/satellites/starlink` The Starlink constellation as the Starlink page shows it. shells are found from the orbits, not listed by hand: satellites of one inclination (within 0.3°) crowded at one mean height, at least 100 within 6 km making up 60% or more of those within 30 km; a shell holds those within 0.3° and 12 km of its mean. Mean height is the semi-major axis less the ellipsoid's radius averaged under the orbit. stages sorts every Starlink in orbit: inShell; raising (launched in the last 200 days and not yet in a shell); comingDown (older, below every shell at its inclination); moving (older, between shells). launches lists every Starlink launch from CelesTrak's SATCAT with how many are still in orbit and how many have re-entered; months counts satellites launched and re-entered each month. compare gives the other broadband constellations' counts, median heights and main inclinations (each holding at least a twentieth). Without the SATCAT history, historyKnown is false, months is empty and launches come from the active set. Example: https://sunandmoon.com/api/v1/satellites/starlink Caching: 10 minutes. #### Starlink trains over a place `GET /api/v1/satellites/starlink/trains` The newest Starlink launches (up to four from the last 30 days) and, for the next three days, their trains over the place: visible passes (sunlit, at least 10° up, with the Sun 6° or more below the horizon, and estimated at magnitude 6.5 or brighter) of satellites from one launch, each appearing within 2 minutes of the one before, with at least a quarter of the launch (3 to 5 satellites) seen. spreadSeconds is the time from the first appearing to the last appearing: a minute or two for a fresh launch still in a tight line, longer as the line stretches. Brightness is an estimate from a standard magnitude of 5.9 at 1000 km and half lit (Mallama 2020). lastLaunch is the newest launch with satellites in orbit, so an empty trains list can say when it was. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. Example: https://sunandmoon.com/api/v1/satellites/starlink/trains?lat=47.61&lon=-122.33&tz=America/Los_Angeles Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. ### Eclipses Solar eclipses for ten years and lunar for two, with Besselian elements, and how each looks from any place. #### Upcoming eclipses, or a year's `GET /api/v1/eclipses` Solar eclipses of the next ten years and lunar of the next two (or every eclipse of a year): type, greatest eclipse and where, gamma, magnitude, contacts, central duration and path width, saros, the countries that see it, and for solar eclipses the polynomial Besselian elements. Times are UTC. - `year` (integer): A year from 1850 to 2149. Default: the upcoming list. Example: https://sunandmoon.com/api/v1/eclipses Caching: Upcoming: 10 minutes. A year: a day. #### Upcoming eclipses seen from a place `GET /api/v1/eclipses/local` Every upcoming eclipse with local, null when none of it is seen from the place; otherwise what is seen there (a total solar eclipse can be partial here), when it begins and ends (or the rise or set that interrupts it), the deepest moment and where to look, magnitude and obscuration, and each contact. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. Example: https://sunandmoon.com/api/v1/eclipses/local?lat=47.61&lon=-122.33&tz=America/Los_Angeles Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### One eclipse, and how it looks from a place `GET /api/v1/eclipses/{slug}` An eclipse by the slug the lists give (solar or lunar is set), with local for the place or the caller's own location. - `slug` (string, in path, required): e.g. 2026-08-12-total-solar-eclipse. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. Example: https://sunandmoon.com/api/v1/eclipses/2026-08-12-total-solar-eclipse?lat=40.42&lon=-3.70&tz=Europe/Madrid Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. ### Calendars and crescent The first crescent after each new moon by Yallop's and Odeh's criteria; the Islamic, Hebrew, Chinese and Hindu calendars; their holidays; and prayer times by a stated method. #### The first crescent after a new moon, from a place `GET /api/v1/crescent` A new moon's first three evenings at the place: sunset, moonset and the lag, the Moon's age, and at the best time (sunset plus 4/9 of the lag) the crescent's geometry (ARCL, ARCV geocentric and topocentric, DAZ, width) with Yallop's q and class (A to F) and Odeh's V and zone (A to D). status says when the criteria do not apply (beforeNewMoon, moonSetsFirst, noSunset). islamic gives the month the new moon begins by the unified calendar (with when and where its criteria were first met), Umm al-Qura and sighting at the place. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): The new moon's UTC date (YYYY-MM-DD), 1900 to 2100. Default: the new moon of the last three days, else the next. Example: https://sunandmoon.com/api/v1/crescent?lat=47.61&lon=-122.33&tz=America/Los_Angeles&date=2027-02-06 Caching: With date and coordinates: 10 minutes. #### A day in four calendars `GET /api/v1/calendars` The day's Islamic date by the unified calendar (Türkiye's Diyanet), Umm al-Qura (1423 to 1500 AH) and sighting at the place; the Hebrew date (by its fixed rules); the Chinese date (Beijing time, GB/T 33661-2017) with the year's animal, element and stem-branch; and the Hindu day read at the place's sunrise: tithi, fortnight, month both ways, nakshatra and era years. Days of the Islamic and Hebrew calendars begin at the previous sunset. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): Local date, YYYY-MM-DD, in the proleptic Gregorian calendar as ISO 8601 defines it (before 15 October 1582 this is not the Julian date people then wrote). Default: today at the place. Example: https://sunandmoon.com/api/v1/calendars?lat=47.61&lon=-122.33&tz=America/Los_Angeles&date=2027-02-08 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### An Islamic year's months by a method `GET /api/v1/hijri` Each month's first day and length by one method: unified (the 2016 Istanbul congress's single calendar as Diyanet applies it), umm-al-qura (Saudi Arabia's, 1423 to 1500 AH) or sighting (the day after the crescent should first be seen by eye at the place). - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `year` (integer): Islamic year, 1300 to 1570. Default: the current one. - `method` (string): unified (default), umm-al-qura or sighting. Example: https://sunandmoon.com/api/v1/hijri?year=1448&method=umm-al-qura Caching: A day. #### Ramadan, the Eids, Passover, Lunar New Year and Diwali in a year `GET /api/v1/holidays` Each holiday's dates in a Gregorian year. Ramadan, Eid al-Fitr and Eid al-Adha by method (unified, umm-al-qura, sighting at the place; Ramadan with its last day); Passover's 15 Nisan with its last day outside Israel; Lunar New Year; Diwali (Lakshmi Puja) at new-delhi and here, the place. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `year` (integer): 1900 to 2100. Default: this year at the place. Example: https://sunandmoon.com/api/v1/holidays?lat=47.61&lon=-122.33&tz=America/Los_Angeles&year=2027 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### A year's full moons, with supermoons, micromoons and blue moons `GET /api/v1/full-moons` Every full moon whose local date falls in the year: the instant, the almanac name (the Harvest Moon nearest the September equinox and the Hunter's Moon after it; a month's second is the Blue Moon), the Moon's distance and apparent size, the perigee and apogee nearest in time, and the flags: supermoon and micromoon (within 90% of the way to that perigee or apogee, Espenak's reading of Nolle), blue moon (second in a calendar month in the place's zone) and seasonal blue moon (third of four in a season). - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `year` (integer): 1901 to 2099. Default: this year at the place. Example: https://sunandmoon.com/api/v1/full-moons?lat=47.61&lon=-122.33&tz=America/Los_Angeles&year=2026 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### Prayer times by a stated method `GET /api/v1/prayer-times` Fajr, sunrise, Dhuhr, Asr, Maghrib and Isha for one day or up to a month, by a calculation method whose angles and adjustments are returned with the times. Without method, the one usual in the place's country (else the Muslim World League's). fajrByHighLatitudeRule and ishaByHighLatitudeRule mark times set by the high-latitude rule. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): Local date, YYYY-MM-DD, in the proleptic Gregorian calendar as ISO 8601 defines it (before 15 October 1582 this is not the Julian date people then wrote). Default: today at the place. - `days` (integer): 1 (default) to 31. - `method` (string): mwl, isna, egypt, makkah, karachi, diyanet, tehran, jafari, kuwait, qatar, dubai, singapore or france. - `asr` (string): standard (one shadow length) or hanafi (two). Default: hanafi in Pakistan, India, Bangladesh and Afghanistan. - `high` (string): middle, seventh or angle: how Fajr and Isha are bounded at high latitudes. Default: middle below 48°, seventh above. Example: https://sunandmoon.com/api/v1/prayer-times?lat=41.0082&lon=28.9784&tz=Europe/Istanbul&method=diyanet&days=7 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### A year's events in the sky `GET /api/v1/events` Every event of a year at the place, in time order with local times: the solstices and equinoxes, perihelion and aphelion, new and full moons (named for the place's zone, with supermoons, micromoons and blue moons), solar and lunar eclipses, the annual meteor showers' peaks (IMO 2026 calendar: rate, radiant, parent), the outer planets' oppositions, Mercury's and Venus' greatest elongations, conjunctions of planets within 3° of each other or of the Moon (from the Earth's center, both at least 15° from the Sun), and the year's holidays (Ramadan, the Eids, Passover, Lunar New Year, Diwali) with their local dates. path is the site's page for each. /united-states/washington/seattle/calendar.ics (or /calendar.ics with lat, lon and tz) is the same as a calendar to subscribe to; include= picks events, moon, holidays, sun and prayer. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `year` (integer): 1901 to 2099. Default: this year at the place. Example: https://sunandmoon.com/api/v1/events?lat=47.61&lon=-122.33&tz=America/Los_Angeles&year=2026 Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### The Qibla: the direction of the Kaaba `GET /api/v1/qibla` From the place: the starting bearing of the geodesic to the Kaaba (21.422487° N, 39.826206° E) from true north on the WGS 84 ellipsoid (Vincenty), the great circle on a sphere as most tables give it, the compass bearing with the World Magnetic Model 2025's declination (null outside its years), and the distance; the local day's times the Sun stands in the Qibla's direction (sunToward) and directly opposite it, when shadows point the way (shadowsToward), with the Sun up; and the next time the Sun passes over the Kaaba (late May and mid-July), with whether it is up at the place then. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): Local date, YYYY-MM-DD, in the proleptic Gregorian calendar as ISO 8601 defines it (before 15 October 1582 this is not the Julian date people then wrote). Default: today at the place. Example: https://sunandmoon.com/api/v1/qibla?lat=40.7128&lon=-74.006&tz=America/New_York Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. ### Tides Tide predictions for about 5,000 stations worldwide (NOAA's harmonic and subordinate stations, and tide gauges from TICON-3) and the EOT20 ocean model along other coasts: high and low waters, heights, the next year's king tides and lowest tides, and windows when the water is past a level. Astronomical tide only; not for navigation. #### Tides for a place `GET /api/v1/tides` The station the place's tides come from (the nearest within 120 km, the one asked for, or, with no station within 40 km of a coastal point, the EOT20 model at the nearest open water, heights above mean sea level), the height now and whether the water is rising, the next high and low, each day's high and low waters (local times), and the stations nearby. Heights are above the station's datum: MLLW at NOAA's stations, LAT elsewhere. Inland, station is null and note names the nearest station. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `date` (string): Local date, YYYY-MM-DD, in the proleptic Gregorian calendar as ISO 8601 defines it (before 15 October 1582 this is not the Julian date people then wrote). Default: today at the place. - `days` (integer): Days from date, 1 to 31. Default 7. - `station` (string): A station id to use instead of the nearest. - `units` (string): metric (metres, default) or imperial (feet), for heights. Example: https://sunandmoon.com/api/v1/tides?lat=47.61&lon=-122.33&tz=America/Los_Angeles Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### Tide stations near a point, or all `GET /api/v1/tides/stations` Stations nearest first, with their source (noaa, gauge), kind (harmonic: predicted from its own constants; subordinate: NOAA's offsets from a reference station), time zone and tide table page. - `lat` (number): Latitude, with lon. Required unless all=1. - `lon` (number): Longitude. - `radius` (number): Kilometres, up to 1000. Default 100. - `limit` (integer): 1 to 50. Default 10. - `all` (string): 1 lists every station (about 5,000). Example: https://sunandmoon.com/api/v1/tides/stations?lat=47.61&lon=-122.33&limit=5 Caching: A day. #### One tide station `GET /api/v1/tides/stations/{id}` Its datum and levels (HAT, MHHW, MHW, MTL, MSL, MLW, MLLW, LAT; official marks NOAA's published datums, the others are computed from the constants over 2020 to 2038), NOAA's flood thresholds, the kind of tide and its form number, average spring and neap ranges, and the harmonic constants (or the reference station and offsets). - `id` (string, in path, required): e.g. 9447130 (NOAA) or g123 (a gauge). - `units` (string): metric (metres, default) or imperial (feet), for heights. Example: https://sunandmoon.com/api/v1/tides/stations/9447130 Caching: A day. #### High and low waters, or heights `GET /api/v1/tides/predictions` Predictions for a station from local midnight of date: every high and low water (interval=hilo), or the height every few minutes. Times are local at the station with their UTC offset. Subordinate stations' heights between high and low waters follow a half cosine. - `station` (string, required): Station id. - `date` (string): Local date, YYYY-MM-DD, in the proleptic Gregorian calendar as ISO 8601 defines it (before 15 October 1582 this is not the Julian date people then wrote). Default: today at the place. - `days` (integer): 1 to 366 for hilo, 1 to 31 for heights. Default 1. - `interval` (string): hilo (default), or minutes: 1, 5, 6, 10, 15, 30 or 60. - `units` (string): metric (metres, default) or imperial (feet), for heights. - `format` (string): json (default) or csv (a file, with the station, datum and credit in # lines first). Example: https://sunandmoon.com/api/v1/tides/predictions?station=9447130&days=2 Caching: A day with date; an hour without. #### Notable tides of the next year `GET /api/v1/tides/events` From today at the station for 365 days: king tides (the highest 2% of high waters, grouped in runs, each with the new or full moon nearby, the Moon's distance and whether perigee is within two days), the lowest 2% of low waters (with daylight), high waters reaching NOAA's minor flood threshold, perigean spring tides (new or full moon within 36 hours of perigee) with the biggest tide around each, the year's highest and lowest tide, and each month's lowest daylight low. - `station` (string, required): Station id. - `units` (string): metric (metres, default) or imperial (feet), for heights. Example: https://sunandmoon.com/api/v1/tides/events?station=9447130 Caching: Six hours. #### The ocean tide anywhere, from the world model `GET /api/v1/tides/world` For any point at sea (a point on land takes the nearest sea within about 170 km): the EOT20 model averaged over the half-degree square there, with its eight main constituents (amplitude, Greenwich phase lag, speed), the kind of tide and its form number, the average spring and neap ranges, 2 (M2 ± S2), and tropic range, 2 (K1 + O1) (the one that matters where tides are diurnal), when the main lunar tide's high water comes in lunar hours after the Moon crosses Greenwich, the nearest M2 amphidromic point and which way high water turns round it (ccw or cw), and the tide above mean sea level from start (default: now) with its high and low waters in UTC. Open-ocean values: bays and estuaries differ, so use GetTides for a place on the coast. - `lat` (number, required): Latitude, decimal degrees. - `lon` (number, required): Longitude, decimal degrees. - `start` (string): ISO 8601 date and time (UTC unless an offset is given). Default: now, rounded down to the interval. - `hours` (integer): 1 to 168. Default 48. - `interval` (integer): Minutes between heights: 10, 15, 30 (default) or 60. - `units` (string): metric (metres, default) or imperial (feet), for heights. Example: https://sunandmoon.com/api/v1/tides/world?lat=44.5&lon=-66&hours=24&interval=60 Caching: Ten minutes without start; a day with it. #### Amphidromic points `GET /api/v1/tides/world/amphidromes` The points in open water where the main twice-daily (M2) or once-daily (K1) tide vanishes and high water turns round, counterclockwise (ccw) or clockwise (cw) seen from above, found in the EOT20 model on a quarter-degree grid. - `wave` (string): M2, K1 or all (default). Example: https://sunandmoon.com/api/v1/tides/world/amphidromes?wave=M2 Caching: A day. #### Notable tides as a calendar `GET /api/v1/tides/events.ics` The same king tides, lowest tides and flood-level tides as an iCalendar file to subscribe to (text/calendar). - `station` (string, required): Station id. - `units` (string): metric (metres, default) or imperial (feet), for heights. Example: https://sunandmoon.com/api/v1/tides/events.ics?station=9447130 Caching: Six hours. #### When the water is past a level `GET /api/v1/tides/windows` Windows when the water is below (or above) a level for at least minutes, from today for days, optionally only in daylight: for tidepooling, beach walks, launching a boat or passing under a bridge. Each window gives its start and end, the lowest (or highest) water in it and the low (or high) water it holds. - `station` (string, required): Station id. - `level` (number, required): The level above the station's datum, in units. - `below` (string): 1 (default): below the level; 0: above it. - `light` (string): any (default), day (sunrise to sunset) or civil (civil dawn to dusk). - `days` (integer): 1 to 366. Default 30. - `minutes` (integer): Shortest window. Default 30. - `earliest` (string): Local time HH:mm a window may start. Default none. - `latest` (string): Local time HH:mm a window must end by. Default none. - `weekdays` (string): The days allowed as digits, 0 Sunday to 6 Saturday (06 for weekends). Default all. - `units` (string): metric (metres, default) or imperial (feet), for heights. - `format` (string): json (default) or ics (a calendar file with one event per window). Example: https://sunandmoon.com/api/v1/tides/windows?station=9447130&level=0&light=day Caching: An hour. ### Fishing Should I fish, and when? The fishing page's answer for a place: windows scored by dawn and dusk, the tide and the weather, each day's answer for the next week, and solunar periods (shown as tradition, not scored). #### Should I fish, and when? `GET /api/v1/fishing` The /fishing page's answer (ADR 0048). Every five minutes is scored from the light (dawn and dusk highest), the tide (salt water: moving water beats slack) and the hour's comfort; runs of good minutes the weather doesn't rule out become windows. verdict is yes or maybe (the best window left today, or in the next 24 hours, with or without a weather concern), no (the weather rules out every window today; against says what and when), timing (no forecast covers it: light and tide only) or none. Weather comes from ECMWF's IFS model, or DWD's ICON or NOAA's GFS where it has none (weatherAttribution); without a forecast (weatherStatus unavailable) windows are light and tide only. Times are local with their UTC offset; wind in m/s, temperatures in °C, rain in mm/h. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `water` (string): salt or fresh. Default: salt within 15 km of a tide station (or the EOT20 model's open water), else fresh. - `from` (string): shore (default) or boat: a small boat has lower wind limits. - `station` (string): A tide station id to use instead of the nearest. - `format` (string): json (default) or ics: the windows of the next days as a calendar file. Example: https://sunandmoon.com/api/v1/fishing?lat=47.61&lon=-122.33&tz=America/Los_Angeles Caching: Explicit coordinates: shared caches may keep it 5 minutes. The caller's own location: private. ### Hunting When can I hunt, and should I go? Legal shooting light under a common rule for each day ahead, and the first and last hour of it with the weather. General suggestions: shooting hours are set by local regulations. #### When can I hunt, and should I go? `GET /api/v1/hunting` The /hunting page's answer (ADR 0066). Legal light runs from sunrise minus the rule's offset to sunset plus its offset, for the exact point; the prime windows are its first and last hour, when deer and most game move. now says whether it is legal light (before, legal, after, or none when the Sun doesn't rise), with nextChange. verdict is yes or maybe (the next prime window, with or without a weather concern), no (the weather rules it out; also is the next one it doesn't), timing (no forecast: light only) or none. Weather comes from ECMWF's IFS model, or DWD's ICON or NOAA's GFS where it has none (weatherAttribution); without a forecast (weatherStatus unavailable) windows are light only. These are general suggestions, not the law where you hunt: regulations set shooting hours by species, season and zone. Times are local with their UTC offset; wind in m/s, temperatures in °C. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `rule` (string): 30-30 (half an hour before sunrise to half an hour after sunset; the default), 30-sunset, sun (sunrise to sunset) or 60-60 (an hour each side; the default in Great Britain). - `from` (string): ground (default) or stand: a tree stand has lower wind limits. - `days` (integer): Days of legal light, 1 to 60. Default 14. Example: https://sunandmoon.com/api/v1/hunting?lat=47.61&lon=-122.33&tz=America/Los_Angeles Caching: Explicit coordinates: shared caches may keep it 5 minutes. The caller's own location: private. ### Camping Should I camp tonight? Each night's light and dark (pitch-by, last light, the moonless dark sky, first light) and the weather from pitch-by to sunrise with a tent's limits. General suggestions. #### Should I camp tonight? `GET /api/v1/camping` The /camping page's answer (ADR 0069). A night runs from the evening's sunset to the next sunrise: pitchBy is an hour before sunset, lastLight civil dusk, fullDark astronomical dusk (darkEnds its end), firstLight civil dawn. darkSky lists the stretches of full dark with the Moon below the horizon (darkSkyHours in total; darkSkyNight when there are at least four). Each night the forecast covers has weather: its call (go, maybe, no) from pitch-by to sunrise, judged with a tent's wind limits (maybe at 20 mph or gusts 30, no at 30 or gusts 39), freezing air (maybe), thunder, heavy rain or snow (no); the low, wind, rain, clouds in the dark hours as stars, and dew. coveragePercent and completeCoverage describe availability for the remaining night. forecastThrough is set for partial coverage without gaps. A partial forecast cannot return go. verdict is yes, maybe or no for tonight, or timing without a forecast; also is the next night worth it. Weather comes from ECMWF's IFS model, or DWD's ICON or NOAA's GFS where it has none (weatherAttribution). General suggestions, not safety advice: a go only means the forecast is within the stated limits. Times are local with their UTC offset; wind in m/s, temperatures in °C, rain in mm/h. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `nights` (integer): Nights to list, tonight first, 1 to 60. Default 14. Example: https://sunandmoon.com/api/v1/camping?lat=47.61&lon=-122.33&tz=America/Los_Angeles Caching: Explicit coordinates: shared caches may keep it 5 minutes. The caller's own location: private. #### Multi-day outdoor trip sheet `GET /api/v1/outdoors/report` The /outdoors/print trip sheet as JSON (ADR 0088): combines Sun and twilight, Moon phase and rise/set, magnetic declination (NOAA/BGS WMM), daily weather summary, camping nights and moonless dark sky, fishing light and solunar periods (tradition, not scored), hunting legal light under a common rule, kayaking daylight and coastal tide highs and lows, for 1 to 30 days from any start date (default: today + 2 days = 3 days). Weather comes from ECMWF's IFS model, or DWD's ICON or NOAA's GFS where it has none (weatherAttribution). General suggestions, not safety, legal or navigation advice. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `start` (string): First local date, YYYY-MM-DD (1550 to 2650). Default: today at the place. - `days` (integer): Days to cover, 1 to 30. Default 3 (today + 2 days). - `rule` (string): Hunting legal-light rule: 30-30, 30-sunset, sun or 60-60. - `water` (string): ocean, delta or lake (default: ocean near a tide station, else lake). Example: https://sunandmoon.com/api/v1/outdoors/report?lat=47.61&lon=-122.33&tz=America/Los_Angeles&days=3 Caching: Explicit coordinates: shared caches may keep it 5 minutes. The caller's own location: private. ### Kayaking Should I paddle, and when? Daylight split by the weather with a kayak's wind limits, on the ocean, a river delta or a lake, and predicted high and low water at a nearby tide station (none on a lake). General suggestions, not navigation advice. #### Should I paddle, and when? `GET /api/v1/kayaking` The /kayaking page's answer (ADR 0069). Daylight (sunrise to sunset) today and the next two days is split by the forecast into windows of one call each (go, maybe, no; timing without a forecast), judged with a kayak's wind limits (maybe at 12 mph or gusts 18, no at 20 mph or gusts 25), fog, thunder, rain, snow, heat and cold. water is ocean, delta or lake; without one it is ocean when a tide station lies within 25 km (or station is given), else lake. On the ocean or a delta with a tide station within 25 km (or station), each window lists predicted high and low water in waterLevels; on a lake station is null and tides and waterLevels are empty. Current predictions and route advice are unavailable. The legacy slack array is empty and trend, plan, turnAt and planText are null. verdict is yes or maybe (the first good, or else watchable, window of the first day with light), no (the weather rules out the day; also is the next window worth it), timing or none. Weather comes from ECMWF's IFS model, or DWD's ICON or NOAA's GFS where it has none (weatherAttribution). General suggestions, not navigation or safety advice: a go only means the forecast is within the stated limits. Times are local with their UTC offset; heights in metres above the station's datum; wind in m/s, temperatures in °C. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `water` (string): ocean (default) or delta: identifies the type of waterway. - `station` (string): A tide station id to use instead of the nearest. Example: https://sunandmoon.com/api/v1/kayaking?lat=47.61&lon=-122.33&tz=America/Los_Angeles Caching: Explicit coordinates: shared caches may keep it 5 minutes. The caller's own location: private. ### Nature calendar Spectacles the Moon, the Sun and the tides time: grunion runs, coral spawning, red crabs, the palolo rising, fireworms, glowing bays and the grouper moon, each night predicted from its source's rule; and dark evenings for any place. #### Every spectacle and what is coming up `GET /api/v1/nature` The /nature page's list (ADR 0059): each spectacle with where it is, its season, its page and its next window (on now or coming), then the windows coming up across all of them, soonest first. A window is a run of nights tied to one moon: its label, the phase it hangs on, a rating (best, likely, possible, unlikely) and each night's date, when to watch, rating and note, with the high tide or moonrise the time hangs on. Times carry the spectacle's own UTC offset. format=ics gives every spectacle's nights from a month back to a year ahead as a calendar. - `count` (integer): Windows coming up, 1 to 50. Default 12. - `format` (string): json (default) or ics. Example: https://sunandmoon.com/api/v1/nature Caching: An hour. #### Dark evenings at a place `GET /api/v1/nature/dark-evenings` From today at the place: each evening's nautical dusk, whether it is dark (the Moon down, or under 15% lit, for the three hours after), and the moonrise or moonset in those hours. Evenings that never reach nautical dusk have dusk null and are not dark. For moth trapping, bioluminescence and deep-sky watching. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. - `days` (integer): 1 to 60. Default 30. Example: https://sunandmoon.com/api/v1/nature/dark-evenings?lat=47.61&lon=-122.33&tz=America/Los_Angeles Caching: Explicit coordinates: shared caches may keep it 10 minutes. The caller's own location: private. #### A spectacle's nights in a year `GET /api/v1/nature/{slug}` One spectacle's windows whose first night falls in the year (its local dates), with its next window, the tide station its times came from, and tideMissing when the rule needs a tide that could not be reached (times then follow sunset). Slugs: grunion-runs, grouper-moon, gladden-spit-whale-sharks, horseshoe-crabs, christmas-island-red-crabs, great-barrier-reef-coral-spawning, ningaloo-coral-spawning, florida-keys-coral-spawning, flower-garden-banks-coral-spawning, okinawa-coral-spawning, kaneohe-bay-rice-coral, palolo-rising, ostional-arribada, waikiki-box-jellyfish, bermuda-fireworms, bioluminescent-bays, toyama-firefly-squid, matsu-blue-tears, victoria-falls-lunar-rainbow, cumberland-falls-moonbow, yosemite-moonbow, kasanka-bat-migration, congress-avenue-bats, phillip-island-penguin-parade, sort-sol-black-sun, severn-bore, mont-saint-michel-great-tides, qiantang-tidal-bore, horsetail-fall-firefall, diamond-fuji-yamanakako, longyearbyen-sun-return, nordkapp-midnight-sun, bau-nyale-lombok, platte-river-sandhill-cranes, burrishoole-silver-eels, lake-kariba-kapenta-lights, gulf-grunion-puerto-penasco. format=ics gives its nights from a month back to two years ahead (or the year asked for) as a calendar. - `slug` (string, in path, required): The spectacle, e.g. grunion-runs. - `year` (integer): 2000 to 2100. Default: this year at the spectacle. - `format` (string): json (default) or ics. Example: https://sunandmoon.com/api/v1/nature/grunion-runs?year=2026 Caching: An hour. ### Space weather and aurora NOAA and NASA data the site keeps current, and the aurora verdict for a place. #### Will the aurora be visible from a place? `GET /api/v1/aurora/forecast` The /aurora page's verdict for tonight and the next two nights: the place's magnetic latitude (AACGM-v2), the Kp each viewing level needs, a headline and summary, and per night darkness, the best viewing level (0 not from here, 1 camera only, 2 low on the horizon, 3 overhead) and when, the forecast Kp, the Moon, and the clouds over the best hours (from ECMWF's open model, else DWD's ICON or NOAA's GFS, credited in weatherAttribution), which the headline and summary weigh too. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. Example: https://sunandmoon.com/api/v1/aurora/forecast?lat=64.84&lon=-147.72&tz=America/Anchorage Caching: Live data: up to a minute. #### NOAA's aurora data `GET /api/v1/aurora` The OVATION oval (a 181 × 360 grid of percent, zlib-compressed and base64-encoded), Kp observed and forecast in 3-hour blocks, NOAA's storm odds, the 27-day outlook, the forecast discussion, the solar wind at L1, hemispheric power, alerts and the solar cycle, with each feed's status. 503 until the first fetch. Example: https://sunandmoon.com/api/v1/aurora Caching: Live data: up to a minute. #### Is a geomagnetic storm under way? `GET /api/v1/aurora/now` NOAA's estimated Kp now and its G level, the highest Kp and G level NOAA forecasts in the next 24 hours, and whether either is a storm (G1 or more), with a one-line summary. A few hundred bytes, the same for everyone; the site's header used it for its storm dot until ADR 0070 (now /api/v1/alerts/now). 503 until the first fetch. Example: https://sunandmoon.com/api/v1/aurora/now Caching: Five minutes. #### A solar storm alert, and the aurora from a place tonight `GET /api/v1/alerts/now` What the site's header dots show. sun: a solar storm alert or null, from NOAA's G level now or forecast within 24 hours, its S level now and its R level now from R2 (R1 comes most days near solar maximum); level is the highest (1 minor to 5 extreme), with each part and a one-line label. aurora: null unless the aurora should be visible from the place tonight (viewing level 1 camera only, 2 low on the horizon or 3 overhead, by the /aurora page's rules, without clouds), with a one-line label. Without coordinates the place is the caller's own. - `lat` (number): Latitude in degrees, north positive (−90 to 90). With lon; send both: without them the API uses the place saved on the caller's browser, else the site's default. API clients are never placed by their IP address (MaxMind's GeoLite license). - `lon` (number): Longitude in degrees, east positive (−180 to 180). - `tz` (string): IANA time zone for local dates and times, e.g. America/Los_Angeles. Default: the zone of the nearest listed place, else the nautical zone (marked approximate). - `name` (string): A name for the place, echoed back in location.name. Example: https://sunandmoon.com/api/v1/alerts/now?lat=64.84&lon=-147.72&tz=America/Anchorage Caching: Five minutes. #### Kp every three hours since 2008 `GET /api/v1/aurora/kp-history` GFZ Potsdam's definitive and nowcast Kp (CC BY 4.0) as thirds (Kp 4+ is 13, 255 missing), zlib-compressed and base64-encoded. Example: https://sunandmoon.com/api/v1/aurora/kp-history Caching: An hour. #### The aurora pages' references `GET /api/v1/aurora/sources` Every source the aurora pages cite, in list order. Example: https://sunandmoon.com/api/v1/aurora/sources Caching: A day: the data changes only with a deployment. #### The Sun's radiation now `GET /api/v1/solar-radiation` NOAA's GOES X-ray class and flux and proton flux at 10 and 100 MeV, the R (radio blackout) and S (radiation storm) levels and NOAA's three-day outlook. Fields are null when NOAA's report is missing or more than two hours old. Example: https://sunandmoon.com/api/v1/solar-radiation Caching: Live data: up to a minute. #### Recent solar flares `GET /api/v1/solar-activity` NASA DONKI's flares of the last weeks, the strongest recent one and the latest particle event, with the last fetch's outcome. Example: https://sunandmoon.com/api/v1/solar-activity Caching: None: the server refreshes hourly. #### Sunspot numbers and today's regions `GET /api/v1/sunspots` NOAA SWPC's own sunspot counts: the daily SWPC sunspot number (10 × groups + spots) with the day's sunspot area, new regions and 10.7 cm flux for the last year, monthly observed and 13-month smoothed numbers since 2008, NOAA's forecast of the smoothed number with its range, and the numbered regions on the disk in NOAA's latest summary (location, Carrington longitude, area, spots, McIntosh and Mount Wilson classes, flare probabilities), with each feed's status. 503 until the first fetch. Example: https://sunandmoon.com/api/v1/sunspots Caching: Live data: up to a minute. #### Space weather for HF radio `GET /api/v1/hf-conditions` What the /ham-radio page works from: solar flux and an effective sunspot number, Kp observed and forecast, GOES X-rays and protons, the solar wind, NOAA's scales and the D-RAP absorption grid, with each feed's status. Band predictions are computed in the visitor's browser. Example: https://sunandmoon.com/api/v1/hf-conditions Caching: Live data: up to a minute. #### NASA DONKI services and their freshness `GET /api/v1/space-weather/status` The NASA DONKI services the /space-weather page uses, how long each stays fresh, the last fetch and any error, and the current 30-day slice number. Example: https://sunandmoon.com/api/v1/space-weather/status Caching: None. #### One DONKI service for 30 days `GET /api/v1/space-weather/{service}/{slice}` NASA DONKI's own JSON for a service (FLR, CME, CMEAnalysis, CMEAnalysisAll, WSAEnlilSimulations, IPS, SEP, GST, MPC, RBE, HSS, notifications) over one 30-day slice, numbered from 2010-01-01, in an envelope with the fetch time. - `service` (string, in path, required): A DONKI service, e.g. CME. - `slice` (integer, in path, required): Slice number: days since 2010-01-01 divided by 30. Example: https://sunandmoon.com/api/v1/space-weather/CME/205 Caching: Current slices: 2 minutes; older: up to a day. ### Weather Cloud cover and conditions for a place, hour by hour for five days. API clients get ECMWF's IFS model, or DWD's ICON or NOAA's GFS where it has none, credited in attribution; the site's own pages show OpenWeather's, whose license keeps it there. #### Cloud cover and conditions `GET /api/v1/weather` Hourly cloud cover (percent) and OpenWeather-style condition codes for the 0.25° cell around the point, from the newest run of ECMWF's IFS model the site holds (or DWD's ICON or NOAA's GFS where it has none): five days ahead, 3-hourly values interpolated to hours. Credit attribution wherever you show it. Recorded weather (from and to) is for the site's own pages, whose forecasts come from OpenWeather. - `lat` (number, required): Latitude in degrees, north positive (−90 to 90). - `lon` (number, required): Longitude in degrees, east positive (−180 to 180). - `from` (string): Start of a past range, ISO 8601. - `to` (string): End of the range, at most two days after from. - `hours` (integer): Hours ahead the page needs, 1 to 48. Only the site's own pages make the server fetch hours past the first 20; API calls get the hours it holds either way. Example: https://sunandmoon.com/api/v1/weather?lat=47.61&lon=-122.33 Caching: 10 minutes for API clients (a new run comes every six hours). ### Places 34,000 named places, any point's name and time zone, and where the caller is. #### Where the caller is `GET /api/v1/location` Where the site places the caller (the same logic as the home page: coordinates, then the saved Home or where they are, by mode), the IP address used, the country that address alone places them in (the site's own pages only: API clients are never placed by IP, under MaxMind's GeoLite license), the mode (home or go), the saved Home, and, in Home mode, a network location far from Home that the site would offer to switch to. Example: https://sunandmoon.com/api/v1/location Caching: Never. #### Places by name `GET /api/v1/places` Accent- and case-insensitive prefix search over 34,000 GeoNames places, largest first. "Portland, OR" or "Paris, Texas" narrows by state or country. - `q` (string, required): The name, or its start. - `limit` (integer): 1 to 20; default 8. Example: https://sunandmoon.com/api/v1/places?q=portland Caching: A day: the data changes only with a deployment. #### US National and State Parks nearby or by name `GET /api/v1/parks` All 63 US National Parks (National Park Service, public domain) and over 3,100 US State Parks (GeoNames, CC BY 4.0). Pass lat and lon to list all parks within radiusKm (default 321.9 km / 200 miles), sorted closest first, or pass q to search by park name or state. - `lat` (number): Latitude in degrees (−90 to 90), paired with lon for nearby parks. - `lon` (number): Longitude in degrees (−180 to 180), paired with lat for nearby parks. - `radiusKm` (number): Search radius in kilometres (1 to 1000). Default 321.9 km (200 miles). - `q` (string): Park name or state filter. - `kind` (string): all (default), national or state. - `limit` (integer): Maximum results (default 500 for nearby, 20 for search). Example: https://sunandmoon.com/api/v1/parks?lat=47.61&lon=-122.33 Caching: A day: the data changes only with a deployment. #### Search the site `GET /api/v1/search` Pages, places with their tools, and upcoming eclipses on sunandmoon.com that match some words, best first: what the site's search box shows while typing (ADR 0068). "golden hour lisbon" finds Lisbon's golden hour page, "king tides" the tide events page. Each result has its kind (page, place, place-tool or eclipse), title, path on the site, section and a line about it. - `q` (string, required): The words to look for. - `limit` (integer): 1 to 20; default 8. Example: https://sunandmoon.com/api/v1/search?q=golden+hour+lisbon Caching: 10 minutes. #### A name and time zone for any point `GET /api/v1/places/at` The listed place within 25 km takes the name, "Near X" within 100 km, else the coordinates; the time zone is the nearest place's within 500 km, else the nautical zone (approximate). - `lat` (number, required): Latitude in degrees, north positive (−90 to 90). - `lon` (number, required): Longitude in degrees, east positive (−180 to 180). Example: https://sunandmoon.com/api/v1/places/at?lat=35.7&lon=139.7 Caching: A day: the data changes only with a deployment. #### Countries with listed places `GET /api/v1/countries` Every country with places: ISO code, English name, how many places and its page. Example: https://sunandmoon.com/api/v1/countries Caching: A day: the data changes only with a deployment. #### A country's places `GET /api/v1/countries/{code}/places` Every listed place in a country, most populous first. - `code` (string, in path, required): ISO 3166-1 alpha-2, e.g. US. Example: https://sunandmoon.com/api/v1/countries/nz/places Caching: A day: the data changes only with a deployment. ### Aurora alerts Your account's aurora alerts, the same ones as on /aurora/alerts: list, create, change, pause, test and delete them. These act for the key's account, so they need a key; they count toward its limits like any call. #### Your aurora alerts `GET /api/v1/aurora/alerts` (needs a key) Every alert of the key's account, oldest first, each with its place, settings, what it last sent and, when NOAA's data is at hand, tonight's outlook from there; the account's limits; and whether email to the account's address is getting through (email.alertsHeld is true while it bounces or was reported as spam: no alert goes out until that is fixed on /account). Example: GET https://sunandmoon.com/api/v1/aurora/alerts Caching: Never. #### Create an aurora alert `POST /api/v1/aurora/alerts` (needs a key) Starts watching a place. latitude and longitude are required; timeZone and name default to the nearest listed place's (as /api/v1/places/at gives them). Every setting is optional and starts as on the page: level horizon, forecast tonight, now on, stronger on, any clouds, no quiet hours. level is camera, horizon or overhead; nights 1 (tonight) or 3; maxClouds 0 (ignore), 25, 50 or 75; quietFrom and quietTo HH:mm, local to the place, both or neither. 201 with the alert and its address in Location. One alert per place: 409 when the account already has an alert within 10 km (the problem's existing names it, and Location points to it), or as many alerts as it may keep. Example: POST https://sunandmoon.com/api/v1/aurora/alerts Caching: Never. #### One aurora alert `GET /api/v1/aurora/alerts/{id}` (needs a key) The alert as the list gives it. - `id` (string, in path, required): The alert's id. Example: GET https://sunandmoon.com/api/v1/aurora/alerts/k3d9x2p7qa Caching: Never. #### Change, pause or resume an alert `PATCH /api/v1/aurora/alerts/{id}` (needs a key) Changes only the fields sent; the place cannot change (delete the alert and create another). paused stops and restarts emails. Send an empty string for label, quietFrom and quietTo to clear them. - `id` (string, in path, required): The alert's id. Example: PATCH https://sunandmoon.com/api/v1/aurora/alerts/k3d9x2p7qa Caching: Never. #### Delete an alert `DELETE /api/v1/aurora/alerts/{id}` (needs a key) Stops it for good. 204, or 404 when there is no such alert. - `id` (string, in path, required): The alert's id. Example: DELETE https://sunandmoon.com/api/v1/aurora/alerts/k3d9x2p7qa Caching: Never. #### Send a test email for an alert `POST /api/v1/aurora/alerts/{id}/test` (needs a key) Emails the account what the alert would say now (or, when nothing is due, tonight's outlook marked as a test). It never marks the alert or counts toward the daily alert emails. 429 after three in an hour; 409 while email to the account's address is on hold; 503 before NOAA's data arrives. - `id` (string, in path, required): The alert's id. Example: POST https://sunandmoon.com/api/v1/aurora/alerts/k3d9x2p7qa/test Caching: Never. ### Daily sky brief Your account's daily sky brief, the same as on /tonight/email: the places it gets tonight's sky for by email at 4 PM local time, starting, renaming, pausing and stopping them, and today's brief sent now. These act for the key's account and email only its own address, so they need a key; they count toward its limits like any call. GET /api/v1/tonight/brief gives the brief itself as JSON, without a key. #### Your daily sky briefs `GET /api/v1/tonight/email` (needs a key) Every place the key's account gets the brief for, oldest first: its place, when it goes out (sendAt, HH:mm local, and the zone as people know it), the local date it last went (lastSent), whether it is paused, and when the next is due (nextSend; up to three hours in the past while it is going out, null while paused), the sign-up page for the place, and today's brief as JSON. Also the account's limit, and whether email to its address is getting through (email.briefsHeld is true while it bounces or was reported as spam: no brief goes out until that is fixed on /account). Example: GET https://sunandmoon.com/api/v1/tonight/email Caching: Never. #### Start the daily brief for a place `POST /api/v1/tonight/email` (needs a key) The key's account gets tonight's sky for the place by email every day at 4 PM there, from the next 4 PM (today if it is earlier there, else tomorrow; see nextSend). latitude and longitude are required; timeZone and name default to the nearest listed place's (as /api/v1/places/at gives them). The place is kept to 0.01°. 201 with the brief and its address in Location. One brief per place: 409 when the account already gets the brief within 10 km in the same time zone, or under the same name (the problem's existing names it, and Location points to it), or for as many places as it may. Example: POST https://sunandmoon.com/api/v1/tonight/email Caching: Never. #### One daily sky brief `GET /api/v1/tonight/email/{id}` (needs a key) The brief as the list gives it. - `id` (string, in path, required): The brief's id. Example: GET https://sunandmoon.com/api/v1/tonight/email/q7m2k9x4ta8w3e1z Caching: Never. #### Rename, pause or resume a daily brief `PATCH /api/v1/tonight/email/{id}` (needs a key) Changes only the fields sent: name is what the brief and its email call the place (1 to 80 characters); paused true stops the daily email until it is set back to false (nextSend is null meanwhile). The place itself cannot move: stop the brief and start one for the other place. - `id` (string, in path, required): The brief's id. Example: PATCH https://sunandmoon.com/api/v1/tonight/email/q7m2k9x4ta8w3e1z Caching: Never. #### Stop a daily brief `DELETE /api/v1/tonight/email/{id}` (needs a key) Stops it for good, as its email's Unsubscribe button does. 204, or 404 when there is no such brief. - `id` (string, in path, required): The brief's id. Example: DELETE https://sunandmoon.com/api/v1/tonight/email/q7m2k9x4ta8w3e1z Caching: Never. #### Send today's brief now `POST /api/v1/tonight/email/{id}/send` (needs a key) Emails today's brief for the brief's place to the account now, without waiting for 4 PM: the same email, with its Unsubscribe button. It does not count as the day's brief. 429 after 3 a day to one address (with the site's Send it now) or 6 an hour from one network; 409 while email to the account's address is on hold. - `id` (string, in path, required): The brief's id. Example: POST https://sunandmoon.com/api/v1/tonight/email/q7m2k9x4ta8w3e1z/send Caching: Never. #### Send today's brief for any place now `POST /api/v1/tonight/email/send` (needs a key) Send it now, as on /tonight/email: emails today's brief for a place to the account once, right away. When the account gets the brief for that place, the email is that brief (brief names it); otherwise it is a one-off that signs nothing up (brief is null). The place as for starting a brief. Only to the key's own account: the API never emails other addresses. Limits and errors as for sending a brief. Example: POST https://sunandmoon.com/api/v1/tonight/email/send Caching: Never. ### Facts and history The site's written content as data: fact sheets, famous moonlit nights, the Apollo missions and every mission to the Moon since, with sources. #### The fact sheets `GET /api/v1/facts` Each sheet's slug, edition (grown-ups or kids), title, summary, page and how many facts it holds. Example: https://sunandmoon.com/api/v1/facts Caching: A day: the data changes only with a deployment. #### A fact sheet `GET /api/v1/facts/{slug}` Forty facts about the Sun or the Moon in chapters, with numbered references (grown-ups) or sources (kids). - `slug` (string, in path, required): sun or moon. - `edition` (string): grown-ups (default) or kids. - `units` (string): metric (default) or imperial, for distances and temperatures in the text. Example: https://sunandmoon.com/api/v1/facts/moon Caching: A day: the data changes only with a deployment. #### Famous nights and the Moon above them `GET /api/v1/moonlit-history` Thirty-nine nights from 413 BC to 2024: what happened, what the Moon was doing, and the Moon computed for the place and hour (phase, position, rise and set, any eclipse), with references. - `units` (string): metric (default) or imperial, for distances and temperatures in the text. Example: https://sunandmoon.com/api/v1/moonlit-history Caching: A day: the data changes only with a deployment. #### The Apollo lunar missions `GET /api/v1/apollo` Apollo 11 to 17: landing site (selenographic coordinates; Apollo 13's planned site), crew, key times in UTC, durations, moonwalks and samples. Example: https://sunandmoon.com/api/v1/apollo Caching: A day: the data changes only with a deployment. #### One Apollo mission in full `GET /api/v1/apollo/{number}` The mission with its 100-odd sourced facts by category, NASA photographs on this site and the sources. - `number` (integer, in path, required): 11 to 17. - `units` (string): metric (default) or imperial, for distances and temperatures in the text. Example: https://sunandmoon.com/api/v1/apollo/11 Caching: A day: the data changes only with a deployment. #### Crewed flights to the Moon `GET /api/v1/moon-missions/crewed` Artemis II's crew and flight, the distance records, the crewed missions to come and plans that never flew, and everyone who has gone to the Moon and who walked on it, with references. - `units` (string): metric (default) or imperial, for distances and temperatures in the text. Example: https://sunandmoon.com/api/v1/moon-missions/crewed Caching: A day: the data changes only with a deployment. #### Robotic missions to the Moon `GET /api/v1/moon-missions/uncrewed` Every robotic mission to the Moon by era: who flew it, what kind it was, how it went, its dates and summary, its marks on the site's Moon maps, and the missions coming next, with references. - `units` (string): metric (default) or imperial, for distances and temperatures in the text. Example: https://sunandmoon.com/api/v1/moon-missions/uncrewed Caching: A day: the data changes only with a deployment. #### The Apollo story for kids `GET /api/v1/apollo/kids` The storybook's pages: text, a fact card and NASA photos, with references. - `units` (string): metric (default) or imperial, for distances and temperatures in the text. Example: https://sunandmoon.com/api/v1/apollo/kids Caching: A day: the data changes only with a deployment. ### Accuracy How the site's numbers compared last night with the US Naval Observatory, NOAA's tide predictions, NASA JPL Horizons and California's grunion schedule: every row, and a line per night before (ADR 0061). The same data as /accuracy. #### Last night's comparison with MET Norway, NOAA and JPL `GET /api/v1/accuracy` The latest nightly run: its UTC date and spot date, then each reference (status ok, failed with its last good comparison and the date it was made, or off with the reason) and its groups. A group has its unit (s, min, mm or arcsec), its test in a sentence, how many rows were compared, agree, are exact, missing or extra, the median, 95th percentile and largest absolute difference, and every row: place, event, the place's time zone, the instant, ours and theirs as the page shows them, the difference (ours minus theirs; against MET Norway, which prints the minute a time falls in, ours minus the middle of that minute) and whether it agrees, with a note. history has one line per night (up to 400) with each group's counts and largest difference. latest is null until the first run. Example: https://sunandmoon.com/api/v1/accuracy Caching: Ten minutes. ## Optional - [Aurora forecast: Tromsø](https://sunandmoon.com/aurora/tromso) - [Aurora forecast: Alta](https://sunandmoon.com/aurora/alta) - [Aurora forecast: Svolvær](https://sunandmoon.com/aurora/lofoten) - [Aurora forecast: Abisko](https://sunandmoon.com/aurora/abisko) - [Aurora forecast: Kiruna](https://sunandmoon.com/aurora/kiruna) - [Aurora forecast: Rovaniemi](https://sunandmoon.com/aurora/rovaniemi) - [Aurora forecast: Saariselkä](https://sunandmoon.com/aurora/saariselka) - [Aurora forecast: Murmansk](https://sunandmoon.com/aurora/murmansk) - [Aurora forecast: Reykjavík](https://sunandmoon.com/aurora/reykjavik) - [Aurora forecast: Fairbanks](https://sunandmoon.com/aurora/fairbanks) - [Aurora forecast: Anchorage](https://sunandmoon.com/aurora/anchorage) - [Aurora forecast: Yellowknife](https://sunandmoon.com/aurora/yellowknife) - [Aurora forecast: Whitehorse](https://sunandmoon.com/aurora/whitehorse) - [Aurora forecast: Churchill](https://sunandmoon.com/aurora/churchill) - [Aurora forecast: Hobart](https://sunandmoon.com/aurora/hobart) - [Aurora forecast: Lake Tekapo](https://sunandmoon.com/aurora/tekapo) - [Aurora forecast: Invercargill](https://sunandmoon.com/aurora/invercargill) - [Data sources and credit](https://sunandmoon.com/developers#sources): NASA JPL DE440, IERS, ERFA, the World Magnetic Model, NOAA SWPC, NASA DONKI, GFZ Potsdam, NASA Black Marble, OpenWeather, GeoNames and Natural Earth. - [Terms of use](https://sunandmoon.com/terms): A personal project of FerBar Investments, LLC, provided as is with no guarantees: answers can be wrong or out of date. Not for navigation or safety-critical use. - [Privacy](https://sunandmoon.com/privacy)