# Sunrise-Sunset on Onekey > 1 endpoint for Sunrise-Sunset (1 stable, 0 beta), 1 credit each. Category: Maps, weather & space. One key, one JSON shape. Base URL: https://api.onekey.dev Auth: header `x-api-key: `. Call shape: `GET /v1/{platform}/{endpoint}?{params}`. Every response is `{success, data, metadata, error}`; check `success` first. Cost is in `metadata.credits_charged`. Free when served from cache (0.2 credit for a cached response over 100 KB). Failed and not-found calls are refunded. Status: stable = verified against the live source; beta = not yet verified, fields may be missing. Page: https://onekey.dev/platforms/sunrisesunset Reference (Markdown): https://onekey.dev/docs/api/sunrisesunset.md All docs: https://onekey.dev/llms.txt ## Canonical fields returned Unified-schema fields (same names on every platform), with how many of the 1 mapped Sunrise-Sunset endpoints return each: - `entity.date` (ISO 8601 date): 1 - plus 9 platform-specific fields under `ext.` ## Endpoints ### sunrisesunset.day Sunrise, sunset, solar noon, day length and twilights for a coordinate and date. - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/sunrisesunset/day?lat=36.72&lon=-4.42&date=2024-06-21` with header `x-api-key: YOUR_API_KEY` - Parameters: - `lat` (string, required): Latitude in decimal degrees (-90..90) - `lon` (string, required): Longitude in decimal degrees (-180..180) - `date` (string, optional, default today): Date YYYY-MM-DD or today - Fields returned: `entity.date`, `ext.sunrise`, `ext.sunset`, `ext.dayLengthSeconds`, `ext.civilTwilightBegin`, `ext.civilTwilightEnd`, `ext.nauticalTwilightBegin`, `ext.nauticalTwilightEnd`, `ext.astronomicalTwilightBegin`, `ext.astronomicalTwilightEnd` - Reference: https://onekey.dev/docs/api/sunrisesunset/day.md ## Sample request ```bash curl "https://api.onekey.dev/v1/sunrisesunset/day?lat=36.72&lon=-4.42&date=2024-06-21" \ -H "x-api-key: YOUR_API_KEY" ```