GetRobotDetail
Gets the details of one robot of the account, including its status, billing, exchange configuration and strategy arguments.
Examples
Query the status and exchange configuration of robot 123.
python
# api() is the function in the Python example on the signature authentication page
r = api('GetRobotDetail', 123)
robot = r['data']['result']['robot']
print(robot['status'], robot['pexchanges'], robot['strategy_exchange_pairs'])Returns
| Type | Description |
object | On success |
Arguments
| Name | Type | Required | Description |
robotId | number | Yes | Robot ID; see |
Attributes
| Name | Type | Description |
robot.status | number | Robot status code, see |
string | Robot name. | |
robot.date | string | Creation date. |
robot.charge_time | number | Next billing time (Unix timestamp in seconds), i.e. the end of the period already paid for. |
robot.charged | number | Total billed running time in seconds. |
robot.consumed | number | Total amount charged, in USD, as an integer scaled by 1e8; 5375000000 in the example is 53.75 USD. |
robot.node_id | number | Docker ID. |
robot.fixed_id | number | Docker ID set in the robot configuration; |
robot.is_manager | bool | Whether you may manage the robot. |
robot.is_sandbox | number | Whether it is a demo (sandbox) robot. |
robot.pexchanges | object | Exchange objects of the robot: keys are |
robot.plabels | object | Labels of the robot's exchange objects, keyed by |
robot.strategy_exchange_pairs | string | Default K-line period, exchange objects and trading pairs (JSON text); format in the remarks. |
robot.profit | number | Robot profit. |
robot.public | number | Whether the robot is public. |
robot.refresh | number | Last active time (millisecond timestamp). |
robot.wd | number | Whether the offline alert is on. |
Remarks
strategy_exchange_pairs is the text of a JSON array, e.g. "[60,[44314,42960,15445,14703],[\"BTC_USDT\",\"BTC_USDT\",\"ETH_USDT\",\"ETH_USDT\"]]":
60: the default K-line period of the robot in seconds (1 minute here).[44314,42960,15445,14703]: thepidof the robot's exchange objects, in the order they were added.["BTC_USDT","BTC_USDT","ETH_USDT","ETH_USDT"]: the trading pair of each exchange object, matching thepidlist in order.
Example response
json
{
"code": 0,
"data": {
"result": {
"robot": {
"charge_time": 1732246539,
"charged": 5850000,
"consumed": 5375000000,
"date": "2018-12-28 14:34:51",
"favorite": {
"added": false,
"type": "R"
},
"fixed_id": 123,
"hits": 1,
"id": 123,
"is_deleted": 0,
"is_manager": true,
"is_sandbox": 0,
"name": "test",
"node_id": 123,
"pexchanges": {
"123": "Futures_OKX"
},
"phash": {
"123": "ca1aca74b9cf7d8624f2af2dac01e36d"
},
"plabels": {
"123": "OKX futures"
},
"priority": 0,
"profit": 0,
"public": 0,
"refresh": 1732244453000,
"robot_args": "[]",
"start_time": "2024-11-22 11:00:48",
"status": 1,
"strategy_args": "[]",
"strategy_exchange_pairs": "[60,[123],[\"ETH_USDT\"]]",
"strategy_id": 123,
"strategy_last_modified": "2024-11-21 16:49:25",
"strategy_name": "test",
"strategy_public": "0",
"uid": "105ed6e51bcc17792a610fdbb7e2a1d6",
"username": "abc",
"wd": 0
}
},
"error": null
}
}