Skip to content

Your first request

With the EA running, open this address on the same computer:

http://127.0.0.1:81/v1/quote?symbol=EURUSD

You’ll see the current EURUSD price as JSON.

Terminal window
# price
curl "http://127.0.0.1:81/v1/quote?symbol=EURUSD"
# buy 0.01 lot (demo account)
curl -X POST "http://127.0.0.1:81/v1/order?symbol=EURUSD&volume=0.01&type=ORDER_TYPE_BUY"
# list open positions and pending orders
curl "http://127.0.0.1:81/v1/order/list"

A successful order returns "RETCODE":10009 and "ERROR_ID":0:

{"MSG":"ORDER_SEND","TYPE":"ORDER_TYPE_BUY","RETCODE":10009,"DEAL":3223069202,
"ORDER":3262274114,"VOLUME":0.01,"PRICE":1.04011,"BID":1.04007,"ASK":1.04011,
"REQUEST_ID":651348425,"RETCODE_EXTERNAL":0,"ERROR_ID":0,
"ERROR_DESCRIPTION":"The operation completed successfully"}

The interactive API reference can send requests straight to your local EA from the browser. Code for every endpoint is in the examples.