Skip to main content

overview

Online apis to demonstrate the expressiveness of ChronoX;

Route

The route generally consists of 5 parts: /path/action/calendar mode/cronx expression

path (optional)

path indicates whether pattern is a span and which edge of the span is the following action take on;

For non-span pattern this will be simply omitted;

A list of the path variants for span pattern:

  • /span
  • /span/start
  • /span/end

action

action indicates the calculation type;

Variants are:

/span only refer to itself, does not include the other two;

  • prev, calculate time of pattern occurred before; not available for /span;
  • next, calculate time of pattern occurred after; not available for /span;
  • contains, calculate if time can be described by the pattern

calendar mode

Indicate what calendar mode the cronx uses, varaiants are c, m, w, d, see details;

cronx expression

cronx expression without calendar mode indicator, see details;

info

be aware that you probably need to use escape characters in the expression, like %20 for space and %2F for /;

Query Parameters

namevalueactionnote
nowiso time stringcontains prev nextoptional, default server current time
offsetiso string for utc time offsetcontains prev nextoptional, indicate timezone for default now value, default to the utc offset, only functional when now is not set
leapu32prev nextoptional, default 1, indicate calculate time leap number away from now

HTTP Method

GET unless specified

Response

default to json format

Success

status: 200 contains

{
"data":{
"contains": bool
}
}

prev/next

{
"data":{
"dest": string
}
}

dest follows ISO format

Error

status: 400

{
"code": string,
"msg": string
}

Variants for code are:

  • SPEC_ERROR, wrong cronx
  • MODE_ERROR, mode mismatch
  • EDGE_OUT, calculation result falls out of range
  • QUERY_ERROR, query parameters
  • PATH_ERROR, cannot parse the route

Limit Usage

The demo instance has limit access at 1 request per s per ip, you may get status code 429 when exceed limit;

Year Range

Available search range: 1970-2099

Demo

Disclaimer

This is only a demo api for demonstration or casual use currently; Be aware of any potential risks such as host change, use limit change, unexpected return code and messages, etc.

USE AT YOUR OWN RISK

see details at a fancier interactive api doc here;