# Almanac Sky API – Celestial Positions & Solar/Lunar Data

> Almanac Sky API – Celestial Positions & Solar/Lunar Data is a paid API for AI agents from almanac.locomot.io, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Returns real-time or scheduled solar, lunar, planetary body positions, twilight times, and next seasonal event for a given geographic location and time.

## Facts

- Endpoint: GET https://almanac.locomot.io/sky
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/almanac-sky-api-celestial-positions-solar-lunar-data-29b7c222
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__Qf3f83I0Y7dbjH3VH6No

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 almanac-sky-api-celestial-positions-solar-lunar-data-29b7c222
```

Example prompt: What are the exact sunrise, sunset, moonrise, moonset, and twilight times for London (51.5074° N, -0.1278° W) tomorrow, May 20, 2025, at sea level?

## When to prefer this

Choose this endpoint when you need precise, computation-backed astronomical data (sun/moon positions, twilight, planetary bodies, seasonal events) for any geographic coordinate and arbitrary time. Prefer it over weather APIs (which may include basic sunrise/sunset but lack planetary positions and twilight breakdowns) and over static almanac tables (which are not real-time or coordinate-specific). Ideal for agents building stargazing planners, solar energy tools, photography golden-hour finders, or any app needing authoritative ephemeris-based celestial data.

## Known failure modes

- Missing required lat or lon query params → 400 Bad Request
- lat out of range [-90, 90] or lon out of range [-180, 180] → validation error
- Invalid ISO-8601 format for 'when' → parsing error
- Payment not provided or insufficient → 402 Payment Required
- Server-side ephemeris computation failure → 500 Internal Server Error

## How this service works

Deterministic ephemeris snapshot (one location/time).

## Output

A JSON object containing sun data (rise, set, azimuth, elevation), moon data (rise, set, phase, illumination), planetary body positions, an array of twilight intervals, a next_season_event object (e.g. next solstice), the astronomical engine and ephemeris kernel used, and a flag indicating whether the result is deterministic — all computed for the requested lat/lon and time.

## 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": [
      "lat",
      "lon"
     ],
     "properties": {
      "lat": {
       "type": "number",
       "maximum": 90,
       "minimum": -90
      },
      "lon": {
       "type": "number",
       "maximum": 180,
       "minimum": -180
      },
      "when": {
       "type": "string",
       "description": "ISO-8601 UTC; default now"
      },
      "elevation_m": {
       "type": "number",
       "description": "optional, default 0"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "sun": {
     "type": "object"
    },
    "moon": {
     "type": "object"
    },
    "query": {
     "type": "object"
    },
    "bodies": {
     "type": "object"
    },
    "engine": {
     "type": "string"
    },
    "kernel": {
     "type": "string"
    },
    "twilight": {
     "type": "array"
    },
    "visible_now": {
     "type": "object"
    },
    "deterministic": {
     "type": "boolean"
    },
    "next_season_event": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/almanac-sky-api-celestial-positions-solar-lunar-data-29b7c222/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from almanac.locomot.io](https://www.zero.xyz/host/almanac.locomot.io/llms.txt)
