ChartnautDocs

Run a definition over history

POST/scripts/{slug}/collect
Base URL
https://api.chartnaut.com/v1
Auth
Bearer key
Operation ID
collectDefinition

Only the part of the window not already collected runs. Uses the plan's research gate and Events budget, like collecting in the app. Needs runs:write. Studies run through the API collect what they declare automatically.

Path parameters#

slugstringRequired

Your script's slug, optionally pinned as slug@N.

Pattern ^[a-z0-9][a-z0-9-]{1,62}(@[0-9]+)?$Example vwap-reclaim@3

Request bodyapplication/json#

object
instrumentstringRequired
timeframestring · TimeframeRequired
One of 1m 5m 15m 30m 1h 2h 4h 1d 1w 1mo
windowobject · WindowRequired

Exactly one of {from,to}, last or bars. Warmup is fetched before the window automatically and never counted in results. Clamped to the plan's historical depth.

Show fields
fromstring (date-time)
tostring (date-time)

Defaults to now.

laststring
Pattern ^[0-9]+[dwmy]$Example 90d
barsinteger
At least 1Example 2000
versioninteger

Default latest.

Responses#

200OKapplication/json

The window was already collected (covered: true).

object
202Acceptedapplication/json

Collection queued; poll the events summary.

object
ErrorAny other statusapplication/json

Error.

object · Error
errorobjectRequired
Show fields
codestringRequired

Stable. Branch on this, never on message.

One of unauthorized forbidden_scope plan_limit not_found version_conflict script_invalid in_use out_of_coverage unknown_instrument ambiguous_instrument unsupported_timeframe run_not_finished rate_limited busy invalid_request forbidden conflict not_in_library confirmation_required not_shared not_installable not_implemented authorization_pending slow_down access_denied expired_token internal
messagestringRequired
detailsobject
docs_urlstring (uri)
request_idstring