Account
List exchange accounts
Lists the exchange accounts the API key’s owner connected to TakeProfit,
with their accountIds, titles and connectors. Use accountId and
connectorCode from here in every other request.
- Deleted connections are listed too (
isDeleted), so that past orders can be resolved; they cannot trade. - While one of the accounts is being moved between TakeProfit data centres
the request fails with 503
unavailable: retry with backoff rather than act on a partial list.
GET
/
api
/
v1
/
trading
/
account
/
list
List exchange accounts
curl --request GET \
--url https://public-api.charting.com/api/v1/trading/account/list \
--header 'X-API-KEY: <api-key>' \
--header 'X-API-SIGNATURE: <api-key>' \
--header 'X-API-TIMESTAMP: <api-key>'import requests
url = "https://public-api.charting.com/api/v1/trading/account/list"
headers = {
"X-API-KEY": "<api-key>",
"X-API-TIMESTAMP": "<api-key>",
"X-API-SIGNATURE": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-API-KEY': '<api-key>',
'X-API-TIMESTAMP': '<api-key>',
'X-API-SIGNATURE': '<api-key>'
}
};
fetch('https://public-api.charting.com/api/v1/trading/account/list', 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.charting.com/api/v1/trading/account/list",
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>",
"X-API-SIGNATURE: <api-key>",
"X-API-TIMESTAMP: <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.charting.com/api/v1/trading/account/list"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("X-API-TIMESTAMP", "<api-key>")
req.Header.Add("X-API-SIGNATURE", "<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.charting.com/api/v1/trading/account/list")
.header("X-API-KEY", "<api-key>")
.header("X-API-TIMESTAMP", "<api-key>")
.header("X-API-SIGNATURE", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.charting.com/api/v1/trading/account/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
request["X-API-TIMESTAMP"] = '<api-key>'
request["X-API-SIGNATURE"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"accounts": [
{
"accountId": "4b8e2f6a-91c3-4d57-a0e8-3f1c7b9d2e45",
"title": "Main Binance",
"connectorCodes": [
"binance_spot",
"binance_usdm"
],
"exchanges": [
"CXBNCE"
],
"markets": [
{
"marketType": "spot"
},
{
"marketType": "perpetual",
"contractType": "linear"
}
],
"status": "active",
"isDeleted": false,
"apiKeySuffix": "7Qx2",
"isDemo": false,
"isFastConnect": false
}
]
}{
"error": {
"code": "unauthenticated",
"message": "invalid API key or signature"
}
}{
"error": {
"code": "permission_denied",
"message": "permission denied"
}
}{
"error": {
"code": "rate_limited",
"message": "rate limit exceeded"
}
}Authorizations
Was this page helpful?
⌘I
List exchange accounts
curl --request GET \
--url https://public-api.charting.com/api/v1/trading/account/list \
--header 'X-API-KEY: <api-key>' \
--header 'X-API-SIGNATURE: <api-key>' \
--header 'X-API-TIMESTAMP: <api-key>'import requests
url = "https://public-api.charting.com/api/v1/trading/account/list"
headers = {
"X-API-KEY": "<api-key>",
"X-API-TIMESTAMP": "<api-key>",
"X-API-SIGNATURE": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-API-KEY': '<api-key>',
'X-API-TIMESTAMP': '<api-key>',
'X-API-SIGNATURE': '<api-key>'
}
};
fetch('https://public-api.charting.com/api/v1/trading/account/list', 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.charting.com/api/v1/trading/account/list",
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>",
"X-API-SIGNATURE: <api-key>",
"X-API-TIMESTAMP: <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.charting.com/api/v1/trading/account/list"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("X-API-TIMESTAMP", "<api-key>")
req.Header.Add("X-API-SIGNATURE", "<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.charting.com/api/v1/trading/account/list")
.header("X-API-KEY", "<api-key>")
.header("X-API-TIMESTAMP", "<api-key>")
.header("X-API-SIGNATURE", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.charting.com/api/v1/trading/account/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
request["X-API-TIMESTAMP"] = '<api-key>'
request["X-API-SIGNATURE"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"accounts": [
{
"accountId": "4b8e2f6a-91c3-4d57-a0e8-3f1c7b9d2e45",
"title": "Main Binance",
"connectorCodes": [
"binance_spot",
"binance_usdm"
],
"exchanges": [
"CXBNCE"
],
"markets": [
{
"marketType": "spot"
},
{
"marketType": "perpetual",
"contractType": "linear"
}
],
"status": "active",
"isDeleted": false,
"apiKeySuffix": "7Qx2",
"isDemo": false,
"isFastConnect": false
}
]
}{
"error": {
"code": "unauthenticated",
"message": "invalid API key or signature"
}
}{
"error": {
"code": "permission_denied",
"message": "permission denied"
}
}{
"error": {
"code": "rate_limited",
"message": "rate limit exceeded"
}
}