# Agent Time & Place – Sun Times

> Agent Time & Place – Sun Times is a paid API for AI agents from time-place.agent-utils.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Returns sunrise, sunset, moon phase, day length, and current sun position for a given latitude/longitude and date

## Facts

- Endpoint: GET https://time-place.agent-utils.workers.dev/v1/sun
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-time-place-sun-times-ce0f8f81
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FHAiTFpg0T-QwYYcFLReW

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 agent-time-place-sun-times-ce0f8f81
```

Example prompt: 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?

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Geocoding, timezones, holidays, business days, sun times, FX and distances for AI agents. Deterministic, sub-cent, no API key: payment is authentication (x402).

## Output

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.

## 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"
     ],
     "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"
       ]
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-time-place-sun-times-ce0f8f81/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from time-place.agent-utils.workers.dev](https://www.zero.xyz/host/time-place.agent-utils.workers.dev/llms.txt)
