Type/to search
Getting Started
Platform Basics
Writing Strategies
Development Tools
Backtesting System
Advanced Topics
Data and Research
Extended API Interface
AI Integration
Create ApiKey
Authentication Methods
Extended API Interface Details
GetAccount
GetNodeList
DeleteNode
GetExchangeList
GetPlatformList
GetStrategyList
GetRobotGroupList
GetRobotList
GetRobotDetail
GetRobotLogs
NewRobot
RestartRobot
StopRobot
CommandRobot
DeleteRobot
PluginRun
pub
Extended API Interface Return Codes
Live Trading Status Codes

All methods are called through https://www.fmz.com/api/v1; for the request format and signature see Token Authentication, for the response structure and error codes see Extended API Interface Return Codes. The api() used in the examples on the method pages is the function from the Python example on the signature authentication page.

Method overview

ObjectMethodParameters (in order; bracketed ones are optional)DescriptionNotes
AccountGetAccountnoneAccount informationRead-only
DockerGetNodeList[offset, limit]Docker listRead-only
DockerDeleteNodenidDelete a dockerDeletes, cannot be undone
ExchangeGetExchangeListisSummaryExchanges supported by the platform and their settingsRead-only
ExchangeGetPlatformList[offset, limit]Exchange accounts you addedRead-only
StrategyGetStrategyListoffset, length, strategyType, category, language, kw[, groupId, orderBy]Strategy listRead-only
RobotGetRobotGroupListnoneRobot groupsRead-only
RobotGetRobotList[offset, length, customStatus, appId, kw, groupId, orderBy, strategyId]Robot listRead-only
RobotGetRobotDetailrobotIdRobot detailsRead-only
RobotGetRobotLogsrobotId, logMinId, …, summaryLimit[, logExchange, logKeyword, logTypes]Logs, profit, chart and status bar dataRead-only
RobotNewRobotsettingsCreate and start a robotCharges fees; the robot trades for real
RobotRestartRobotrobotId[, settings]Start (restart) a robotCharges fees; the robot trades for real
RobotStopRobotrobotIdStop a robotDoes not close positions
RobotCommandRobotrobotId, cmdSend an interactive commandThe strategy may place orders on it
RobotDeleteRobotrobotId[, removeLog]Delete a robotDeletes, cannot be undone
DebuggingPluginRunsettingsRun a piece of code on a dockerThe code can place real orders
Channelpubrobot, channel (URL parameters); the message goes in the request bodyPush a message to a channel a robot subscribed toNo API key, no signature

The API key needs permission for the method, see Create ApiKey.

Passing parameters

args can be written in two ways:

  • Array: positional parameters in the order of the table above, e.g. [123, "ok"]. Positional calls accept only certain numbers of arguments; any other count returns a Params number mismatch error:
    • GetNodeList, GetPlatformList: 0 or 2.
    • GetStrategyList: 0, 6, 7 or 8; with no arguments language is 1 (only Python strategies), see GetStrategyList.
    • GetRobotList: 0, 1, 3, 5, 6, 7 or 8; a single argument is taken as appId.
    • GetRobotLogs: 15 to 19 (with 15 the status bar is not queried).
    • RestartRobot, DeleteRobot: 1 or 2; when DeleteRobot gets only robotId, removeLog is false.
  • Object: values by parameter name, e.g. {"robotId": 123, "cmd": "ok"}. Names are case-insensitive and underscores are ignored; omitted parameters take their defaults. Recommended for methods with many optional parameters (GetRobotList, GetRobotLogs, GetStrategyList).

Robot configuration (settings)

The settings parameter of NewRobot, RestartRobot and PluginRun is a JSON object; common fields:

FieldDescription
nameRobot name.
strategyStrategy ID, see GetStrategyList. RestartRobot cannot change a robot's strategy.
argsStrategy parameters, each element ["name", value], e.g. [["Interval", 500]]; [] if the strategy has none.
exchangesArray of exchange object configurations, one element per exchange object, see below.
periodDefault K-line period in seconds, e.g. 60, 3600; 60 seconds when omitted. Pass 60 or more; see below the table.
nodeID of the docker that runs the robot, see GetNodeList; omitted or -1 means automatic assignment.
groupRobot group ID, see GetRobotGroupList.
appidCustom label; GetRobotList can filter by it.

A period of 0, 1, 2, 3, 4, 5, 10 or 12 is read as an old period number (1 minute, 3 minutes, 5 minutes, 15 minutes, 30 minutes, 1 hour, 1 day, 1 week respectively); for example 1 actually means 180 seconds.

An exchanges element takes one of two forms, which cannot be mixed in one array (the first element decides):

  • Reference an exchange account added on the platform: {"pid": 123, "pair": "BTC_USDT"}. pid is the id returned by GetPlatformList.
  • Pass the exchange configuration directly: {"eid": "Binance", "label": "test", "pair": "BTC_USDT", "meta": {"AccessKey": "...", "SecretKey": "..."}}. eid is the exchange ID; the field names of meta are given by the meta returned by GetExchangeList; label is the exchange object's label, read in the strategy with exchange.GetLabel(). The platform does not store the keys in meta but forwards them to the docker, so a robot created this way needs settings again on every restart.

For a custom-protocol exchange: {"eid": "Exchange", "label": "test", "pair": "BTC_USDT", "meta": {"AccessKey": "...", "SecretKey": "...", "Front": "http://127.0.0.1:6666/test"}}, where Front is the address of the custom-protocol service.

In this sectionRead the whole section

NameDescription
GetAccountGets the account information of the account that owns the API key, including the balance and the total amount spent.
GetNodeListGets the dockers the account can use, including its own dockers and the platform's public dockers.
DeleteNodeDeletes a docker of the account; an online docker is forced to log out and all robots on it become "strategy error".
GetExchangeListGets the exchanges the platform supports and the configuration fields each of them needs.
GetPlatformListGets the exchange accounts added to the account.
GetStrategyListQueries strategies by scope, type, language, keyword and other conditions.
GetRobotGroupListGets the robot groups of the account; the "Default" group is not listed.
GetRobotListGets the robots of the account, optionally filtered by status, label, name, group or strategy; all arguments can be omitted.
GetRobotDetailGets the details of one robot of the account, including its status, billing, exchange configuration and strategy arguments.
GetRobotLogsGets the strategy log, profit log, chart data and status bar data of one robot of the account.
NewRobotCreates a robot in the account and starts it; like creating a robot on the website, this charges fees and the robot trades for real.
RestartRobotStarts (restarts) a robot of the account, optionally replacing its configuration; starting charges fees.
StopRobotStops a robot of the account; stopping does not close positions.
CommandRobotSends an interactive command to a running robot of the account; the strategy receives it with GetCommand.
DeleteRobotDeletes a robot of the account; a running robot must be stopped first, and deletion cannot be undone.
PluginRunRuns a piece of JavaScript code on a docker and returns the result, without creating a robot or charging fees; one run lasts at most 5 minutes, and the code can…
pubPushes a message to a channel subscribed by a running robot, so that systems outside the platform (TradingView webhook alerts, your own trading system, monitori…