Long Table, Frequency & Time Zones
This page covers how to write the series long table, which timestamp formats the default cleaning path accepts, the freq frequency strings, and how time zones are converted, with a data format quick reference at the end. The raw preset is stricter, see the raw preset.
1. Long-table records
series is a flat array with one observation per row:
| Field | Type | Notes |
|---|---|---|
unique_id | string | Entity ID; rows of the same entity share it. A request may hold several entities. |
ds | string | Timestamp, formats in the next section. |
y | number | null | Observed value. null marks a missing observation; NaN and Infinity are rejected. |
[
{"unique_id": "grid_01", "ds": "2026-09-01T00:00:00Z", "y": 120.5},
{"unique_id": "grid_01", "ds": "2026-09-01T01:00:00Z", "y": null},
{"unique_id": "grid_02", "ds": "2026-09-01T00:00:00Z", "y": 88.0}
]- Rows may come in any order and need not be grouped by entity; default cleaning sorts them by time and records it in the report.
- Other numeric fields on a row are past covariates; they are aligned and reported per column; no model uses them today, see Covariate Support.
- Forecasts are returned per entity, with every timestamp in UTC ending in
Z.
2. Timestamp formats
Under the default and strict presets, ds may use any of the formats below. Keep one format per entity; non-ISO formats are recorded as a timestamp_format issue in the cleaning report.
| Format | Example |
|---|---|
ISO 8601 (T or a space between date and time, optional Z or ±HH:MM) | 2026-09-01T08:00:00+08:00, 2026-09-01 08:00, 2026-09-01 |
Compact date YYYYMMDD | 20260901 |
Slash date YYYY/M/D (time optional) | 2026/9/1 08:00 |
D/M/YYYY or M/D/YYYY | 01/09/2026 |
| Unix seconds or milliseconds (years 2000 to 2100) | 1788220800 |
Year-month YYYY-MM, YYYY/M, YYYYMM | 2026-09 |
| Chinese dates | 2026年9月1日, 2026年9月 |
D/M/YYYY and M/D/YYYY are accepted only when the data proves the day/month order (for example a 13/09/2026 row). Otherwise the request returns AMBIGUOUS_DATE_FORMAT; pass options.ds_format (dmy or mdy) or switch to ISO 8601.
3. Frequency strings
freq is optional. When omitted, the service infers it and reports the result and its confidence in the cleaning report's series[].freq. Inference failure returns FREQ_INFERENCE_FAILED; entities that infer different frequencies, or several candidates, return FREQ_AMBIGUOUS. For irregular data, always pass it.
| String | Meaning |
|---|---|
s, S | Seconds |
min, T, m | Minutes (lowercase m is minutes, not months) |
h, H | Hours |
d, D | Days |
w, W | Weeks (fixed 7 days) |
MS | Month start |
ME, M | Month end |
QS | Quarter start |
QE, Q | Quarter end |
YS, AS | Year start |
YE, Y, A | Year end |
M@<day> | A fixed day of each month (1 to 31), for example M@15; days past the month's length fall on the month end |
B | Business days, Monday to Friday: weekends are not gaps and forecast stamps skip them. Only under cleaning policy version 2026-11 and later (including the default 2026-13), which also detect it for daily data with no weekend dates; no multiple; not accepted by the raw preset |
- Every form except
Btakes an integer multiple prefix, for example15min,2h,3MS,3M@15. - Case matters:
Mis month end,mis minutes. - The
freqfield echoes your string verbatim; when omitted, it echoes the inferred canonical form, such asmin,h,d,w,MS,QE,M@15, or15minwith a multiple. - Calendar frequencies (month, quarter, year) step on the local wall clock (time zones below) and handle month lengths, leap years and daylight saving time.
- The
rawpreset accepts fixed-step frequencies only (seconds, minutes, hours, days, weeks); calendar frequencies returnRAW_INPUT_INVALID.
4. Time zones
- Stamps with an offset (
Zor±HH:MM) are parsed with their own offset;options.timezonedoes not override it. - Stamps without an offset are parsed in
options.timezone(an IANA name such asAsia/Shanghai); without it they are read as UTC and the report records anaive_timestamps_assumed_utcissue (info level). - An invalid zone name returns
VALIDATION_ERROR. - Output: timestamps in
model_inputandforecastare always UTC; convert back to local time on the client if needed.
The cleaning report's series[].timezone records the zone each entity actually used:
| Field | Notes |
|---|---|
used | The zone used, for example Asia/Shanghai or UTC. |
source | explicit_offset (from the stamps' own offsets), option (from options.timezone) or default_utc. |
naive_rows / explicit_rows | Rows without and with an offset. |
explicit_offsets | Offsets seen in the data, for example ["+08:00"]. |
The example below treats monthly Beijing-time data as month-start. Each month starts at local 00:00, which is 16:00 UTC on the previous day:
// Request
{"series": [{"unique_id": "sales", "ds": "2025-01-01", "y": 101}, ...],
"h": 2, "freq": "MS", "options": {"timezone": "Asia/Shanghai"}}
// model_input[0].ds is "2024-12-31T16:00:00Z"
// the two forecast stamps are "2026-08-31T16:00:00Z" and "2026-09-30T16:00:00Z"
// cleaning_report.series[0].timezone
{"used": "Asia/Shanghai", "source": "option", "naive_rows": 20,
"explicit_rows": 0, "explicit_offsets": []}5. Data format quick reference
The /v1/forecast request fields that shape your data at a glance. For every field, its default and the validation order, see POST /v1/forecast.
| Field | Where | Notes |
|---|---|---|
unique_id | series[] | Entity ID, see long-table records. |
ds | series[] | Timestamp, see timestamp formats and time zones. |
y | series[] | Observed value; null marks a missing observation. |
h | Request body | Number of steps to forecast. |
freq | Request body | Frequency string; omit it to let the service infer it, see frequency strings. |
level | Request body | Interval levels, see prediction intervals. |
future_covariates | Request body | Known future features over the forecast window, without the target y, see covariate support. |