Api2Trade compatible
Change two things. Keep every call.
This surface speaks the same language as an Api2Trade client. Point the client at https://api.socketrade.com instead of its old host, send your Socketrade key in theX-API-Key header, and the calls stay the same. Paths, query parameters and the order of the ConnectEx handshake do not change.
What changes
The base URL and the credential. Nothing else has to move: the calls below are the same calls, with the same names and the same query style.
| host | https://api.socketrade.com |
| X-API-Key | Your key, starting a2t_. One key covers every account on your plan. |
| Basic auth | Also accepted on this surface, with the same key as the password and any user name. |
Values in the query string still need URL encoding. A password containing an @ or a : has to be encoded, or the call will be read as a shorter password than the one you meant.
The ConnectEx flow
Call ConnectEx once with the account number, the broker name and the trading password. Every call after that takes the account number as its id. Call Disconnect when you are finished with the account, so the session can be released.
curl "https://api.socketrade.com/ConnectEx?id=41299492&server=Deriv-Demo&user=41299492&password=$MT5_PASSWORD" \ -H "X-API-Key: $SOCKETRADE_KEY"
Calls
Every call is a GET with its parameters in the query string, and every call needs your key.
| Call | Parameters | Returns |
|---|---|---|
| ConnectEx | id, server, user, password | Starts a session for the account, so the calls below can use its id. |
| AccountSummary | id | Balance, equity, margin, free margin and floating profit. |
| OpenedOrders | id | Open positions and working pending orders. |
| ClosedOrders | id | Trades that have already closed. |
| SymbolList | id | Every symbol the account can trade. |
| SymbolParams | id, symbol | Digits, contract size, minimum and maximum volume, stops level. |
| GetQuote | id, symbol | Current bid and ask for one symbol. |
| GetQuoteMany | id, symbols | Bid and ask for a comma separated list, in one call. |
| MarketWatchMany | id, symbols | Quotes with the day range and change for a list of symbols. |
| PriceHistory | id, symbol, timeframe, from, to | Bars between two ISO datetimes. |
| OrderSend | id, symbol, operation, volume, price, sl, tp, deviation, magic | Sends a market or pending order. Returns the ticket or the retcode. |
| OrderModify | id, ticket, and the values to change | Changes the stops or the price on a working order. |
| OrderClose | id, ticket | Closes a position by ticket. |
| Disconnect | id | Ends the session started by ConnectEx. |
Account reads
curl "https://api.socketrade.com/AccountSummary?id=41299492" -H "X-API-Key: $SOCKETRADE_KEY" curl "https://api.socketrade.com/OpenedOrders?id=41299492" -H "X-API-Key: $SOCKETRADE_KEY" curl "https://api.socketrade.com/ClosedOrders?id=41299492" -H "X-API-Key: $SOCKETRADE_KEY"
Symbols and quotes
Pass several symbols as one comma separated value in symbols to fill a watch list in a single call.
curl "https://api.socketrade.com/SymbolList?id=41299492" -H "X-API-Key: $SOCKETRADE_KEY" curl "https://api.socketrade.com/SymbolParams?id=41299492&symbol=EURUSD" -H "X-API-Key: $SOCKETRADE_KEY" curl "https://api.socketrade.com/GetQuote?id=41299492&symbol=EURUSD" -H "X-API-Key: $SOCKETRADE_KEY" curl "https://api.socketrade.com/GetQuoteMany?id=41299492&symbols=EURUSD,GBPUSD,XAUUSD" -H "X-API-Key: $SOCKETRADE_KEY" curl "https://api.socketrade.com/MarketWatchMany?id=41299492&symbols=EURUSD,GBPUSD,XAUUSD" -H "X-API-Key: $SOCKETRADE_KEY"
Price history
curl "https://api.socketrade.com/PriceHistory?id=41299492&symbol=EURUSD&timeframe=M15&from=2026-01-05T00:00:00Z&to=2026-01-06T00:00:00Z" \ -H "X-API-Key: $SOCKETRADE_KEY"
from and to are ISO datetimes, written with a date and a time, for example 2026-01-05T00:00:00Z. They are not unix epochs. Send the full datetime, and make sure to is later than from.
Trading
OrderSend takes the symbol, the operation, the volume and the optional price, stops, deviation and magic number. OrderModify and OrderClose identify the order by its ticket.
curl "https://api.socketrade.com/OrderSend?id=41299492&symbol=EURUSD&operation=buy&volume=0.01&price=0&sl=0&tp=0&deviation=10&magic=0" \ -H "X-API-Key: $SOCKETRADE_KEY" curl "https://api.socketrade.com/OrderModify?id=41299492&ticket=4789544305&sl=1.0800&tp=1.0950" \ -H "X-API-Key: $SOCKETRADE_KEY" curl "https://api.socketrade.com/OrderClose?id=41299492&ticket=4789544305" \ -H "X-API-Key: $SOCKETRADE_KEY"
Disconnect
curl "https://api.socketrade.com/Disconnect?id=41299492" -H "X-API-Key: $SOCKETRADE_KEY"