REST endpoints
Compute indicator values
Provide exchange, symbol, and timeframe. Nothing else is required:
the indicator runs with its default parameters over the last 1000 bars.
- With
fromthe window starts there and runs forward, ending atto, afterperiodseconds, or afterlimitbars (1000 by default). - Without
fromthe window ends atto(now by default) and runs backwards overlimitbars (1000 by default) orperiodseconds. periodandlimitcannot be used together, and neither can be added to an explicitfrom+towindow.- A time window is limited to at most 10000 estimated bars; a wider one
is rejected with 400
too_much_data. The estimate assumes the market trades around the clock, so on a security with trading sessions uselimitfor a long stretch of history. - At most the 10000 most recent bars are computed. A window that starts
before them is answered from what was computed, with
historyComplete: false. - Tick timeframes (
1t,50t, …) accept onlylimit: tick bars have no fixed duration, sofrom,toandperiodare rejected with 400. - Pass indicator parameters as
param.<id>; see/api/v1/indicators/{uid}for the ids, types and ranges. Unknown ids and out-of-range values are rejected with 400. outputsrestricts the returned outputs to the listed ids.
Cost: 2000 credits for a window of up to 5000 bars, 4000 up to 10000 bars, or 2 credits per returned bar if that is more.
GET
/
api
/
v1
/
indicators
/
{uid}
/
values
Compute indicator values
curl --request GET \
--url https://public-api.takeprofit.com/api/v1/indicators/{uid}/values \
--header 'x-api-key: <api-key>'import requests
url = "https://public-api.takeprofit.com/api/v1/indicators/{uid}/values"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://public-api.takeprofit.com/api/v1/indicators/{uid}/values', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public-api.takeprofit.com/api/v1/indicators/{uid}/values",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://public-api.takeprofit.com/api/v1/indicators/{uid}/values"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://public-api.takeprofit.com/api/v1/indicators/{uid}/values")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.takeprofit.com/api/v1/indicators/{uid}/values")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"meta": {
"uid": "line_0",
"slug": "simple_moving_average",
"version": 9,
"exchange": "CXBNCE",
"symbol": "BTC/USDT",
"timeframe": "5m",
"params": {
"length": 9,
"src": "close",
"offset": 0
},
"outputs": [
"line_0"
]
},
"bars": [
{
"timestamp": "2026-10-06T09:55:00Z",
"closed": true,
"values": {
"line_0": 123456.78
}
},
{
"timestamp": "2026-10-06T10:00:00Z",
"closed": false,
"values": {
"line_0": 123470.12
}
}
],
"hasMoreBefore": true,
"historyComplete": false
}{
"error": {
"code": "invalid_argument",
"message": "parameter \"param.length\" must be an integer between 1 and 5000"
}
}{
"error": {
"code": "unauthenticated",
"message": "invalid API key"
}
}{
"error": {
"code": "permission_denied",
"message": "permission denied"
}
}{
"error": {
"code": "not_found",
"message": "indicator not found"
}
}{
"error": {
"code": "script_error",
"message": "indicator script failed"
}
}{
"error": {
"code": "rate_limited",
"message": "quota exceeded"
}
}Path Parameters
Query Parameters
Response
Computed bars.
True when the window lies within the computed history: a computed bar precedes it, or the computed history holds everything the exchange has. False means the window starts before the oldest computed bar and the computed history is full: only the most recent 10000 bars are computed, so the window was cut there. Always true for a last-N window.
Was this page helpful?
⌘I
Compute indicator values
curl --request GET \
--url https://public-api.takeprofit.com/api/v1/indicators/{uid}/values \
--header 'x-api-key: <api-key>'import requests
url = "https://public-api.takeprofit.com/api/v1/indicators/{uid}/values"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://public-api.takeprofit.com/api/v1/indicators/{uid}/values', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public-api.takeprofit.com/api/v1/indicators/{uid}/values",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://public-api.takeprofit.com/api/v1/indicators/{uid}/values"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://public-api.takeprofit.com/api/v1/indicators/{uid}/values")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.takeprofit.com/api/v1/indicators/{uid}/values")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"meta": {
"uid": "line_0",
"slug": "simple_moving_average",
"version": 9,
"exchange": "CXBNCE",
"symbol": "BTC/USDT",
"timeframe": "5m",
"params": {
"length": 9,
"src": "close",
"offset": 0
},
"outputs": [
"line_0"
]
},
"bars": [
{
"timestamp": "2026-10-06T09:55:00Z",
"closed": true,
"values": {
"line_0": 123456.78
}
},
{
"timestamp": "2026-10-06T10:00:00Z",
"closed": false,
"values": {
"line_0": 123470.12
}
}
],
"hasMoreBefore": true,
"historyComplete": false
}{
"error": {
"code": "invalid_argument",
"message": "parameter \"param.length\" must be an integer between 1 and 5000"
}
}{
"error": {
"code": "unauthenticated",
"message": "invalid API key"
}
}{
"error": {
"code": "permission_denied",
"message": "permission denied"
}
}{
"error": {
"code": "not_found",
"message": "indicator not found"
}
}{
"error": {
"code": "script_error",
"message": "indicator script failed"
}
}{
"error": {
"code": "rate_limited",
"message": "quota exceeded"
}
}