# Sunrise, Sunset & Moon

> Sunrise, Sunset & Moon is a paid API for AI agents from bess-x402.onrender.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-28).

Returns sunrise, sunset, solar noon, day length, sun elevation, moonrise, moonset, moon phase, and illumination for any location and date.

## Facts

- Endpoint: GET https://bess-x402.onrender.com/v1/geo/sun-moon?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-28
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/sunrise-sunset-moon-057c426f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ZXiqlY_vgEsO_vgx4Hijd

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 sunrise-sunset-moon-057c426f
```

Example prompt: What time does the sun rise and set in Kyoto, Japan on March 20, 2025, and what's the moon phase that night? Use UTC+9.

## When to prefer this

Choose this endpoint when you need precise astronomical and lunar data for a specific location and date — especially when you need both solar and lunar data in one call. It covers sunrise/sunset, moon phase, and illumination together, making it ideal for photography planning, religious observance scheduling, outdoor event planning, and solar work scheduling. Prefer it over weather APIs that only incidentally include sunrise/sunset without lunar data.

## Known failure modes

- Missing both 'place' and 'lat'/'lon' parameters returns an error — at least one location method is required
- Invalid date format (not YYYY-MM-DD) returns a parsing error
- Unrecognized place name or address returns a geocoding failure
- Invalid UTC offset format causes a time zone error
- Service unavailable on Render cold start may cause slow or failed responses

## How this service works

Sunrise, sunset, solar noon, day length, sun elevation, moonrise, moonset, moon phase and illumination for any place (name or coordinates) and date. Use for photography, prayer and event planning, solar or outdoor work.

## Output

Returns a structured JSON object with sunrise, sunset, solar noon, and day length times; sun elevation at solar noon; moonrise and moonset times; moon phase name (e.g. waxing gibbous, full moon); and moon illumination percentage — all expressed in the requested local UTC offset or UTC by default.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "on": {
       "type": "string",
       "description": "Date YYYY-MM-DD"
      },
      "lat": {
       "type": "number",
       "description": "Latitude"
      },
      "lon": {
       "type": "number",
       "description": "Longitude"
      },
      "place": {
       "type": "string",
       "description": "City or address"
      },
      "utc_offset": {
       "type": "string",
       "description": "Local UTC offset for the times, e.g. +04:00"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/sunrise-sunset-moon-057c426f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from bess-x402.onrender.com](https://www.zero.xyz/host/bess-x402.onrender.com/llms.txt)
