# Astro Times – Sunrise/Sunset & Twilight Calculator

> Astro Times – Sunrise/Sunset & Twilight Calculator is a paid API for AI agents from x402.agentutility.ai, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Computes sunrise, sunset, solar noon, day length, golden hour, and civil/nautical/astronomical twilight times for any lat/lon on any date, returning UTC ISO8601 strings.

## Facts

- Endpoint: POST https://x402.agentutility.ai/astro-times
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/astro-times-sunrise-sunset-twilight-calculator-77326584
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0sb9PFWCF10F4pQi02T2f

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 astro-times-sunrise-sunset-twilight-calculator-77326584 -d '<json body>'
```

Example prompt: What time is sunrise and sunset in San Francisco on July 4th, and how long is the day? Also give me civil and nautical twilight times.

## When to prefer this

Choose this endpoint when you need precise, astronomy-grade solar event times (including all twilight categories, golden hour, and solar noon) for any geographic coordinate and date, with no API key required and pay-per-call USDC pricing that suits autonomous agents. Prefer it over weather APIs that only provide approximate sunrise/sunset, or when you need the full set of twilight phases for navigation, photography, or scheduling.

## Known failure modes

- Invalid or out-of-range latitude/longitude returns an error
- Malformed date format causes a parsing failure
- Dates far in the past or future may return less accurate results
- Network timeout if the upstream sunrise-sunset.org API is unavailable
- Missing required fields (lat, lon, or date) result in a 4xx error

## How this service works

Sunrise sunset times. Computes sunrise, sunset, solar noon, day length (seconds), and civil / nautical / astronomical twilight begin & end for any latitude/longitude on any date. Also covers golden hour, dawn / dusk, and full astronomy-times. UTC ISO8601 strings. Wraps sunrise-sunset.org's public API — no auth, commercial-OK.

## Output

A JSON object containing the date, latitude/longitude, and a full set of solar times: sunrise, sunset, solar noon, day length in seconds, civil/nautical/astronomical twilight begin and end times — all as UTC ISO8601 strings. Also includes the upstream source URL (sunrise-sunset.org).

## 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": [
      "latitude",
      "longitude"
     ],
     "properties": {
      "date": {
       "type": "string",
       "description": "Date in YYYY-MM-DD. Defaults to today (UTC) if omitted."
      },
      "latitude": {
       "type": "number",
       "description": "Decimal degrees, range [-90, 90]. Positive north."
      },
      "longitude": {
       "type": "number",
       "description": "Decimal degrees, range [-180, 180]. Positive east."
      }
     }
    },
    "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",
     "properties": {
      "date": {
       "type": "string"
      },
      "times": {
       "type": "object",
       "properties": {
        "sunset": {
         "type": "string"
        },
        "sunrise": {
         "type": "string"
        },
        "solar_noon": {
         "type": "string"
        },
        "civil_twilight_end": {
         "type": "string"
        },
        "day_length_seconds": {
         "type": "integer"
        },
        "civil_twilight_begin": {
         "type": "string"
        },
        "nautical_twilight_end": {
         "type": "string"
        },
        "nautical_twilight_begin": {
         "type": "string"
        },
        "astronomical_twilight_end": {
         "type": "string"
        },
        "astronomical_twilight_begin": {
         "type": "string"
        }
       }
      },
      "source": {
       "type": "string"
      },
      "location": {
       "type": "object",
       "properties": {
        "lat": {
         "type": "number"
        },
        "lon": {
         "type": "number"
        }
       }
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "date": "2026-05-06",
  "times": {
   "sunset": "2026-05-07T03:11:30+00:00",
   "sunrise": "2026-05-06T13:08:42+00:00",
   "solar_noon": "2026-05-06T20:10:06+00:00",
   "civil_twilight_end": "2026-05-07T03:40:42+00:00",
   "day_length_seconds": 50568,
   "civil_twilight_begin": "2026-05-06T12:39:31+00:00",
   "nautical_twilight_end": "2026-05-07T04:15:36+00:00",
   "nautical_twilight_begin": "2026-05-06T12:04:38+00:00",
   "astronomical_twilight_end": "2026-05-07T04:51:59+00:00",
   "astronomical_twilight_begin": "2026-05-06T11:28:14+00:00"
  },
  "source": "https://api.sunrise-sunset.org/json",
  "location": {
   "lat": 37.7749,
   "lon": -122.4194
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/astro-times-sunrise-sunset-twilight-calculator-77326584/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentutility.ai](https://www.zero.xyz/host/x402.agentutility.ai/llms.txt)
