{"uid":"cap_FHAiTFpg0T-QwYYcFLReW","slug":"agent-time-place-sun-times-ce0f8f81","name":"Agent Time & Place – Sun Times","description":"Geocoding, timezones, holidays, business days, sun times, FX and distances for AI agents. Deterministic, sub-cent, no API key: payment is authentication (x402).","url":"https://time-place.agent-utils.workers.dev/v1/sun","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":"number","maximum":90,"minimum":-90,"description":"Latitude in decimal degrees (WGS84)"},"lon":{"type":"number","maximum":180,"minimum":-180,"description":"Longitude in decimal degrees (WGS84)"},"date":{"type":"string","format":"date","description":"Default: today in the local timezone"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"lat":{"type":"number"},"lon":{"type":"number"},"date":{"type":"string"},"moon":{"type":"object"},"polar":{"enum":["none","day","night"],"type":"string"},"times":{"type":"object","additionalProperties":{"type":["object","null"],"properties":{"utc":{"type":"string"},"local":{"type":"string"}}}},"timezone":{"type":"string"},"sunPositionNow":{"type":"object"},"dayLengthMinutes":{"type":["integer","null"]}}}}}}},"responseSchema":{"type":"json","example":{"lat":59.9139,"lon":10.7522,"date":"2026-06-21","moon":{"phase":0.21,"phaseName":"waxing crescent","illumination":0.37},"polar":"none","times":{"sunset":{"utc":"2026-06-21T20:43:00.000Z","local":"2026-06-21T22:43:00+02:00"},"sunrise":{"utc":"2026-06-21T01:53:00.000Z","local":"2026-06-21T03:53:00+02:00"}},"timezone":"Europe/Oslo","sunPositionNow":{"azimuthDeg":281.5,"altitudeDeg":12.3},"dayLengthMinutes":1123}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_RgFruwge0gRwFpps5Yc38","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns sunrise, sunset, moon phase, day length, and current sun position for a given latitude/longitude and date","exampleAgentPrompt":"What time does the sun rise and set in Oslo (lat 59.9139, lon 10.7522) on June 21, 2026, and how long is the day?","exampleUseCases":[{"title":"Golden hour timing for outdoor photography","prompt":"I'm shooting photos in Tromsø, Norway (lat 69.6496, lon 18.9560) on July 15 — when exactly is sunrise and sunset, and what's the day length so I can plan my golden hour shots?"},{"title":"Polar night check for Arctic travel","prompt":"I'm visiting Longyearbyen (lat 78.2232, lon 15.6267) on December 10 — will there be any daylight at all, or is it full polar night? Also give me the moon phase."},{"title":"Sunset scheduling for a rooftop event","prompt":"We're hosting a rooftop party in Sydney (lat -33.8688, lon 151.2093) on March 20 — what time does the sun set that evening so we can time the lighting and music?"}],"resultDescription":"A JSON object containing: local and UTC times for sunrise and sunset, total day length in minutes (null during polar events), a polar field indicating polar day/night/none, moon phase fraction and name and illumination percentage, current sun azimuth and altitude in degrees, the resolved timezone, and the echo of the input lat/lon/date.","failureModes":["Missing required lat or lon parameter returns a 400 error","Latitude outside -90 to 90 or longitude outside -180 to 180 returns validation error","Invalid date format (non-ISO 8601) returns a 400 error","Payment not provided or insufficient returns 402 Payment Required","During polar day or polar night, sunrise/sunset times may be null and polar field set accordingly","Network timeouts or upstream worker failures return 5xx errors"],"whenToPreferThis":"Choose this endpoint when you need deterministic, sub-cent astronomical solar and lunar data for a specific geographic coordinate without requiring API key registration — payment via x402 is the only authentication needed. It is ideal for agents that need sunrise/sunset, moon phase, day length, or current sun position in a single lightweight call. Prefer it over general weather APIs when you specifically want solar timing data rather than forecasts, and over heavy astronomy libraries when you need a hosted, pay-per-call solution with no setup overhead.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:39:54.713Z","isFirstParty":false}