Market, Chart, and Strategy Data
These endpoints provide market data collected by Gunbot for active trading pairs. Use them to retrieve historical candles, order book data, and core memory snapshots.
Info
OHLCV (Open, High, Low, Close, Volume) data represents price movement over a specific period. An order book lists buy and sell orders organized by price level.
Get Historical Candles (OHLCV)
- Method:
GET - Endpoint:
/api/v1/market/candles - Description: Retrieve historical candle data in OHLCV format for a specific trading pair.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | The 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)
]
}
}
Get Order Book Data
- Method:
GET - Endpoint:
/api/v1/market/orderbook - Description: Retrieve the current order book data (bids and asks) for a specific trading pair.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | The 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)
]
}
}
Get Raw Core Memory Data for Pair
- Method:
POST - Endpoint:
/api/v1/coremem/raw - 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
| Name | Type | Required | Description |
|---|---|---|---|
exchange | string | Yes | The exchange to query (e.g., binance). |
pair | string | Yes | The trading pair to query (e.g., BTC-ADA). |
elements | array | No | Optional 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"
}
Get Core Memory Snapshot (All Pairs)
- Method:
POST - Endpoint:
/api/v1/coremem - Description: Retrieve a snapshot of relevant core memory data for all active trading pairs. Data is slightly delayed and sometimes transformed (e.g., from number to string), intended for frontend usage.
Parameters
This endpoint does not require any parameters.
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)
}
Get Core Memory Snapshot (Single Pair)
- Method:
POST - Endpoint:
/api/v1/coremem/single - Description: Retrieve a snapshot of relevant core memory data for a single active trading pair. Data is slightly delayed and sometimes transformed (e.g., from number to string), intended for frontend usage.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
exchange | string | Yes | The exchange name (e.g., binance). |
pair | string | Yes | The 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)
}
Get Chart Data (Candles and Indicators)
- Method:
POST - Endpoint:
/api/v1/chart/data - Description: Retrieve chart data, including candles and indicators, for a specific trading pair.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
exchange | string | Yes | The exchange name (e.g., binance). |
pair | string | Yes | The 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
}
Get Chart Timescale Marks (Annotations)
- Method:
GET - Endpoint:
/api/v1/chart/marks - Description: Retrieve chart timescale marks (annotations), such as buy/sell trigger info, for a specific trading pair and time interval.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
exchange | string | Yes | The exchange name (e.g., binance). |
pair | string | Yes | The trading pair (e.g., USDT-XRP). |
interval | string | Yes | The time interval in minutes (e.g., 15). |
startTime | string | Yes | The start time in UNIX timestamp seconds (e.g., 0). |
endTime | string | Yes | The 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)
]