apyhub
DEVELOPER TOOLS · STANDARD DATA

Advanced Schedule Cron API

What it does

Cron Schedule Calculator computes the next fire times for a 5-field cron expression in UTC. Send an expression, and optionally a count and from_time, then get back upcoming run timestamps you can use for schedulers, job queues, and previewing recurring tasks.

Use it when you need to confirm that a cron string does what you expect before shipping it into production. count controls how many upcoming runs you want returned, up to 50, and from_time lets you calculate from a specific Unix second instead of the default reference point.

The response includes the original expression, the count used, the timezone, a from value, an optional note, and a next_runs array. That makes it straightforward to show upcoming executions in admin tools, validate user-entered schedules, or debug why a task is firing at a certain time.

If your application accepts cron syntax from users or stores scheduled jobs internally, Cron Schedule Calculator gives you a simple way to turn that expression into concrete upcoming run times without guessing how the schedule will resolve.

POST
Compute the next N fire times of a cron expression (UTC).
http://localhost:8080/creightonnick0/cron-next-run-calculator
QUICKSTARTGUIDE

Quickstart

Calculate the next cron run times from a cron expression.

curl -X POST "http://localhost:8080/creightonnick0/cron-next-run-calculator" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expression":"0 9 * * 1-5"}'

What you'll get back

Returns a JSON object with these top-level fields: from (string), note (string), count (integer), timezone (string), next_runs (array of strings), and expression (string).

{
  "from": "2023-11-14T22:13:20Z",
  "note": "Next scheduled run times",
  "count": 5,
  "timezone": "UTC",
  "next_runs": [
    "2023-11-15T09:00:00Z",
    "2023-11-16T09:00:00Z"
  ],
  "expression": "0 9 * * 1-5"
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
How many upcoming run times to return (1-50, default 5)
Unix seconds to compute from (defaults to a fixed reference)
A 5-field cron expression (min hour dom month dow)

About this endpoint

What it does

Computes the next N UTC fire times for a cron expression. You provide a 5-field cron expression, and can optionally control how many results to return with count and the starting Unix time with from_time.

Request Body

ParameterTypeMandatoryDescription
expressionStringYesA 5-field cron expression in min hour dom month dow format.
countIntegerNoHow many upcoming run times to return. Allowed range: 1-50. Default: 5.
from_timeIntegerNoUnix seconds to compute from. Defaults to a fixed reference time.

Response

Returns a JSON object with from and note string fields, count as an integer, timezone and expression as strings, and next_runs as an array of strings. The response is the computed schedule output for the requested cron expression, in UTC.

ParameterTypeMandatoryDescription
fromStringNoThe reference time used for the calculation.
noteStringNoAdditional informational note returned by the service.
countIntegerNoThe number of run times returned.
timezoneStringNoThe timezone associated with the results.
next_runsString ArrayNoThe computed upcoming run times.
expressionStringNoThe cron expression that was evaluated.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.