API reference / Account REST API (/users/current)
Market data
Account REST API (/users/current). Generated from the OpenAPI document the services export (/openapi.json).
Samples use the placeholders YOUR_API_KEY and YOUR_ACCOUNT_ID.
Paste a sandbox key (twsk_…) to fill them in and to use Try it.
It stays in this browser tab and is only sent to the sandbox, never to the live API.
Try it is off in this build: No sandbox URL is configured for this build of the docs.
GET /users/current/accounts/{account_id}/historical-market-data/symbols/{symbol}/ticks
Get historical ticks Auth: auth-token
Ticks at or after startTime, going forwards, after skipping offset. MT5 only.
Without startTime you get the latest limit ticks. limit is 1 to
1000 (default 1000). On MT4 this is 400 not_supported_on_mt4. Each
account runs at most 5 historical requests at once. The 6th is 429
TooManyRequestsError with Retry-After.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string | |
startTime | query | string | null | |
offset | query | string | null | |
limit | query | string | null |
Responses
200The ticks, oldest first. ·Tick[]400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account does not exist or this credential cannot see it, or the position, order or symbol in the path was not found. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope503The terminal is not connected or not synchronized yet. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error404account_not_found503not_connected400not_supported_on_mt4
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/historical-market-data/symbols/EURUSD/ticks' \
-H 'auth-token: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/users/current/accounts/YOUR_ACCOUNT_ID/historical-market-data/symbols/EURUSD/ticks",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/historical-market-data/symbols/EURUSD/ticks");
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
GET /users/current/accounts/{account_id}/historical-market-data/symbols/{symbol}/timeframes/{timeframe}/candles
Get historical candles Auth: auth-token
Up to limit candles that open at or before startTime, oldest first.
Without startTime you get the latest candles. limit is 1 to 1000
(default 1000). Timeframes: 1m 2m 3m 4m 5m 6m 10m 12m 15m 20m 30m 1h 2h 3h 4h
6h 8h 12h 1d 1w 1mn. MT4 has 1m 5m 15m 30m 1h 4h 1d 1w 1mn, and the others
answer not_supported_on_mt4.
Each account runs at most 5 historical requests at once. The 6th is 429
TooManyRequestsError with Retry-After.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string | |
timeframe required | path | string | |
startTime | query | string | null | |
limit | query | string | null |
Responses
200The candles, oldest first. ·Candle[]400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account does not exist or this credential cannot see it, or the position, order or symbol in the path was not found. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope503The terminal is not connected or not synchronized yet. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error404account_not_found503not_connected400not_supported_on_mt4
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/historical-market-data/symbols/EURUSD/timeframes/1h/candles' \
-H 'auth-token: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/users/current/accounts/YOUR_ACCOUNT_ID/historical-market-data/symbols/EURUSD/timeframes/1h/candles",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/historical-market-data/symbols/EURUSD/timeframes/1h/candles");
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
GET /users/current/accounts/{account_id}/symbols
List symbols Auth: auth-token
Every symbol the terminal knows, as a list of names. Works on MT4 and MT5.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Every symbol name the terminal knows. ·string[]400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account does not exist or this credential cannot see it, or the position, order or symbol in the path was not found. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope503The terminal is not connected or not synchronized yet. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error404account_not_found503not_connected
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/symbols' \
-H 'auth-token: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/users/current/accounts/YOUR_ACCOUNT_ID/symbols",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/symbols");
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
GET /users/current/accounts/{account_id}/symbols/{symbol}/current-book
Get the market depth Auth: auth-token
The symbol's market depth (order book). MT5 only.
On MT4 this is 400 not_supported_on_mt4. A symbol whose broker
publishes no depth is 404 with tickwireError: depth_unavailable.
keepSubscription is accepted. Every read is live from the terminal, so
there is no subscription to keep.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string | |
keepSubscription | query | string | null |
Responses
200The order book. ·Book400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account does not exist or this credential cannot see it, or the position, order or symbol in the path was not found. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope503The terminal is not connected or not synchronized yet. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error404account_not_found503not_connected400not_supported_on_mt4
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-book' \
-H 'auth-token: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-book",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-book");
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
GET /users/current/accounts/{account_id}/symbols/{symbol}/current-candles/{timeframe}
Get the current candle Auth: auth-token
The candle that is forming now.
Timeframes: 1m 2m 3m 4m 5m 6m 10m 12m 15m 20m 30m 1h 2h 3h 4h
6h 8h 12h 1d 1w 1mn. MT4 has 1m 5m 15m 30m 1h 4h 1d 1w 1mn, and the others
answer not_supported_on_mt4.
keepSubscription is accepted. Every read is live from the terminal, so
there is no subscription to keep.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string | |
timeframe required | path | string | |
keepSubscription | query | string | null |
Responses
200The forming candle. ·Candle400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account does not exist or this credential cannot see it, or the position, order or symbol in the path was not found. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope503The terminal is not connected or not synchronized yet. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error404account_not_found503not_connected
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-candles/1h' \
-H 'auth-token: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-candles/1h",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-candles/1h");
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
GET /users/current/accounts/{account_id}/symbols/{symbol}/current-price
Get the current price Auth: auth-token
The symbol's current bid and ask, with tick values and the quote time.
Before the terminal has a quote this is 503 NotSynchronizedError with
Retry-After.
keepSubscription is accepted. Every read is live from the terminal, so
there is no subscription to keep.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string | |
keepSubscription | query | string | null |
Responses
200The current bid and ask. ·Price400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account does not exist or this credential cannot see it, or the position, order or symbol in the path was not found. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope503The terminal is not connected or not synchronized yet. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error404account_not_found503not_connected
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-price' \
-H 'auth-token: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-price",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-price");
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
GET /users/current/accounts/{account_id}/symbols/{symbol}/current-tick
Get the current tick Auth: auth-token
The symbol's latest tick: bid, ask and, when the broker sends them, last
and volume.
keepSubscription is accepted. Every read is live from the terminal, so
there is no subscription to keep.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string | |
keepSubscription | query | string | null |
Responses
200The latest tick. ·Tick400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account does not exist or this credential cannot see it, or the position, order or symbol in the path was not found. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope503The terminal is not connected or not synchronized yet. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error404account_not_found503not_connected
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-tick' \
-H 'auth-token: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-tick",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-tick");
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
GET /users/current/accounts/{account_id}/symbols/{symbol}/specification
Get a symbol's specification Auth: auth-token
The symbol's trading rules: volumes, contract size, filling modes, margins,
swaps, allowed order types, digits, point and stop levels.
pipSize is only set for FX symbols. quoteSessions and
tradeSessions are only present when the platform reports them. They are
never guessed. An unknown symbol is 404.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string |
Responses
200The symbol's trading rules. ·SymbolSpecification400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account does not exist or this credential cannot see it, or the position, order or symbol in the path was not found. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope503The terminal is not connected or not synchronized yet. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error404account_not_found503not_connected
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/specification' \
-H 'auth-token: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/specification",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/specification");
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
POST /users/current/accounts/{account_id}/symbols/{symbol}/unsubscribe
Unsubscribe from a symbol Auth: auth-token
Release the terminal's market depth subscription for the symbol. Answers 204 with no body.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string |
Responses
204Released. There is no body.400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account does not exist or this credential cannot see it, or the position, order or symbol in the path was not found. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope503The terminal is not connected or not synchronized yet. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error404account_not_found503not_connected
curl
curl -sS -X POST 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/unsubscribe' \
-H 'auth-token: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"POST",
"/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/unsubscribe",
idempotency_key="my-request-1",
reason="why you are doing this",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/unsubscribe", {
idempotencyKey: "my-request-1",
reason: "why you are doing this",
});
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.