Skip to main content

Mock Time-Series Data API

MOCK DATA

Generate compact mock metric series and standalone points with exact intervals, bounded values, coherent trends and deterministic timestamps.

Generated test data for fixtures and development

Base URL
/api/time-series
Capabilities
2 routes Seedable
Last updated
July 30, 2026

GET /api/time-series

Live requestRuns against the public API
No key required
GET/api/time-series?metric=latency&trend=rising&interval=1m&points=24&count=5&seed=42

Request parameters

Constrain every series to this metric. Omit for a mix.

Constrain the value shape. Omit for mixed trend fixtures.

Exact spacing between adjacent points.

Exact number of points nested in every generated series.

First point timestamp. Defaults to the current UTC day's start and is echoed in meta.params.

Environment tag attached to the generated series.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/time-series?metric=latency&trend=rising&interval=1m&points=24&seed=42&count=5"
const res = await fetch("https://randomapi.dev/api/time-series?metric=latency&trend=rising&interval=1m&points=24&seed=42&count=5");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/time-series?metric=latency&trend=rising&interval=1m&points=24&seed=42&count=5").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/time-series?metric=latency&trend=rising&interval=1m&points=24&seed=42&count=5"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 6
metric enum

Constrain every series to this metric. Omit for a mix.

allowed: cpuUsage | requestRate | latency | memoryUsage | temperature
example: metric=latency
trend enum

Constrain the value shape. Omit for mixed trend fixtures.

allowed: stable | rising | falling | spike
example: trend=rising
interval enum

Exact spacing between adjacent points.

default: 5m
allowed: 1m | 5m | 1h
example: interval=1m
points int

Exact number of points nested in every generated series.

default: 12
allowed: 2 – 24
example: points=24
start date

First point timestamp. Defaults to the current UTC day's start and is echoed in meta.params.

example: start=2026-07-10T00:00:00.000Z
environment enum

Environment tag attached to the generated series.

default: development
allowed: development | staging | production
example: environment=staging
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=seriesId,metric
exclude list

Return all fields except these (comma-separated).

example: exclude=points
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 12
seriesId string

Unique fictional series identity prefixed ser_.

example: ser_0_a81c42f0

metric string

cpuUsage, requestRate, latency, memoryUsage or temperature.

example: latency

unit string

Unit coherent with metric.

example: ms

trend string

Generated value-shape constraint.

example: rising

interval string

Exact point interval.

example: 5m

startTime string (ISO 8601)

Timestamp of points[0].

example: 2026-07-10T00:00:00.000Z

endTime string (ISO 8601)

Timestamp of the final point.

example: 2026-07-10T00:55:00.000Z

min float

Minimum of the returned point values.

example: 121.4

max float

Maximum of the returned point values.

example: 178.2

average float

Arithmetic mean of returned point values, rounded to metric precision.

example: 149.8

tags object

Small fictional environment and host tag set.

example: {"environment":"staging","host":"node-3"}

points object[]

Exact chronological timestamp/value pairs.

example: [{"timestamp":"2026-07-10T00:00:00.000Z","value":121.4}]

Documented examples

Build-generated requests and complete responses
2
Rising latency series
GET /api/time-series?metric=latency&trend=rising&interval=1m&points=24&seed=42&count=5
{
  "data": [
    {
      "seriesId": "ser_0_d40fb158",
      "metric": "latency",
      "unit": "ms",
      "trend": "rising",
      "interval": "1m",
      "startTime": "2026-07-30T00:00:00.000Z",
      "endTime": "2026-07-30T00:23:00.000Z",
      "min": 982.7,
      "max": 1734.1,
      "average": 1336.6,
      "tags": {
        "environment": "development",
        "host": "node-1"
      },
      "points": [
        {
          "timestamp": "2026-07-30T00:00:00.000Z",
          "value": 982.7
        },
        {
          "timestamp": "2026-07-30T00:01:00.000Z",
          "value": 1019.8
        },
        {
          "timestamp": "2026-07-30T00:02:00.000Z",
          "value": 1053.7
        },
        {
          "timestamp": "2026-07-30T00:03:00.000Z",
          "value": 1076.5
        },
        {
          "timestamp": "2026-07-30T00:04:00.000Z",
          "value": 1107.6
        },
        {
          "timestamp": "2026-07-30T00:05:00.000Z",
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Production CPU spikes
GET /api/time-series?metric=cpuUsage&trend=spike&environment=production&start=2026-07-10&count=10
{
  "data": [
    {
      "seriesId": "ser_0_c85eac58",
      "metric": "cpuUsage",
      "unit": "%",
      "trend": "spike",
      "interval": "5m",
      "startTime": "2026-07-10T00:00:00.000Z",
      "endTime": "2026-07-10T00:55:00.000Z",
      "min": 46.97,
      "max": 84.11,
      "average": 52.26,
      "tags": {
        "environment": "production",
        "host": "node-1"
      },
      "points": [
        {
          "timestamp": "2026-07-10T00:00:00.000Z",
          "value": 50
        },
        {
          "timestamp": "2026-07-10T00:05:00.000Z",
          "value": 49.6
        },
        {
          "timestamp": "2026-07-10T00:10:00.000Z",
          "value": 48.21
        },
        {
          "timestamp": "2026-07-10T00:15:00.000Z",
          "value": 49.26
        },
        {
          "timestamp": "2026-07-10T00:20:00.000Z",
          "value": 84.11
        },
        {
          "timestamp": "2026-07-10T00:25:00.000Z",
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}

GET /api/time-series/points

Live requestRuns against the public API
No key required
GET/api/time-series/points?series=checkout-latency&metric=latency&interval=1m&count=20&seed=42

Request parameters

Safe series key echoed in every record; letters, digits, dot, underscore and hyphen only.

Metric controlling value bounds and unit.

Timestamp step between consecutive records.

Timestamp of record index 0. Defaults to current UTC-day start.

Constrain data quality. Missing forces value=null.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/time-series/points?series=checkout-latency&metric=latency&interval=1m&seed=42&count=20"
const res = await fetch("https://randomapi.dev/api/time-series/points?series=checkout-latency&metric=latency&interval=1m&seed=42&count=20");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/time-series/points?series=checkout-latency&metric=latency&interval=1m&seed=42&count=20").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/time-series/points?series=checkout-latency&metric=latency&interval=1m&seed=42&count=20"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 5
series string

Safe series key echoed in every record; letters, digits, dot, underscore and hyphen only.

default: demo-series
allowed: 1 – 48
example: series=checkout-latency
metric enum

Metric controlling value bounds and unit.

default: latency
allowed: cpuUsage | requestRate | latency | memoryUsage | temperature
example: metric=cpuUsage
interval enum

Timestamp step between consecutive records.

default: 5m
allowed: 1m | 5m | 1h
example: interval=1h
start date

Timestamp of record index 0. Defaults to current UTC-day start.

example: start=2026-07-10T00:00:00.000Z
quality enum

Constrain data quality. Missing forces value=null.

allowed: good | estimated | missing
example: quality=estimated
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=pointId,seriesId
exclude list

Return all fields except these (comma-separated).

example: exclude=tags
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 8
pointId string

Unique fixture point id containing the stable record index.

example: pt_0_31f0a82d

seriesId string

Validated caller-supplied series key.

example: checkout-latency

metric string

Selected metric.

example: latency

unit string

Unit coherent with metric.

example: ms

timestamp string (ISO 8601)

start plus recordIndex times interval.

example: 2026-07-10T00:05:00.000Z

value float nullable

Bounded metric value, or null when quality is missing.

example: 82.4

quality string

good, estimated or missing.

example: good

tags object

Small stable fictional host and source tags.

example: {"host":"node-2","source":"mock"}

Documented examples

Build-generated requests and complete responses
2
Sequential checkout latency points
GET /api/time-series/points?series=checkout-latency&metric=latency&interval=1m&seed=42&count=20
{
  "data": [
    {
      "pointId": "pt_0_a958016c",
      "seriesId": "checkout-latency",
      "metric": "latency",
      "unit": "ms",
      "timestamp": "2026-07-30T00:00:00.000Z",
      "value": 1886.1,
      "quality": "good",
      "tags": {
        "host": "node-1",
        "source": "mock"
      }
    },
    {
      "pointId": "pt_1_078f248a",
      "seriesId": "checkout-latency",
      "metric": "latency",
      "unit": "ms",
      "timestamp": "2026-07-30T00:01:00.000Z",
      "value": 1467.5,
      "quality": "good",
      "tags": {
        "host": "node-2",
        "source": "mock"
      }
    },
    {
      "pointId": "pt_2_15790902",
      "seriesId": "checkout-latency",
      "metric": "latency",
      "unit": "ms",
      "timestamp": "2026-07-30T00:02:00.000Z",
      "value": 1603.4,
      "quality": "estimated",
      "tags": {
        "host": "node-3",
        "source": "mock"
      }
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Missing CPU samples
GET /api/time-series/points?series=demo.cpu&metric=cpuUsage&quality=missing&start=2026-07-10&count=12
{
  "data": [
    {
      "pointId": "pt_0_7a958016",
      "seriesId": "demo.cpu",
      "metric": "cpuUsage",
      "unit": "%",
      "timestamp": "2026-07-10T00:00:00.000Z",
      "value": null,
      "quality": "missing",
      "tags": {
        "host": "node-1",
        "source": "mock"
      }
    },
    {
      "pointId": "pt_1_0078f248",
      "seriesId": "demo.cpu",
      "metric": "cpuUsage",
      "unit": "%",
      "timestamp": "2026-07-10T00:05:00.000Z",
      "value": null,
      "quality": "missing",
      "tags": {
        "host": "node-2",
        "source": "mock"
      }
    },
    {
      "pointId": "pt_2_d1579090",
      "seriesId": "demo.cpu",
      "metric": "cpuUsage",
      "unit": "%",
      "timestamp": "2026-07-10T00:10:00.000Z",
      "value": null,
      "quality": "missing",
      "tags": {
        "host": "node-3",
        "source": "mock"
      }
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}

About this API

Coverage & behavior

Generates fictional time-series metric fixtures for charts, monitoring screens and ingestion tests. The root route returns one bounded series per record. Its points are strictly chronological at the requested interval, summary statistics are calculated from those exact values, and metric values stay inside documented domain ranges.

The trend parameter is structural rather than decorative: rising never decreases, falling never increases, stable stays near a generated baseline, and spike inserts one pronounced peak. points is capped at 24 so 100 complete series remain inside the public response budget.

/points creates flat ingestion fixtures for one caller-supplied series key. Point timestamps advance from start by exactly interval × recordIndex, so list order and identity stay stable when count grows. Missing-quality points deliberately return value=null; all other points carry a value within the chosen metric's range. Data is synthetic and is not sampled from a host, sensor or customer.

Use it for

  • Populate line charts with bounded rising, falling, stable or spiking series
  • Test metric-ingestion pipelines with exact sequential timestamps
  • Exercise missing-value and estimated-quality states without production telemetry

Frequently asked questions

Are timestamps evenly spaced?

Yes. Adjacent points are separated by exactly the selected 1m, 5m or 1h interval.

Do rising and falling trends remain monotonic?

Yes. Rising values never decrease and falling values never increase after response precision is applied.

How are missing points represented?

A point with quality missing has value=null; good and estimated points always contain a bounded numeric value.

Does this endpoint expose real monitoring data?

No. Series ids, values, tags and timestamps are generated mock fixtures and are not read from infrastructure or sensors.