{"uid":"cap_pgHRIQBIchX9uRtxEqe5W","slug":"opendata402-sun-position-daylight-api-b4d68596","name":"opendata402 Sun Position & Daylight API","description":"Sunrise, sunset, solar noon, day length and the sun's elevation at noon for any latitude, longitude and date, computed with the NOAA solar algorithm (accurate to about a minute; times in UTC; polar day and night handled). Use it for solar panel and lighting schedules, photography, outdoor work planning and daylight-dependent automations.","url":"https://opendata402.com/v1/sun?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"],"type":"string"},"queryParams":{"type":"object","required":["lat","lon"],"properties":{"lat":{"type":"string","pattern":"^-?\\d{1,2}(\\.\\d+)?$","description":"Latitude -90..90."},"lon":{"type":"string","pattern":"^-?\\d{1,3}(\\.\\d+)?$","description":"Longitude -180..180."},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"YYYY-MM-DD (default today, 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.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_H0HPaD9Ezcabz_wRXFkBT","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns sunrise, sunset, solar noon, day length, and solar elevation for any latitude/longitude and date using the NOAA solar algorithm","exampleAgentPrompt":"What time does the sun rise and set tomorrow in Amsterdam (52.3676° N, 4.9041° E), and how long will the day be?","exampleUseCases":[{"title":"Solar panel schedule optimization","prompt":"Calculate the sunrise, sunset, and solar noon for our farm in Phoenix, Arizona (33.4484° N, 112.0740° W) on July 15th so I can schedule the peak charging window for our solar panels."},{"title":"Golden hour photography planning","prompt":"I'm shooting landscape photos in the Scottish Highlands near Inverness (57.4778° N, 4.2247° W) on September 3rd — when exactly is sunrise and what's the total daylight I'll have?"},{"title":"Automated outdoor lighting trigger","prompt":"I need to set up my smart outdoor lights to turn on at sunset and off at sunrise for my home in Tokyo (35.6762° N, 139.6503° E) on December 21st — what are those times in UTC?"}],"resultDescription":"A JSON object containing sunrise time, sunset time, solar noon time, total day length, and solar elevation angle at noon, all in UTC. Polar day and polar night conditions are handled explicitly.","failureModes":["Invalid latitude (outside -90..90) or longitude (outside -180..180) returns a validation error","Malformed date string (not YYYY-MM-DD format) returns a parse error","Missing required lat or lon parameters returns a 400-level error","Locations at extreme polar latitudes during solstice periods return polar day/night indicators instead of standard times"],"whenToPreferThis":"Choose this endpoint when you need accurate, algorithmically computed solar times (sunrise, sunset, solar noon) for any global coordinate and date, especially for automation triggers, scheduling, or engineering calculations. It is based on the NOAA solar algorithm (accurate to ~1 minute) and handles edge cases like polar day/night. Prefer it over weather APIs that incidentally include sunrise/sunset but don't guarantee accuracy or polar handling, and over local device APIs when you need server-side computation for arbitrary coordinates.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-15T06:38:45.718Z","isFirstParty":false,"canonicalSlug":"opendata402-sun-position-daylight-api-b4d68596"}