Skip to main content

Market, Chart, and Strategy Data

The Market, Chart, and Strategy Data endpoints provide access to market data collected by Gunbot for active trading pairs. These endpoints allow you to retrieve historical market candles, order book details and data from core memory snapshots.

Endpoints in this category provide market data already collected by Gunbot for active trading pairs.

/api/v1/market/candles​

  • Method: GET
  • Description: Retrieve historical candle data in OHLCV format for a specific trading pair.

Parameters​

ParameterTypeRequiredDescription
keystringYesThe unique identifier for the trading pair, URL-encoded (e.g., binance/USDT-XRP becomes binance%2FUSDT-XRP).

Examples​

cURL​

curl -X GET "https://your-gunbot-instance.com:3000/api/v1/market/candles?key=binance%2FUSDT-PEPE" \
-H "Authorization: Bearer YOUR_TOKEN"

JavaScript (fetch API)​

const params = new URLSearchParams({
key: 'binance/USDT-PEPE',
});
fetch(`https://your-gunbot-instance.com:3000/api/v1/market/candles?${params.toString()}`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
},
})
.then(response => response.json())
.then(data => console.log(data));

Python (requests library)​

import requests
url = 'https://your-gunbot-instance.com:3000/api/v1/market/candles'
params = {
'key': 'binance/USDT-PEPE',
}
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
}
response = requests.get(url, params=params, headers=headers)
data = response.json()
print(data)

Response​

{
"data": {
"close": [
// Array of close prices (truncated for brevity)
],
"high": [
// Array of high prices (truncated for brevity)
],
"low": [
// Array of low prices (truncated for brevity)
],
"volume": [
// Array of volumes (truncated for brevity)
],
"open": [
// Array of open prices (truncated for brevity)
]
}
}

/api/v1/market/orderbook​

  • Method: GET
  • Description: Retrieve the current order book data (bids and asks) for a specific trading pair.

Parameters​

ParameterTypeRequiredDescription
keystringYesThe unique identifier for the trading pair, URL-encoded (e.g., binance/USDT-XRP becomes binance%2FUSDT-XRP).

Examples​

cURL​

curl -X GET "https://your-gunbot-instance.com:3000/api/v1/market/orderbook?key=binance%2FUSDT-PEPE" \
-H "Authorization: Bearer YOUR_TOKEN"

JavaScript (fetch API)​

const params = new URLSearchParams({
key: 'binance/USDT-PEPE',
});
fetch(`https://your-gunbot-instance.com:3000/api/v1/market/orderbook?${params.toString()}`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
},
})
.then(response => response.json())
.then(data => console.log(data));

Python (requests library)​

import requests
url = 'https://your-gunbot-instance.com:3000/api/v1/market/orderbook'
params = {
'key': 'binance/USDT-PEPE',
}
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
}
response = requests.get(url, params=params, headers=headers)
data = response.json()
print(data)

Response​

{
"data": {
"ask": [
// Array of ask orders (truncated for brevity)
],
"bid": [
// Array of bid orders (truncated for brevity)
]
}
}

/api/v1/coremem/raw​

  • Method: POST
  • Description: Retrieves raw core memory data for a specific trading pair. Allows filtering to include only specific elements or returns all core memory data for the pair if no elements are specified.

Parameters​

NameTypeRequiredDescription
exchangestringYesThe exchange to query (e.g., binance).
pairstringYesThe trading pair to query (e.g., BTC-ADA).
elementsarrayNoOptional array of elements to filter the response (e.g., ['ABP', 'Bid']). If omitted, returns all core memory data.

Examples​

cURL​

curl -X POST "https://your-gunbot-instance.com:3000/api/v1/coremem/raw" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"exchange": "binance",
"pair": "BTC-ADA",
"elements": ["ABP", "Bid"]
}'

JavaScript (fetch API)​

const body = {
exchange: 'binance',
pair: 'BTC-ADA',
elements: ['ABP', 'Bid'] // Optional
};

fetch('https://your-gunbot-instance.com:3000/api/v1/coremem/raw', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify(body)
})
.then(response => response.json())
.then(data => console.log(data));

Python (requests library)​

import requests

data = {
'exchange': 'binance',
'pair': 'BTC-ADA',
'elements': ['ABP', 'Bid'] # Optional
}

headers = {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
}

response = requests.post('https://your-gunbot-instance.com:3000/api/v1/coremem/raw', json=data, headers=headers)
print(response.json())

Response​

When specific elements are requested:

{
"ABP": 0.000012009454969475356,
"Bid": 0.00001137
}

When no elements are specified, the response includes all core memory data for the specified trading pair:

{
"ABP": 0.000012009454969475356,
"Bid": 0.00001137,
"...": "All other core memory key-value pairs for the trading pair"
}

/api/v1/coremem​

  • Method: POST
  • Description: Retrieve a snapshot of relevant core memory data for all active trading pairs. Data is slightly delayed and sometimes transformed, for example from number to string, intended for frontend usage.

Parameters None​

Examples​

cURL​

curl -X POST "https://your-gunbot-instance.com:3000/api/v1/coremem" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"

JavaScript (fetch API)​

fetch('https://your-gunbot-instance.com:3000/api/v1/coremem', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
})
.then(response => response.json())
.then(data => console.log(data));

Python (requests library)​

import requests
url = 'https://your-gunbot-instance.com:3000/api/v1/coremem'
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers)
data = response.json()
print(data)

Response​

{
// Core memory data for all active symbols (truncated for brevity)
}

/api/v1/coremem/single​

  • Method: POST
  • Description: Retrieve a snapshot of relevant core memory data for a single active trading pair. Data is slightly delayed and sometimes transformed, for example from number to string, intended for frontend usage.

Parameters​

ParameterTypeRequiredDescription
exchangestringYesThe exchange name (e.g., binance).
pairstringYesThe trading pair (e.g., USDT-XRP).

Examples​

cURL​

curl -X POST "https://your-gunbot-instance.com:3000/api/v1/coremem/single" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"exchange": "binance",
"pair": "USDT-XRP"
}'

JavaScript (fetch API)​

const data = {
exchange: 'binance',
pair: 'USDT-XRP',
};
fetch('https://your-gunbot-instance.com:3000/api/v1/coremem/single', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
})
.then(response => response.json())
.then(data => console.log(data));

Python (requests library)​

import requests
url = 'https://your-gunbot-instance.com:3000/api/v1/coremem/single'
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
}
data = {
'exchange': 'binance',
'pair': 'USDT-XRP',
}
response = requests.post(url, headers=headers, json=data)
data = response.json()
print(data)

Response​

{
// Core memory data for the specified symbol (truncated for brevity)
}

/api/v1/chart/data​

  • Method: POST
  • Description: Retrieve chart data, including candles and indicators, for a specific trading pair.

Parameters​

ParameterTypeRequiredDescription
exchangestringYesThe exchange name (e.g., binance).
pairstringYesThe trading pair (e.g., USDT-XRP).

Examples​

cURL​

curl -X POST "https://your-gunbot-instance.com:3000/api/v1/chart/data" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"exchange": "binance",
"pair": "USDT-XRP"
}'

JavaScript (fetch API)​

const data = {
exchange: 'binance',
pair: 'USDT-XRP',
};
fetch('https://your-gunbot-instance.com:3000/api/v1/chart/data', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
})
.then(response => response.json())
.then(data => console.log(data));

Python (requests library)​

import requests
url = 'https://your-gunbot-instance.com:3000/api/v1/chart/data'
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
}
data = {
'exchange': 'binance',
'pair': 'USDT-XRP',
}
response = requests.post(url, headers=headers, json=data)
data = response.json()
print(data)

Response​

{
// Chart data with candle and indicator arrays
}

/api/v1/chart/marks​

  • Method: GET
  • Description: Retrieve chart timescale marks (annotations) such as buy/sell trigger info for a specific trading pair and time interval.

Parameters​

ParameterTypeRequiredDescription
exchangestringYesThe exchange name (e.g., binance).
pairstringYesThe trading pair (e.g., USDT-XRP).
intervalstringYesThe time interval in minutes (e.g., 15).
startTimestringYesThe start time in UNIX timestamp seconds (e.g., 0).
endTimestringYesThe end time in UNIX timestamp seconds (e.g., 2114377200).

Examples​

cURL​

curl -X GET "https://your-gunbot-instance.com:3000/api/v1/chart/marks?exchange=binance&pair=USDT-XRP&interval=15&startTime=0&endTime=2114377200" \
-H "Authorization: Bearer YOUR_TOKEN"

JavaScript (fetch API)​

const params = new URLSearchParams({
exchange: 'binance',
pair: 'USDT-XRP',
interval: '15',
startTime: '0',
endTime: '2114377200',
});
fetch(`https://your-gunbot-instance.com:3000/api/v1/chart/marks?${params.toString()}`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
},
})
.then(response => response.json())
.then(data => console.log(data));

Python (requests library)​

import requests
url = 'https://your-gunbot-instance.com:3000/api/v1/chart/marks'
params = {
'exchange': 'binance',
'pair': 'USDT-XRP',
'interval': '15',
'startTime': '0',
'endTime': '2114377200',
}
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
}
response = requests.get(url, params=params, headers=headers)
data = response.json()
print(data)

Response​

[
{
"exchange": "binance",
"pair": "USDT-PEPE",
"id": "3313",
"time": 1733391240,
"color": "rgba(38, 166, 154, 0.8)",
"label": "â–²",
"tooltip": [
"",
"🟩 1733391279657 convert",
"Buy 9083536.00028041 PEPE",
"@ 0.00002162 USDT",
"Total: 196.386 USDT"
]
},
{
"exchange": "binance",
"pair": "USDT-PEPE",
"id": "3314",
"time": 1733391300,
"color": "rgba(38, 166, 154, 0.8)",
"label": "â–²",
"tooltip": [
"",
"🟦 1733391324904 convert",
"Buy step skipped 0.00002157: order blocked by trend module"
]
},
// Additional entries (truncated for brevity)
]