GetRobotList
Gets the robots of the account, optionally filtered by status, label, name, group or strategy; all arguments can be omitted.
Examples
Get all robots, filter by label, and pass arguments by position or by name.
python
# api() is the function in the Python example on the signature authentication page
r = api('GetRobotList') # all robots
# a single string is taken as the label: all robots labeled member2
r = api('GetRobotList', 'member2')
# positional: up to 100 robots labeled member2, starting at offset 0
r = api('GetRobotList', 0, 100, -1, 'member2', '')
r = api('GetRobotList', appId='member2', length=100) # by name, same as above
for robot in r['data']['result']['robots']:
print(robot['id'], robot['name'], robot['status'])Returns
| Type | Description |
object | On success |
Arguments
| Name | Type | Required | Description |
offset | number | No | Paging offset, 0 by default. |
length | number | No | Page size; less than or equal to 0 returns all (default). |
customStatus | number | No | Filter by robot status code, see |
appId | string | No | Filter by the robot's custom label ( |
kw | string | No | Keyword matched fuzzily against robot names; an empty string means no filter. |
groupId | number | No | Robot group: |
orderBy | string | No | Sort field: |
strategyId | number | No | When greater than 0, only robots of this strategy are returned; 0 (no filter) by default. |
Attributes
| Name | Type | Description |
all | number | Total number of matching robots. |
robots | array | Array of robots. |
robots[].id | number | Robot ID. |
robots[].status | number | Robot status code, see |
robots[].group_id | number | Robot group ID; robots in the default group have no such field. |
Remarks
Example response
json
{
"code": 0,
"data": {
"result": {
"all": 1,
"concurrent": 0,
"robots": [{
"charge_time": 1731654846,
"date": "2024-11-12 14:05:29",
"end_time": "2024-11-15 14:56:32",
"fixed_id": 4509153,
"id": 591026,
"is_sandbox": 0,
"name": "test",
"node_guid": "45891bcf3d57f99b08a43dff76ee1ea1",
"node_id": 4519153,
"node_public": 0,
"profit": 0,
"public": 0,
"refresh": 1731651257000,
"start_time": "2024-11-15 14:56:30",
"status": 3,
"strategy_id": 411670,
"strategy_isowner": true,
"strategy_language": 0,
"strategy_name": "test",
"strategy_public": 0,
"uid": "105ed6e511cc977921610fdbb7e2a1d6",
"wd": 0
}]
},
"error": null
}
}