# Cron Expression Parser & Next-Run Calculator

> Cron Expression Parser & Next-Run Calculator is a paid API for AI agents from api.datasieve.xyz, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Parses a 5- or 6-field cron expression and returns the next N upcoming run times in any IANA timezone, plus seconds until the next execution.

## Facts

- Endpoint: POST https://api.datasieve.xyz/utils/cron-next
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/cron-expression-parser-next-run-calculator-09e65861
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_A5qV3iGsORjdAnk7TArM1

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 cron-expression-parser-next-run-calculator-09e65861 -d '<json body>'
```

Example prompt: What are the next 5 times that the cron expression '0 9 * * 1-5' will fire in the America/New_York timezone, and how many seconds until the first one?

## When to prefer this

Use this endpoint when you need to quickly preview upcoming cron job execution times in a specific timezone without setting up a full scheduling library. It is ideal for validating a new cron expression before deploying it, or for displaying next-run information to end users. It supports both 5-field and 6-field cron syntax and handles IANA timezone conversion natively, making it preferable to local parsing libraries when timezone accuracy matters.

## Known failure modes

- Invalid cron expression syntax returns a 4xx error and no billing charge
- Unknown or misspelled IANA timezone string causes a validation error
- Count outside the allowed range (1–20) returns a validation error
- Malformed JSON body results in a 400 parse error
- Network timeouts on the $0.001 x402 payment flow before the call completes

## How this service works

Standing infrastructure for ephemeral AI agents, paid per call over x402. Watches, dead-man switches, and multi-agent coordination. No account; wallet as identity.

## Output

Returns a list of the next N upcoming run timestamps (in ISO 8601 format) for the given cron expression in the requested IANA timezone, along with the number of seconds until the very next execution.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "tz": {
   "type": "string",
   "default": "UTC",
   "description": "IANA timezone, default UTC"
  },
  "cron": {
   "type": "string",
   "description": "5- or 6-field cron expression, e.g. \"0 9 * * 1-5\""
  },
  "count": {
   "type": "integer",
   "default": 5,
   "maximum": 20,
   "minimum": 1,
   "description": "how many upcoming run times to return"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "tz": "UTC",
  "cron": "0 9 * * 1-5",
  "hint": "Want this cron to actually FIRE? POST /watch/standard with a schedule condition…",
  "nextRuns": [
   "2026-07-13T09:00:00.000Z",
   "2026-07-14T09:00:00.000Z"
  ],
  "secondsUntilNext": 45000
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/cron-expression-parser-next-run-calculator-09e65861/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.datasieve.xyz](https://www.zero.xyz/host/api.datasieve.xyz/llms.txt)
