Pipwire

 

Workspace
AccountsAPI keysAlertsUsage & billing
Resources
DocsStatus
Pipwire
  • Quick start
  • Keys, times, errors
  • Accounts
  • Market and account data
  • Trading
  • GET accountsPOST accountsGET {id}PATCH {id}DELETE {id}POST {id}/restartGET {id}/uptimeGET {id}/eventsGET {id}/candlesGET {id}/priceGET {id}/symbolsGET {id}/symbols/{symbol}GET {id}/infoGET {id}/positionsGET {id}/positions/{positionId}GET {id}/dealsGET {id}/orders/historyPOST {id}/ordersPATCH {id}/positions/{positionId}DELETE {id}/positions/{positionId}GET {id}/margin

API reference

Everything here is live. Times are UTC; prices and candles come from each account's own terminal.

1. Create a key on the API keys page, then list your accounts

curl
export PIPWIRE_API=https://api.pipwire.io

curl $PIPWIRE_API/v1/accounts \
  -H "Authorization: Bearer $PIPWIRE_KEY"

2. Read candles from one of them

curl
curl "$PIPWIRE_API/v1/accounts/acc_…/candles?symbol=XAUUSD%2B&timeframe=30m&limit=500" \
  -H "Authorization: Bearer $PIPWIRE_KEY"

Keys, times and errors

Keys. Send Authorization: Bearer pw_…. A read key sees every account in the workspace; a trade key can also place and close orders. Keys are shown once; revoke one and it stops working at once.

Times. Every time in and out is UTC, ISO 8601 with a Z. MT5 brokers keep their own server clock; Pipwire converts for you, including the night New York changes its clocks.

Symbols. Use the broker's own names (Vantage calls gold XAUUSD+). Search them with /symbols. Encode + as %2B and # as %23 in URLs.

Limits. No published rate limits during the private beta.

Errors are JSON with a plain-words error; invalid fields also come back in fields.

401
No API key, or it was revoked.
403
A read-only key tried to trade, or the account is connected read only.
404
No such account in your workspace, or an unknown symbol.
409
That login is already connected, or the account is paused.
422
A field isn't valid (fields lists which), or the broker rejected the order (retcode is MT5's code: 10016 invalid stops, 10018 market closed, 10019 not enough money).
502
The terminal answered with a MetaTrader error; error has its words.
503
Pipwire couldn't reach a terminal host, or none has room. Retry shortly.
504
The account's terminal didn't answer in time, usually while it is starting.

Accounts

GET/v1/accounts

Every account in your workspace, oldest first.

response
{ "data": [ {
    "id": "acc_mg69qi9is4j8",
    "name": "Gold data",
    "server": "VantageMarkets-Live 6",
    "login": 37017655,
    "access": "read",
    "status": "connected",
    "statusDetail": "Signed in to VantageMarkets-Live 6.",
    "statusAt": "2026-11-22T12:42:31Z",
    "connectedSince": "2026-11-22T12:42:01Z",
    "lastConnectedAt": "2026-11-22T12:42:31Z",
    "balance": 0.0,
    "equity": 0.0,
    "currency": "USD",
    "pingMs": 18.6,
    "region": "fsn-1",
    "clock": "ny+7",
    "createdAt": "2026-11-22T12:41:44Z"
  } ] }
POST/v1/accounts

Connect an MT5 account. Pipwire starts a terminal for it and signs it in.

Answers at once with status "signing_in". Poll the account: most brokers sign in within a minute. A refused login shows as status "error" with the reason in statusDetail. Connecting with access "trade" needs a key with trade permission.

JSON body

serverstring · required
Exactly as MetaTrader shows it, e.g. VantageMarkets-Live 6.
logininteger · required
The account number.
passwordstring · required
Investor password for read, main password for trade. Stored encrypted; never returned.
access"read" | "trade"
Default read. Read-only terminals refuse orders.
namestring
For you, to tell accounts apart.
clockstring
The broker's server clock: "ny+7" (default, most brokers) or a fixed "utc+2". Used to give you UTC times.
curl
curl -X POST $PIPWIRE_API/v1/accounts \
  -H "Authorization: Bearer $PIPWIRE_KEY" -H "Content-Type: application/json" \
  -d '{"server": "VantageMarkets-Live 6", "login": 37017655, "password": "…", "access": "read"}'

Response: 201, the account (as above) with status "signing_in".

GET/v1/accounts/{id}

One account: status, balance, equity and ping, refreshed every 30 seconds.

PATCH/v1/accounts/{id}

Rename an account, or give it a new password (it signs in again).

JSON body

namestring
New name.
passwordstring
New password; the terminal signs in with it.
DELETE/v1/accounts/{id}

Shut the terminal down and erase the stored password. 204. Your MT5 account itself isn't touched.

POST/v1/accounts/{id}/restart

Restart the account's terminal. Also /pause (stops it; not billed) and /resume.

GET/v1/accounts/{id}/uptime

Share of each UTC day the account was connected, oldest first.

null means nobody was watching that day (before it was connected, or while paused), not 0%. GET /v1/accounts/uptime gives every account at once.

Query

daysinteger
1–90, default 30.
response
{ "data": [ { "day": "2026-11-21", "uptime": null }, { "day": "2026-11-22", "uptime": 0.99861 } ] }
GET/v1/accounts/{id}/events

What happened to the account, newest first: created, connected, disconnected, error, restarted, paused, resumed, order.

Query

limitinteger
1–200, default 50.
response
{ "data": [ { "id": 41, "kind": "connected", "message": "Signed in to VantageMarkets-Live 6.", "at": "2026-11-22T12:42:37Z" } ] }

Market and account data

GET/v1/accounts/{id}/candles

OHLC candles from the account's own terminal, with times in UTC.

Three ways to ask: the newest bars (limit); bars starting at a time (from and limit); or every bar between two times (from and to). Each bar's time is when it opens.

Query

symbolstring · required
As the broker names it, e.g. XAUUSD+ at Vantage. Encode + as %2B.
timeframestring
1m 2m 3m 4m 5m 6m 10m 12m 15m 20m 30m 1h 2h 3h 4h 6h 8h 12h 1d 1w 1mn. Default 30m.
limitinteger
1–50,000, default 500.
from, toISO 8601
UTC, e.g. 2026-11-20T00:00:00Z.
curl
curl "$PIPWIRE_API/v1/accounts/acc_…/candles?symbol=XAUUSD%2B&timeframe=30m&limit=2" \
  -H "Authorization: Bearer $PIPWIRE_KEY"
response
{
  "symbol": "XAUUSD+",
  "timeframe": "30m",
  "data": [
    { "time": "2026-11-20T21:00:00Z", "open": 3523.41, "high": 3538.31, "low": 3519.07, "close": 3537.2, "volume": 10173, "spread": 15 }
  ]
}
GET/v1/accounts/{id}/price

Latest bid and ask. A symbol not yet in the terminal's Market Watch is added for you.

Query

symbolstring · required
Required. An unknown symbol answers 404 with how to search.
response
{ "symbol": "XAUUSD+", "bid": 3537.2, "ask": 3537.35, "time": "2026-11-20T21:56:59Z" }
GET/v1/accounts/{id}/symbols

The broker's symbol names.

Query

searchstring
MetaTrader group syntax: *XAU* contains XAU, !*JPY* excludes. Default *.
limitinteger
1–10,000, default 500.
response
{ "data": ["XAUUSD+", "XAUEUR+"], "total": 2 }
GET/v1/accounts/{id}/symbols/{symbol}

Everything needed to size and place an order on one symbol.

stopsLevel and freezeLevel are in points (point × digits). tradeMode is full, long_only, short_only, close_only or disabled.

response
{ "symbol": "XAUUSD+", "digits": 2, "point": 0.01, "contractSize": 100.0, "minVolume": 0.01, "maxVolume": 50.0,
  "volumeStep": 0.01, "stopsLevel": 20, "freezeLevel": 0, "tickSize": 0.01, "tickValue": 1.0, "profitTickValue": 1.0,
  "lossTickValue": 1.0, "tradeMode": "full", "baseCurrency": "XAU", "profitCurrency": "USD", "marginCurrency": "XAU",
  "spread": 15, "swapLong": -45.1, "swapShort": 20.3 }
GET/v1/accounts/{id}/info

Balance, equity, margin and leverage, straight from the terminal.

type is demo, contest or real; marginMode is hedging or netting. tradeAllowed is false on a read-only (investor password) connection.

response
{ "login": 37017655, "server": "VantageMarkets-Live 6", "name": "…", "broker": "Vantage International Group Limited",
  "type": "real", "marginMode": "hedging", "currency": "USD", "balance": 10482.16, "credit": 0.0, "equity": 10611.4,
  "profit": 129.24, "margin": 702.5, "freeMargin": 9908.9, "marginLevel": 1510.5, "leverage": 500,
  "tradeAllowed": true, "access": "trade" }
GET/v1/accounts/{id}/positions

Open positions. A stop or target of 0 at the broker comes back as null.

Query

symbolstring
Only this symbol.
response
{ "data": [ { "id": "57052791711", "symbol": "XAUUSD+", "side": "sell", "volume": 0.1, "openPrice": 3500.0,
  "currentPrice": 3490.0, "stopLoss": null, "takeProfit": 3400.0, "profit": 100.0, "swap": 0.0,
  "openedAt": "2026-11-20T14:00:00Z", "comment": "my bot", "clientId": "ord-7f3a", "magic": 0 } ] }
GET/v1/accounts/{id}/positions/{positionId}

One open position, same shape. 404 once it has closed; its deals are then at /deals?positionId=.

GET/v1/accounts/{id}/deals

Closed deals in a time range.

entry is in (opened), out (closed), inout (reversed) or out_by.

Query

from, toISO 8601
UTC. Default: the last 7 days (90 with positionId).
positionIdstring
Only this position's deals: its opening and closing fills.
response
{ "data": [ { "id": "56719498044", "orderId": "57052856011", "positionId": "57052791711", "symbol": "XAUUSD+",
  "side": "buy", "entry": "out", "volume": 0.1, "price": 3490.0, "profit": 100.0, "commission": 0.0, "swap": 0.0,
  "fee": 0.0, "time": "2026-11-21T09:12:44Z", "comment": "", "clientId": null, "magic": 0 } ] }
GET/v1/accounts/{id}/orders/history

Orders that finished: filled, partial, rejected, canceled or expired.

To learn whether an order went through after its reply was lost, look for your clientId here and in /positions.

Query

from, toISO 8601
UTC. Default: the last 7 days.
response
{ "data": [ { "id": "57052856011", "positionId": "57052856011", "symbol": "XAUUSD+", "type": "buy", "state": "filled",
  "volume": 0.1, "remainingVolume": 0.0, "openPrice": null, "stopLoss": 3450.0, "takeProfit": null,
  "placedAt": "2026-11-20T14:00:00Z", "doneAt": "2026-11-20T14:00:00Z", "comment": "my bot", "clientId": "ord-7f3a", "magic": 0 } ] }

Trading

POST/v1/accounts/{id}/ordersTrade key

Place a market order.

Needs a key with trade permission and an account connected with access "trade". If the broker rejects it, you get 422 with its reason and MT5 retcode, e.g. 10018 market closed, 10019 not enough money.

JSON body

symbolstring · required
As the broker names it.
side"buy" | "sell" · required
volumenumber · required
Lots, e.g. 0.01.
stopLoss, takeProfitnumber
Prices. Optional.
deviationinteger
Allowed slippage in points, default 20.
clientIdstring
Your id for the order (letters, digits, _ -, up to 24). It comes back on the position, the order history and the deals.
commentstring
Shown beside the trade in MetaTrader. Up to 29 characters (MetaTrader's own limit, together with the clientId); shortened if needed so the clientId fits.
magicinteger
Your own tag for the order, default 0.
curl
curl -X POST $PIPWIRE_API/v1/accounts/acc_…/orders \
  -H "Authorization: Bearer $PIPWIRE_KEY" -H "Content-Type: application/json" \
  -d '{"symbol": "XAUUSD+", "side": "buy", "volume": 0.01, "stopLoss": 3450}'
response
201 { "retcode": 10009, "message": "Request executed", "orderId": "57052856011", "dealId": "56719498044",
  "positionId": "57052856011", "price": 3501.2, "volume": 0.01, "clientId": "ord-7f3a" }
PATCH/v1/accounts/{id}/positions/{positionId}Trade key

Move a position's stop-loss and/or take-profit.

A field you leave out keeps its current value; null removes it. If nothing changes you get 200 with changed: false. A level too close to the price is refused with 422 and retcode 10016.

JSON body

stopLossnumber | null
New stop price, or null to remove it.
takeProfitnumber | null
New target price, or null to remove it.
response
{ "changed": true, "retcode": 10009, "stopLoss": 3480.0, "takeProfit": 3600.0 }
DELETE/v1/accounts/{id}/positions/{positionId}Trade key

Close a whole position at market. Same answer and rules as placing an order.

Query

deviationinteger
Allowed slippage in points, default 20.
GET/v1/accounts/{id}/marginTrade key

The margin the broker would hold for an order, from the terminal's own order check.

Query

symbolstring · required
volumenumber · required
Lots.
side"buy" | "sell"
Default buy.
pricenumber
Default: the live ask (buy) or bid (sell).
response
{ "symbol": "XAUUSD+", "side": "buy", "volume": 0.1, "price": 3500.5, "margin": 70.01, "freeMarginAfter": 9900.0 }