ChartnautDocs

Lint and resolve a script without saving or running it

POST/scripts/validate
Base URL
https://api.chartnaut.com/v1
Auth
Bearer key
Operation ID
validateScript

Returns diagnostics, the derived settings and outputs, and the dependency versions it would pin. Free (no compute units).

Request bodyapplication/json#

object · ScriptSource
kindstring · ScriptKindRequired
One of indicator definition study
filesarray of object · ScriptFileRequired
At least 1 items
Show item fields
pathstringRequired
Example main.ts
codestringRequired
entryboolean

Exactly one file is the entry. Indicators have one file, always the entry.

Responses#

200OKapplication/json

Validation result. ok:false is still a 200; the request itself succeeded.

okboolean
diagnosticsarray of object · Diagnostic
Show item fields
severitystringRequired
One of error warning
codestring
Example link.unresolved_import
messagestringRequired
pathstring
lineinteger
settingstring

The setting a finding is about, if any.

interfaceobject · ScriptInterface

What a caller needs to run the script and read its results. Derived from the code.

Show fields
settingsmap of object · SettingDef
Show value fields
typestring

An indicator's settings take their type, bounds and options from its settings dialog.

One of number string boolean color select multi_select timeframe range array
defaultany
minnumber
maxnumber
stepnumber
optionsarray of any

Choices for a select. From an indicator's settings dialog each is {label, value}.

outputsarray of object · OutputDef

Indicator only.

Show item fields
idstring
namestring
kindstring

The output's declared kind (line, area, baseline, histogram, fill, markers, labels, hline, range, …).

panestring
One of price own
eventsarray of object · EventDef

Definition only. The events it can emit.

Show item fields
idstring
Example reclaim_long
intentstring
payload_keysarray of string
resultsarray of object

Study only. The result blocks it produces.

Show item fields
keystring
kindstring · StudyResultKind
One of metric series distribution boxplot heatmap scatter bar table vega annotation prose popover_layout
titlestring
timeframesarray of string · Timeframe

Extra timeframes the script reads besides the run's own.

warmup_barsinteger
dependenciesarray of object · PinnedDependency

The versions a save would pin now.

Show item fields
refstring · ScriptRef

slug or slug@N for your own scripts; author/slug or author/slug@N for library scripts; chartnaut/slug for built-ins (which always run their latest version).

Examples vwap-reclaim vwap-reclaim@3 jane/orb-breakout@7 chartnaut/rsi
asstring

The alias the script uses.

versioninteger
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