{"uid":"cap_HCacuEjTKMjGOQ4AYa5-l","slug":"reference-data-api-sun-moon-calculator-57494067","name":"Reference Data API – Sun & Moon Calculator","description":"Computes sunrise, sunset, civil dawn and dusk, solar noon, day length, sun elevation, moon phase, illumination, moonrise and moonset for a location and date (polar day/night handled).","url":"https://reference-data-api.onrender.com/v1/sun-moon?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["lat","lon"],"properties":{"lat":{"type":"string","description":"Latitude"},"lon":{"type":"string","description":"Longitude"},"date":{"type":"string","description":"YYYY-MM-DD, default today"},"zone":{"type":"string","description":"IANA zone for the output times, default UTC"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.0285","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.0285/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0285","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0285","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_vPksaPzjELSmY55cOhcdf","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0285","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes sunrise, sunset, civil dawn/dusk, solar noon, day length, sun elevation, moon phase, illumination, moonrise, and moonset for a given location and date, with polar day/night support.","exampleAgentPrompt":"What time does the sun rise and set in Rome on June 21, and what's the moon phase that night? Use UTC+2 for the output times.","exampleUseCases":[{"title":"Golden hour planning for outdoor photography","prompt":"I'm shooting photos in San Francisco on April 10 — what are the exact sunrise, sunset, and civil twilight times, and how elevated is the sun at noon? Give me times in US/Pacific."},{"title":"Full moon camping trip check","prompt":"Is there a full moon this Saturday in Denver, Colorado? I need the moonrise and moonset times too — use America/Denver timezone."},{"title":"Polar day verification for Arctic expedition","prompt":"Will there be a polar day in Tromsø, Norway (latitude 69.65, longitude 18.95) on July 15? I need sunrise, sunset, and day length for that date."}],"resultDescription":"Returns a JSON object containing sunrise, sunset, civil dawn, civil dusk, solar noon, day length in minutes/hours, sun elevation angle, moon phase name, moon illumination percentage, moonrise time, and moonset time — all expressed in the requested IANA timezone (or UTC by default). Polar day and polar night edge cases are handled with appropriate flags or null times.","failureModes":["Missing lat or lon parameters returns a 400 validation error","Invalid date format (non-YYYY-MM-DD) returns a 400 error","Invalid or unrecognized IANA timezone string returns a 400 error","Coordinates out of range (lat outside -90 to 90, lon outside -180 to 180) return a 400 error","Server cold-start on Render free tier may cause initial latency spike or timeout"],"whenToPreferThis":"Choose this endpoint when you need precise, combined solar and lunar ephemeris data (sunrise, sunset, moon phase, moonrise, moonset) for any geographic coordinate and date in a single call. It is especially useful when polar day/night handling is required and when you need output times already converted to a specific IANA timezone. Prefer it over weather APIs that surface sunrise/sunset only incidentally, and over generic astronomy libraries when you need a hosted, pay-per-call solution with no setup.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T18:30:49.611Z","isFirstParty":false,"canonicalSlug":"reference-data-api-sun-moon-calculator-57494067"}