Your first API request.
From start to response.
Connect an MT4 or MT5 account, choose its access and make a read-only request. Start here, then use the console playground to explore the full reference.
1. Connect your broker account
Create a MetaBridgeAPI account, confirm your email and create a workspace. Open Trading accounts and select the platform used by your broker account: MT4 or MT5.
Enter the login number, exact broker server name and trading password shown for that account. The trading password is different from your broker website password. Save the account, then select Connect. Saving stores the connection details; connecting authenticates with the broker.
2. Activate account access
In Billing, start a 14-day trial for one broker-verified demo account or purchase access for selected demo or live accounts. The trial starts when you activate it. Each owner can use one trial; creating another workspace does not restart it.
Paid plans provide 30 days of access after full payment is confirmed. Renewals are manual. A waiting invoice or return from checkout does not activate a plan. View current plans.
3. Create a scoped API key
In API keys, name the integration, select its permissions and choose the accounts it may access. Copy the full key when it is created, and store it in your server’s secret store.
| Permission | Use |
|---|---|
accounts:read | Account information and capabilities |
accounts:write | Save, connect and manage account records |
market:read | Symbols, quotes and price history |
trades:read | Orders, history and operation outcomes |
trades:write | Send, modify, close, cancel and batches |
streams:read | Quote, order and profit streams |
Keep the key out of browser bundles, URLs and logs. Rotation replaces the old key immediately. For a gradual migration, create and test a replacement before revoking the original.
4. Make a read-only request
The base URL is https://metabridgeapi.com/api/v1. Use the workspace UUID and account UUID shown in the console—not the broker login number. Set METABRIDGE_WORKSPACE_ID, METABRIDGE_ACCOUNT_ID and METABRIDGE_API_KEY in your server environment. This example requires accounts:read.
curl --fail-with-body \
"https://metabridgeapi.com/api/v1/organizations/$METABRIDGE_WORKSPACE_ID/accounts/$METABRIDGE_ACCOUNT_ID/summary" \
-H "Authorization: Bearer $METABRIDGE_API_KEY"Successful responses wrap the result in data. For a quote, use /quote?symbol=YOUR_BROKER_SYMBOL with market:read. Get the exact symbol from the account’s Symbols list.
Stream quotes, orders and profit
Streams use server-sent events over HTTP, with Bearer authentication and streams:read. Use an HTTP client that supports a streaming response and custom headers.
GET /organizations/{org}/accounts/{account}/quotes/stream?symbols=EURUSD
GET /organizations/{org}/accounts/{account}/orders/stream
GET /organizations/{org}/accounts/{account}/profits/streamQuote streams accept up to ten distinct broker symbols. Streams last up to ten minutes. Reconnect explicitly, refresh current state after a disconnect and do not assume missed events will replay. Read the Python streaming guide.
Distinguish accepted from executed
Trading uses POST /organizations/{org}/accounts/{account}/trades, a trades:write key, an Idempotency-Key header and a JSON body containing kind and request.
HTTP 202 means the API recorded an operation; it does not prove the broker executed an order. Read the operation status before acting again. Reuse the same key for the same request. Creating a new key after an uncertain result could create another trade.
Use demo accounts while developing. Broker rules determine allowed symbols, volume, prices, stops and trading hours. The console reference describes each supported operation and its request body.
Read the response before retrying
| Status | What to check |
|---|---|
| 400 | Request fields, platform, broker server or credentials |
| 401 | API key, expiry or console sign-in |
| 402 | Billing access for the selected account |
| 403 | Key permissions and permitted accounts |
| 409 | Connection state or an existing operation |
| 429 | Retry-After before sending another request |
| 502 / 503 | Connectivity; inspect trade status before retrying |
Errors include a request ID. Share that ID, the action and time with support; never send passwords or API keys. See the connection troubleshooting guide for setup failures.
The OpenAPI specification is available for API clients and developer tooling. You can also test in the console playground without downloading a file.