ChartnautDocs

Describe one library script, with its interface and dependencies. No source

GET/library/{author}/{slug}
Base URL
https://api.chartnaut.com/v1
Auth
Bearer key
Operation ID
getLibraryScript

author is a username, chartnaut for built-ins, or me for the caller's own. Someone else's script is found when it is public, or unlisted and added to the caller's library. It runs (POST /runs) only once it is in the caller's library (installed: true). Other people's studies are never found. Describes the latest saved version, or version N with slug@N. Never returns files or code, whatever the script's show-source setting in the app.

Path parameters#

authorstringRequired

A username, chartnaut or me, in any letter case.

Example chartnaut
slugstringRequired

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

Example rsi@6

Query parameters#

kindstring · ScriptKind

Required when one of the caller's studies shares the slug with an indicator or definition.

One of indicator definition study

Responses#

200OKapplication/json

The script at the version asked for.

Includes LibraryScript

refstring · ScriptRefRequired

Bare slug for the caller's own, chartnaut/slug for built-ins, author/slug for others. Usable as script in POST /runs.

Examples vwap-reclaim vwap-reclaim@3 jane/orb-breakout@7 chartnaut/rsi
kindstring · ScriptKindRequired
One of indicator definition study
slugstringRequired
namestringRequired
descriptionstringRequired

Plain text; a rich-text description is converted. "" when empty.

authorstringRequired

The author's username in lowercase, or chartnaut for built-ins.

officialbooleanRequired

True for Chartnaut's built-ins.

ownedbooleanRequired

True when the caller wrote it.

installedbooleanRequired

True when it is someone else's script the caller added to their library.

visibilitystringRequired

Built-ins are public.

One of private unlisted public
latest_versionintegerRequired

0 when no version has been saved.

adoptionsintegerRequiredNullable

Install count. null for studies.

tagsarray of stringRequired
categorystringRequired
created_atstring (date-time)Required
updated_atstring (date-time)Required
app_urlstring (uri)Required
interfaceobject · ScriptInterfaceRequired

On GET /library only with include=interface.

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
versionintegerRequired

The version this response describes. 0 when none has been saved.

dependenciesarray of object · PinnedDependencyRequired
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
400Bad requestapplication/json

invalid_request: the slug or version in the path, or kind, is not valid.

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
404Not foundapplication/json

not_found: no script by that author and slug the caller can see, or no version N.

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
409Conflictapplication/json

conflict: a study shares the slug. Pass kind.

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
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