Quickstart
In about ten minutes you create an API key, connect a real MT5 account with its read-only investor password, wait for it to come online, read its balance and open positions, and subscribe to live updates.
Each step has a Python SDK tab and a curl tab; both call the same endpoints. The base URL is https://api.fundedops.com throughout.
1. Create an API key
Open the API keys page in the portal and create a key. Keys look like fo_live_.... The full key is shown once, at creation time. Copy it immediately and store it somewhere safe. If you lose it, revoke it and mint a new one; there is no way to display an existing key again. For this guide, choose Full Access: it also places trades in step 7. A key can also be read-only, or limited to chosen accounts, for example to give a dashboard read access to a few accounts and nothing else.
The form also has an Expires choice: Never (the default), 30 days, 90 days or 1 year. The expiry of an existing key cannot be changed, so create a new key instead. After a key expires it stops working on REST, MCP and the WebSocket stream. It stays in the key list as Expired, and you can still revoke it.
Every request authenticates with this key as a bearer token: Authorization: Bearer fo_live_....
2. Install the SDK
The Python SDK requires Python 3.10 or newer. curl needs nothing beyond itself.
pip install fundedops# curl is already on most systems, so there is nothing to install.
curl --version3. Connect an account with an investor password
Create the account with a single call. Pass your MT5 login, the investor (read-only) password, and the broker server name. Put the investor password in the password field, the same field a full password would use. FundedOps detects read-only access automatically from the connection on the first heartbeat and reports it back as credentialType: "investor"; you never declare it in the request.
Not sure of the exact server name? GET /v1/servers?query=icmarkets (or client.search_servers( in the SDK) returns matching names, best first.
Creating an account also deploys it, so there is no separate deploy call. The response is 202 Accepted with the account in state: "deploying"; provisioning continues asynchronously. The account name can be up to 100 characters.
from fundedops import FundedOps
client = FundedOps(api_key="fo_live_...")
account = client.accounts.create(
login="1234567",
password="your-investor-password", # read-only; goes in the password field
server="ICMarketsSC-Demo",
platform="mt5",
name="Prod monitor",
)
print(account.id, account.state) # e.g. "…", "deploying"curl -X POST https://api.fundedops.com/v1/accounts \
-H "Authorization: Bearer fo_live_..." \
-H "Content-Type: application/json" \
-d '{
"login": "1234567",
"password": "your-investor-password",
"server": "ICMarketsSC-Demo",
"platform": "mt5",
"name": "Prod monitor"
}'The 202 body is the full account resource:
{
"id": "9b2c…",
"name": "Prod monitor",
"login": "1234567",
"server": "ICMarketsSC-Demo",
"platform": "mt5",
"state": "deploying",
"connectionStatus": null,
"credentialType": null,
"tradeAllowed": null,
"marginMode": null,
"tags": [],
"metadata": {},
"error": null,
"createdAt": "2026-07-09T12:00:00Z",
"deployedAt": null,
"lastHeartbeatAt": null
}credentialType and connectionStatus are both null until the connection is live, which happens in the next step. Both MT4 and MT5 accounts are supported: to connect an MT4 account, send platform: "mt4" in the create request instead of "mt5". Every other field, and every read and streaming call below, is identical.
# MT4 variant: identical to the call above, only platform differs.
account = client.accounts.create(
login="1234567",
password="your-investor-password",
server="VantageMarkets-Demo 2",
platform="mt4",
name="Prod monitor",
)curl -X POST https://api.fundedops.com/v1/accounts \
-H "Authorization: Bearer fo_live_..." \
-H "Content-Type: application/json" \
-d '{
"login": "1234567",
"password": "your-investor-password",
"server": "VantageMarkets-Demo 2",
"platform": "mt4",
"name": "Prod monitor"
}'4. Poll until it is connected
While the account provisions, state moves deploying → deployed. connectionStatus stays null until state is deployed, then flips to "connected" once the connection sends its first heartbeat. The SDK collapses the poll loop into one call with a mandatory timeout; with curl, poll GET /v1/accounts/{id} yourself.
# Blocks until connectionStatus == "connected". Raises DeployFailedError if the
# account cannot connect, or TimeoutError after 180s.
account = client.wait_until_connected(account.id, timeout=180)
print(account.state, account.connection_status) # "deployed" "connected"
print(account.credential_type) # "investor" (read-only, auto-detected)# Poll every 2s until connectionStatus is "connected".
ACCOUNT_ID="9b2c…"
until curl -s https://api.fundedops.com/v1/accounts/$ACCOUNT_ID \
-H "Authorization: Bearer fo_live_..." \
| grep -q '"connectionStatus":"connected"'; do
sleep 2
done
echo "connected"Other connectionStatus values you may see once deployed: "disconnected" (our connection is briefly down or restarting) and "disconnected_from_broker" (the connection is up but the broker rejected the session). Both are transient and recover on their own.
5. Read data
Once connected, read the account figures and open positions. These are the same shapes the WebSocket stream sends.
info = client.accounts.account_information(account.id)
print(info.balance, info.equity, info.currency)
page = client.accounts.positions(account.id)
for p in page.positions:
print(p.symbol, p.type, p.volume, p.profit)curl -s https://api.fundedops.com/v1/accounts/$ACCOUNT_ID/account-information \
-H "Authorization: Bearer fo_live_..."
curl -s https://api.fundedops.com/v1/accounts/$ACCOUNT_ID/positions \
-H "Authorization: Bearer fo_live_..."account-information returns the last-known figures:
{
"balance": 10000.0,
"equity": 10120.5,
"margin": 210.0,
"freeMargin": 9910.5,
"marginLevel": 4819.3,
"leverage": 100,
"currency": "USD",
"dailyPnl": 120.5,
"updatedAt": "2026-07-09T12:03:40Z",
"synchronizing": false
}positions returns the open positions beside a synchronizing flag (true only while historical backfill is still loading, as live figures are always current):
{
"synchronizing": false,
"positions": [
{
"id": "…",
"ticket": 55123456,
"platform": "mt5",
"symbol": "EURUSD",
"type": "buy",
"volume": 0.10,
"openPrice": 1.08420,
"currentPrice": 1.08535,
"profit": 11.5,
"swap": 0.0,
"commission": -0.7,
"stopLoss": 1.08000,
"takeProfit": 1.09000,
"openTime": "2026-07-09T11:40:00Z",
"updatedAt": "2026-07-09T12:03:40Z"
}
]
}Every position, order, and deal carries a platform field ("mt4" or "mt5") identifying the account it came from. On MT4 accounts a position's ticket equals its positionId, because MT4 has no separate position ticket and the two are always the same value.
MT4 specifics: MT4 accounts read and stream through the same endpoints as MT5, with four platform differences to know: single history model (one MT4
MODE_HISTORYpool feeds bothhistory-dealsandhistory-orders);ticket = position_id(no separate position ticket); no stop-limit order types (onlybuy_limit,sell_limit,buy_stop,sell_stop); and partial close opens a new ticket for the remainder rather than shrinking the original. List History Positions joins those tickets back into one row through the broker'sto #andfrom #comment links, and a piece the broker does not number stays its own row. After a Close By, the position that was closed by the other shows volume 0 and the other carries the profit.
6. Stream live events
Now subscribe to the live feed. The SDK opens the WebSocket, subscribes your account, answers server pings for you, and yields typed events. On connect you get an ordered snapshot (sync_started → account_information → positions → orders → sync_finished), then incremental *_updated events as things change.
for event in client.stream([account.id]):
if event.type == "account_information_updated":
print("equity", event.account_information.equity)
elif event.type == "positions_updated":
print("positions changed:", len(event.updated), "removed:", event.removed_ids)
elif event.type == "deal_added":
print("closed deal", event.deal.symbol, event.deal.profit)# curl cannot speak WebSocket. Connect from Python instead, using the raw protocol,
# no SDK. The key rides the query string, so NEVER log this URL (see the warning).
python - <<'PY'
import asyncio, json, websockets
URL = "wss://api.fundedops.com/v1/stream?api_key=fo_live_..."
async def main():
async with websockets.connect(URL) as ws:
await ws.send(json.dumps({"type": "subscribe", "account_id": "9b2c…"}))
async for raw in ws:
msg = json.loads(raw)
if msg["type"] == "ping":
await ws.send(json.dumps({"type": "pong"}))
continue
print(msg["type"], msg.get("sequence_number"))
asyncio.run(main())
PYWarning: the API key travels in the WebSocket URL's query string (
?api_key=...). Keep stream URLs out of logs, printed output, error reports and bug trackers. Treat the wholewss:/string as a secret. The SDK keeps it in a private attribute and never logs it./ api.fundedops.com/ v1/ stream? api_key= ...
See WebSockets for the full frame vocabulary, sequencing, and reconnect rules.
7. Place a trade
Reading works with the investor password. Trading also needs the account connected with its master password. The Full Access key from step 1 can trade; a Read Only key cannot.
- Send the master password with Update Account. A deployed account reconnects with it and keeps its id and history; redeploying within the paid period costs nothing extra. While a deploy is still running the call returns
409: send it again once it finishes. - Wait until the account is connected again and check that
tradeAllowedistrue. It is refreshed on every heartbeat, and it staysfalsewhen the password or the broker does not allow trading. - Place the order with an
Idempotency-Keyheader, your own id for the trade. Sending the same request with the same key again returns the first outcome instead of trading twice. The SDK creates a key for every call unless you passidempotency_key=.
client = FundedOps(api_key="fo_live_...") # the Full Access key from step 1
client.accounts.update(account.id, password="your-master-password")
account = client.wait_until_connected(account.id, timeout=300)
print(account.trade_allowed) # True
trade = client.place_order(account.id, "buy", "EURUSD", 0.01)
print(trade.status, trade.idempotency_key) # "done" and the key the SDK sentcurl -X PATCH https://api.fundedops.com/v1/accounts/$ACCOUNT_ID \
-H "Authorization: Bearer fo_live_..." \
-H "Content-Type: application/json" \
-d '{"password": "your-master-password"}'
# Once connectionStatus is "connected" again:
curl -X POST https://api.fundedops.com/v1/accounts/$ACCOUNT_ID/orders \
-H "Authorization: Bearer fo_live_..." \
-H "Idempotency-Key: first-trade-0001" \
-H "Content-Type: application/json" \
-d '{"type": "buy", "symbol": "EURUSD", "volume": 0.01}'The answer is 200 once the broker has filled the order, or 202 while it is still in progress. The Trading guide covers every trading endpoint, the statuses and the errors.
Errors and rate limits
Every error shares one envelope: { "id": <status>, "error": "<Name>", "message": "…", "requestId": "…" } (with optional details / metadata). The SDK raises a typed exception per status: ValidationError, NotFoundError, ConflictError, RateLimitedError, and so on.
Requests are rate limited per client at 25 requests per second (bursts to 100). Over the limit you get 429 TooManyRequestsError with a Retry-After header (in seconds). Wait that long and retry. With the SDK, catch RateLimitedError and read err.retry_after. Every response also carries X-RateLimit-Remaining and X-RateLimit-Reset, so you can slow down before you reach the limit; the SDK keeps the latest values in client.rate_limit.
from fundedops.errors import RateLimitedError
try:
client.accounts.list()
except RateLimitedError as err:
print("slow down; retry after", err.retry_after, "seconds")# A 429 response carries Retry-After (seconds) in the headers.
curl -si https://api.fundedops.com/v1/accounts \
-H "Authorization: Bearer fo_live_..." | grep -i retry-afterWhat's next
Your first account is free for 15 days. After that, each connected account costs $8 for every 30 days, paid from prepaid credit. Add or remove accounts any time from the Accounts page or over the API.
- API reference: every endpoint, request and response shape.
- WebSockets: the streaming protocol in full.
- Python SDK: sync and async clients, streaming, and error handling.
- TypeScript SDK: a typed client for Node, streaming, trading and error handling.
- Trading: place, change and close trades.