Skip to main content

Time API

The Time API provides information about the available timesteps of a domain. The API offers different modes. These can be used depending on the use case.

Request

GET /v1/time/{mode}/{domain}

Parameters:

AttributeTypeDescription
modestringOne of the following values: hourly, daily, monthly or nexthours.
domainstringThe domain the time information are required for.
ModeDescriptionDefault response type (see below)
hourlyUsed to show non aggregated maps with an hourly or 3-hourly (depending on the domain) resolution (e.g. Temerature 3-hourly)regular
dailyUsed to show daily aggregated maps (e.g. Temperature Daily Max)categories
monthlyUsed to show monthly aggregated maps (e.g. Wind Speed Anomaly)categories
nexthoursUsed to show a aggregation over different time ranges (e.g. Accumulated Precipitation)categories

Response

There are several types of responses. Depending on the chosen mode, the api will choose one.

All possible responses share the following attributes:

{
"type": "...",
"expires": "2022-02-17T16:06",
"lastUpdate": "2022-02-17T14:41:56",
...
}
AttributeTypeDescription
typestringeither regular, categories or timesteps
expiresstring?optional iso8601 timestamp. At this point in time the map should be reloaded.
lastUpdatestring?optional iso8601 timestamp of the last update. This can be used for cache invalidation.

Depending on the type there are additional attributes.

Regular

If the response type is regular the api provides the first and last timestep and an interval.

{
...,
"first": "2022-02-17T00:00",
"last": "2022-02-24T12:00",
"interval": 10800,
"current": "2022-02-17T18:00"
}
AttributeTypeDescription
firststringiso8601 timestamp of the first available timestep.
laststringiso8601 timestamp of the last available timestep.
intervalnumberthe interval between two timesteps in seconds.
currentstringiso8601 timestamp of the current timestep.

The Maps Plugin will generate a timeslider like this:

Regular Timeslider

Categories

If the response type is categories the api provides a list of named timesteps. This is used for maps that show a daily or monthly aggregation.

{
...,
"categories": [
{
"name": "Mon",
"value": "2022-02-21"
},
{
"name": "Tue",
"value": "2022-02-22"
},
{
"name": "Wed",
"value": "2022-02-23"
},
{
"name": "Thu",
"value": "2022-02-24"
},
{
"name": "Fri",
"value": "2022-02-25"
},
{
"name": "Sat",
"value": "2022-02-26"
},
{
"name": "Sun",
"value": "2022-02-27"
}
]
}
AttributeTypeDescription
categories[object]A list of available categories. Each category contains a name and a value attribute.

The Maps Plugin will generate a timeslider like this:

Categories Timeslider

Timesteps

If the response type is timesteps the api provides also a list of timesteps. But in this case they are named with an iso8601 timestamp.

{
...,
"format": "H:i",
"timesteps": [
{
"timestep": "2022-02-21T03:00:00+00:00",
"value": "20220221T03"
},
{
"timestep": "2022-02-21T04:00:00+00:00",
"value": "20220221T04"
},
{
"timestep": "2022-02-21T05:00:00+00:00",
"value": "20220221T05"
},
{
"timestep": "2022-02-21T06:00:00+00:00",
"value": "20220221T06"
},
{
"timestep": "2022-02-21T07:00:00+00:00",
"value": "20220221T07"
}
],
"ranges": [
{
"label": "3h",
"numsteps": 3
},
{
"label": "5h",
"numsteps": 5
}
]
}

AttributeTypeDescription
timesteps[object]A list of available timesteps. Each timestep contains a timestep that is shown in the interface and a value attribute that is used for the url.
ranges[object]?A optional list of ranges. Each range contains a label that is shown and a numsteps attribute that defines how many timesteps should be visible in this range. numsteps counts from bottom to top. A value of 3 will show the last three available timesteps.

The Maps Plugin will generate a timeslider like this:

Timesteps Timeslider