REST API Usage
You can use the CronMaker API as REST services. The end point of the REST services is http://www.cronmaker.com/rest.
Maximum 1000 requests can be sent in a day from the same IP address. If that limit is exceeded, an error is returned. API is documented below.
Running any cron expression
You can calculate the dates cron expression may run by calling the service below;
curl http://www.cronmaker.com/rest/sampler?expression={expression}
Examples;
curl http://www.cronmaker.com/rest/sampler?expression=0 0/2 * 1/1 * ? *
curl http://www.cronmaker.com/rest/sampler?expression=0 0/2 * 1/1 * ? *&hour=13&minute=45
curl http://www.cronmaker.com/rest/sampler?expression=0 0/2 * 1/1 * ? *&hour=13&minute=45&count=10
curl http://www.cronmaker.com/rest/sampler?expression=0 0/2 * 1/1 * ? *&year=2014&month=12&hour=13&minute=45&count=10
curl http://www.cronmaker.com/rest/sampler?expression=0 0/2 * 1/1 * ? *&year=2014&month=12&hour=13&minute=45&count=10&utcOffset=1
You can decide number of dates by supplying "count" parameter. Default value is 5. Returned dates are in ISO format.
Minutes panel
The call to get a cron expression for events occurring every 2 minutes;
Example;
curl http://www.cronmaker.com/rest/minutes/2
Hourly panel
The code to get a cron expression for events occurring every hour;
curl http://www.cronmaker.com/rest/hourly/every/1
To run at specific time;
curl http://www.cronmaker.com/rest/hourly/at?hour=22&minute=35
Daily panel
curl http://www.cronmaker.com/rest/daily/everyDay?hour=13&minute=2
To run at weekdays;
curl http://www.cronmaker.com/rest/daily/weekdays
Weekly panel
To generate cron expression denoting every Tuesday and Sunday;
curl http://www.cronmaker.com/rest/weekly?days=Tue,Sun
Monthly panel
Generates cron expression to be run at the 21th day of every 3 months
curl http://www.cronmaker.com/rest/monthly/day/21/ofEvery/3
Generates expression for representing second wednesday of every month;
curl http://www.cronmaker.com/rest/monthly/second/wed/ofEvery/1
Yearly panel
Get expression to be run 18th day of every February;
curl http://www.cronmaker.com/rest/yearly/atDay/18/ofEvery/2
Represents cron expression for first tuesday of every march
curl http://www.cronmaker.com/rest/yearly/first/tue/ofEvery/3