Cron Expression API avatar

Cron Expression API

Pricing

from $1.00 / 1,000 api calls

Go to Apify Store
Cron Expression API

Cron Expression API

Validate cron expressions and compute next run times via a simple HTTP API.

Pricing

from $1.00 / 1,000 api calls

Rating

0.0

(0)

Developer

Fatih Şahinbaş

Fatih Şahinbaş

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

5 days ago

Last modified

Categories

Share

Cron Expression API — Validate, Describe & Calculate Next Run Times

A fast, no-nonsense HTTP API for working with cron expressions. Validate crontab syntax, calculate the next run times, look up previous runs, and turn any cron schedule into a plain-English description — all through simple GET requests.

Stop guessing whether */15 9-17 * * 1-5 is correct or when it fires next. This cron parser API answers instantly, with full timezone support.

What it does

  • Validate cron expressions — catch bad fields, out-of-range values, and wrong field counts with clear per-field error messages.
  • ⏭️ Next run times — compute the upcoming N execution times for any cron schedule, in any IANA timezone.
  • ⏮️ Previous run times — look back at when a schedule last fired.
  • 💬 Human-readable descriptions — convert 0 17 * * 1 into "At 17:00, only on Monday".
  • 🧩 One-call parse — validation, description, and next runs in a single request.

Who it's for

Developers building schedulers, CI/CD pipelines, job queues, dashboards, and admin panels who need to validate crontab input or preview when a cron job will run — without shipping a cron library into every service. Perfect for form validation, "next run" previews in UIs, and documentation tooling.

Supported syntax

  • Standard 5-field cron: minute hour day-of-month month day-of-week
  • 6-field cron with seconds: second minute hour day-of-month month day-of-week
  • Macros: @yearly @annually @monthly @weekly @daily @hourly @midnight
  • Ranges, lists, steps: 1-5, 1,3,5, */15, 9-17
  • Names: sun, mon, jan, feb, ...
  • Extensions: L (last day), W (nearest weekday), # (nth weekday) — e.g. 0 0 * * 1#2 = second Monday.

Endpoints

All endpoints are GET and return JSON.

EndpointPurposeKey params
/validateCheck if an expression is validexpr
/nextNext N run timesexpr, count, tz, base
/prevPrevious N run timesexpr, count, tz, base
/describePlain-English descriptionexpr
/parseValidate + describe + next runs in one callexpr, count, tz, base

Parameters

  • expr (required) — the cron expression, e.g. */15 9-17 * * 1-5
  • count — how many run times to return (default 5, max 100)
  • tz — IANA timezone (default UTC), e.g. Europe/Istanbul, America/New_York
  • base — ISO 8601 datetime to calculate from (default: now)

Example

Request:

GET /parse?expr=0 9 * * 1-5&count=3&tz=Europe/Istanbul

Response:

{
"valid": true,
"normalized": "0 9 * * 1-5",
"fields": 5,
"description": "At 09:00, Monday through Friday",
"tz": "Europe/Istanbul",
"next_runs": [
"2026-01-05T09:00:00+03:00",
"2026-01-06T09:00:00+03:00",
"2026-01-07T09:00:00+03:00"
],
"warning": null
}

Invalid input returns a helpful error:

GET /validate?expr=60 * * * *
{
"valid": false,
"normalized": "60 * * * *",
"fields": null,
"errors": ["minute: '60' out of range 0-59"]
}

How it works

The API runs in Standby mode — send it HTTP requests directly, no run to start. Under the hood it uses battle-tested cron parsing for accurate scheduling math, adds a strict validation layer for friendly error messages, and computes run times against the timezone you specify. Impossible schedules (like 0 0 30 2 *, February 30th) are detected and flagged rather than looping forever.

Tips

  • Encode spaces in the expr query string (%20) when testing from the command line.
  • Use base to compute run times from a fixed point instead of "now" — handy for reproducible tests.
  • Need seconds-level precision? Pass a 6-field expression.
  • tz accepts any IANA name; a wrong name returns a clear 400 error.

Pricing

Pay-per-event: $0.001 per successful API call. Readiness/health checks are never charged. No subscription, no minimums — you pay only for the requests you make.