Describe one library script, with its interface and dependencies. No source
/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#
authorstringRequiredA username, chartnaut or me, in any letter case.
slugstringRequiredThe script's slug, optionally pinned as slug@N.
Query parameters#
kindstring · ScriptKindRequired when one of the caller's studies shares the slug with an indicator or definition.
Responses#
200OKapplication/json
The script at the version asked for.
Includes LibraryScript
Bare slug for the caller's own, chartnaut/slug for built-ins, author/slug for others. Usable as script in POST /runs.
slugstringRequirednamestringRequireddescriptionstringRequiredPlain text; a rich-text description is converted. "" when empty.
authorstringRequiredThe author's username in lowercase, or chartnaut for built-ins.
officialbooleanRequiredTrue for Chartnaut's built-ins.
ownedbooleanRequiredTrue when the caller wrote it.
installedbooleanRequiredTrue when it is someone else's script the caller added to their library.
visibilitystringRequiredBuilt-ins are public.
latest_versionintegerRequired0 when no version has been saved.
adoptionsintegerRequiredNullableInstall count. null for studies.
tagsarray of stringRequiredcategorystringRequiredcreated_atstring (date-time)Requiredupdated_atstring (date-time)Requiredapp_urlstring (uri)RequiredOn GET /library only with include=interface.
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_barsintegerversionintegerRequiredThe version this response describes. 0 when none has been saved.
Show 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.
versioninteger400Bad requestapplication/json
invalid_request: the slug or version in the path, or kind, is not valid.
errorobjectRequiredShow fields
codestringRequiredStable. Branch on this, never on message.
messagestringRequireddetailsobjectdocs_urlstring (uri)request_idstring404Not foundapplication/json
not_found: no script by that author and slug the caller can see, or no version N.
errorobjectRequiredShow fields
codestringRequiredStable. Branch on this, never on message.
messagestringRequireddetailsobjectdocs_urlstring (uri)request_idstring409Conflictapplication/json
conflict: a study shares the slug. Pass kind.
errorobjectRequiredShow fields
codestringRequiredStable. Branch on this, never on message.
messagestringRequireddetailsobjectdocs_urlstring (uri)request_idstringErrorAny other statusapplication/json
Error.
errorobjectRequiredShow fields
codestringRequiredStable. Branch on this, never on message.
messagestringRequireddetailsobjectdocs_urlstring (uri)request_idstring