Get a script (latest version, or slug@N)
/scripts/{slug}- Base URL
https://api.chartnaut.com/v1- Auth
- Bearer key
- Operation ID
getScript
Path parameters#
slugstringRequiredYour script's slug, optionally pinned as slug@N.
Query parameters#
includestringComma list. source returns files (own scripts only).
Responses#
200OKapplication/json
The script.
Includes ScriptSummary
idstringThe script's id for the Terminal SDK and partner API: ind_<n> for an indicator, flw_<n> for a definition. Pass it to cn.scripts.publish({ script }) or chart.scripts.add. Absent for a study.
slugstringkindstring · ScriptKindnamestringdescriptionstringvisibilitystring · VisibilityStudies are always private; setting visibility on a study is refused with 400.
latest_versionintegerupdated_atstring (date-time)app_urlstring (uri)Opens this script in the Chartnaut app.
versionintegerThe version this response describes.
interfaceobject · ScriptInterfaceWhat a caller needs to run the script and read its results. Derived from the code.
Show fields
settingsmap of object · SettingDefShow value fields
typestringAn indicator's settings take their type, bounds and options from its settings dialog.
defaultanyminnumbermaxnumberstepnumberoptionsarray of anyChoices for a select. From an indicator's settings dialog each is {label, value}.
outputsarray of object · OutputDefIndicator only.
Show item fields
idstringnamestringkindstringThe output's declared kind (line, area, baseline, histogram, fill, markers, labels, hline, range, …).
panestringeventsarray of object · EventDefDefinition only. The events it can emit.
Show item fields
idstringintentstringpayload_keysarray of stringresultsarray of objectStudy only. The result blocks it produces.
Show item fields
timeframesarray of string · TimeframeExtra timeframes the script reads besides the run's own.
warmup_barsintegerdependenciesarray of object · PinnedDependencyShow item fields
refstring · ScriptRefslug 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).
asstringThe alias the script uses.
versionintegerfilesarray of object · ScriptFilePresent with include=source on your own scripts.
Show item fields
pathstringRequiredcodestringRequiredentrybooleanExactly one file is the entry. Indicators have one file, always the entry.
ErrorAny other statusapplication/json
Error.
errorobjectRequiredShow fields
codestringRequiredStable. Branch on this, never on message.
messagestringRequireddetailsobjectdocs_urlstring (uri)request_idstring