ChartnautDocs

Summarise events

GET/scripts/{slug}/events/summary

Returns a definition's event totals, one row per instrument and timeframe, and any runs over history still going or failed. Call it to see what a definition has covered, and to wait for a run over history to finish.

Scope

Heavy call

Long poll

CLI

scripts:read

No

No

chartnaut events --summary

Guidance

  • After Run a definition over history, poll this every few seconds until collecting is empty, then read List events. It has no wait; the CLI polls every 3 seconds.

  • A row in failed means part of a run over history did not finish. failure_kind says why; run it again for that window once the cause is fixed.

  • Use datasets to pick a window a study can read in full: each row's from and to is the span that instrument and timeframe covers.

  • version counts only what one version found. Without it, totals cover every version.

  • The path is your own definition's bare slug. A study that shares the slug is ignored here.

Path parameters

Name

Type

Description

slug

string

Your definition's slug

Query parameters

Name

Type

Required

Default

Description

version

integer

No

All

Counts only events found by this version

Response

200 with:

Field

Type

Description

definition

string

The definition's slug

events

integer

Events stored in total

days

integer

Days the events span

events_per_day

number

Average events a day

avg_event_duration_seconds

number or null

The average time from an event's start to its end

datasets

array of object

One row per instrument and timeframe. Fields below

collecting

array of object

Runs over history still queued or running. Poll until it is empty. Fields below

failed

array of object

Runs over history that failed. Fields below

datasets object

Field

Type

Description

instrument

string

Canonical symbol

timeframe

string

Timeframe

events

integer

Events stored for this pair

days

integer

Days they span

events_per_day

number

Average events a day

from

string or null

The first event's time

to

string or null

The last event's time

avg_event_duration_seconds

number or null

The average event length

collecting and failed objects

Field

Type

Description

instrument

string

Canonical symbol, or "" when not known

timeframe

string

Timeframe

from

string

Start of the window being run

to

string

End of the window being run

status

string

queued or running in collecting; any other status in failed

failure_kind

string

In failed only: why the run failed

Status codes

Status

Code

Meaning

200

-

The definition's totals

400

invalid_request

The slug is not valid

404

not_found

You have no definition with that slug, or it has no such version