# Vextorium Sunrise-Sunset API

> Vextorium Sunrise-Sunset API is a paid API for AI agents from api.vextorium.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-11).

Returns sunrise, sunset, solar noon, day length, and civil/nautical/astronomical twilight times for any coordinates and date, with automatic timezone detection.

## Facts

- Endpoint: POST https://api.vextorium.com/v1/sunrise-sunset?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/vextorium-sunrise-sunset-api-28d2a452
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_djLkTBwxNEQpPMZ2WZjih

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability vextorium-sunrise-sunset-api-28d2a452 -d '<json body>'
```

Example prompt: What time does the sun rise and set in Madrid (40.4168, -3.7038) on October 2, 2026? Also include civil, nautical, and astronomical twilight times.

## When to prefer this

Choose this endpoint when you need precise, locally-timed solar event data (sunrise, sunset, twilight phases, solar noon, day length) for any global coordinate pair, especially when you need all twilight types in one call and automatic timezone resolution. Prefer this over generic weather APIs that only return sunrise/sunset without twilight breakdowns, or when handling polar edge cases like midnight sun or polar night.

## Known failure modes

- Missing required lat/lon fields returns a validation error
- Invalid latitude or longitude values (out of range) may return an error or unexpected results
- If date is omitted, the API may default to the current date or return an error
- Extreme polar coordinates on solstice dates may return null times for sunrise/sunset with a polar night or midnight sun note
- Malformed date string format may cause a parsing error

## How this service works

Sunrise, sunset, solar noon, day length and civil, nautical and astronomical twilight for coordinates and a date, in local time (zone detected from coordinates). Local astronomical calculation; handles polar night and midnight sun.

## Output

Returns a JSON object with the location's coordinates, date, detected timezone, sunrise time, sunset time, solar noon, day length (e.g. '11 h 44 min'), plus civil, nautical, and astronomical twilight start and end times — all in local time. Includes an accuracy note (±1-2 minutes) and handles edge cases like polar night and midnight sun.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "lat",
      "lon"
     ],
     "properties": {
      "lat": {
       "type": "number"
      },
      "lon": {
       "type": "number"
      },
      "date": {
       "type": "string"
      },
      "zone": {
       "type": "string"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": [
      "object",
      "null"
     ],
     "properties": {
      "lat": {
       "type": [
        "number",
        "null"
       ]
      },
      "lon": {
       "type": [
        "number",
        "null"
       ]
      },
      "set": {
       "type": [
        "string",
        "null"
       ]
      },
      "date": {
       "type": [
        "string",
        "null"
       ]
      },
      "note": {
       "type": [
        "string",
        "null"
       ]
      },
      "zone": {
       "type": [
        "string",
        "null"
       ]
      },
      "output": {
       "type": [
        "string",
        "null"
       ]
      },
      "day_length": {
       "type": [
        "string",
        "null"
       ]
      },
      "solar_noon": {
       "type": [
        "string",
        "null"
       ]
      },
      "civil_twilight": {
       "type": [
        "object",
        "null"
       ],
       "properties": {
        "sunset": {
         "type": [
          "string",
          "null"
         ]
        },
        "sunrise": {
         "type": [
          "string",
          "null"
         ]
        }
       }
      },
      "nautical_twilight": {
       "type": [
        "object",
        "null"
       ],
       "properties": {
        "sunset": {
         "type": [
          "string",
          "null"
         ]
        },
        "sunrise": {
         "type": [
          "string",
          "null"
         ]
        }
       }
      },
      "a
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "lat": 40.4168,
  "lon": -3.7038,
  "set": "19:56",
  "date": "2026-10-02",
  "note": "Accuracy of ±1-2 minutes (Nautical Almanac algorithm).",
  "zone": "Europe/Madrid",
  "output": "08:11",
  "day_length": "11 h 44 min",
  "solar_noon": "14:03",
  "civil_twilight": {
   "sunset": "20:23",
   "sunrise": "07:44"
  },
  "nautical_twilight": {
   "sunset": "20:54",
   "sunrise": "07:13"
  },
  "astronomical_twilight": {
   "sunset": "21:26",
   "sunrise": "06:41"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/vextorium-sunrise-sunset-api-28d2a452/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.vextorium.com](https://www.zero.xyz/host/api.vextorium.com/llms.txt)
