# Cron Expression Parser and Next Run Times (`mangudai/cron-expression-parser`) Actor

Parse cron expressions and get the next scheduled run times with a plain-English description. Give one or more standard cron strings and get a clean table of upcoming runs, weekdays, and validity. Offline, no API key.

- **URL**: https://apify.com/mangudai/cron-expression-parser.md
- **Developed by:** [Mangudäi](https://apify.com/mangudai) (community)
- **Categories:** Developer tools, Automation, Open source
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Cron expression parser and next run times

Turn any cron expression into a schedule you can read. Give this actor one or more standard cron expressions and it returns the next run times, a plain-English meaning, the weekday for each run, and the previous run, all in a clean table. No API key, no sign-up, pure offline computation.

### What it does

Cron syntax is compact but hard to read at a glance. Does `*/15 9-17 * * 1-5` fire when you think it does? This actor answers that. For each expression it validates the syntax, describes it in words, and lists the next N times it will fire from a start moment you choose, in the timezone you choose.

### Input

- Cron expressions: one or more 5-field cron strings, for example `0 9 * * 1-5`.
- Number of upcoming runs: how many future run times to compute per expression, 1 to 100.
- Start date: an ISO datetime to compute from. Empty means now.
- Timezone: an IANA timezone name such as `Europe/Paris`. Defaults to UTC.

### Output

One row per computed run, with these fields:

- cron\_expression: the input expression.
- description: plain-English meaning, for example "At 09:00 AM, Monday through Friday".
- valid: whether the expression parsed.
- timezone: the timezone used.
- run\_number: 1 for the next run, 2 for the one after, and so on.
- next\_run: ISO datetime of that run.
- weekday: day name of the run.
- seconds\_from\_start: seconds between the start moment and the run.
- previous\_run: the most recent past run, on the first row of each expression.
- error: the reason an expression failed, when it did.

### Common expressions

- `0 9 * * 1-5` weekdays at 9am.
- `*/15 * * * *` every 15 minutes.
- `0 0 1 * *` midnight on the first of each month.
- `0 */6 * * *` every 6 hours.

### Notes

Standard 5-field cron only. Computation is offline and deterministic, so runs are fast and never break on a network hiccup.

# Actor input Schema

## `cronExpressions` (type: `array`):

One or more standard 5-field cron expressions (minute hour day-of-month month day-of-week).

## `count` (type: `integer`):

How many next run times to compute per expression (1 to 100).

## `startDate` (type: `string`):

ISO datetime to compute runs from. Leave empty to use the current time.

## `timezone` (type: `string`):

IANA timezone name for the computed run times, for example Europe/Paris or America/New\_York.

## Actor input object example

```json
{
  "cronExpressions": [
    "0 9 * * 1-5",
    "*/15 * * * *",
    "0 0 1 * *"
  ],
  "count": 5,
  "startDate": "2026-07-12T00:00:00Z",
  "timezone": "UTC"
}
```

# Actor output Schema

## `runs` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "cronExpressions": [
        "0 9 * * 1-5",
        "*/15 * * * *",
        "0 0 1 * *"
    ],
    "count": 5,
    "timezone": "UTC"
};

// Run the Actor and wait for it to finish
const run = await client.actor("mangudai/cron-expression-parser").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "cronExpressions": [
        "0 9 * * 1-5",
        "*/15 * * * *",
        "0 0 1 * *",
    ],
    "count": 5,
    "timezone": "UTC",
}

# Run the Actor and wait for it to finish
run = client.actor("mangudai/cron-expression-parser").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "cronExpressions": [
    "0 9 * * 1-5",
    "*/15 * * * *",
    "0 0 1 * *"
  ],
  "count": 5,
  "timezone": "UTC"
}' |
apify call mangudai/cron-expression-parser --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=mangudai/cron-expression-parser",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/br3iqBS7jPFN19hQ2/builds/MqJJ24GYPqDUQ8ts3/openapi.json
