Read latest order book#
About#
Retrieves current order book for a symbol. MT4 accounts do not support this API
GET /users/current/accounts/:accountId/symbols/:symbol/current-book
For more information see Swagger documentation. Note, that this URL is valid for new-york region only. You can find URLs for other regions on API access page.
Headers#
Name | Type | Required | Description |
---|---|---|---|
auth-token | string | Yes | authorization token. See Authentication & authorization |
Path parameters#
Name | Type | Required | Description |
---|---|---|---|
accountId | string | Yes | MetaTrader account id. You can retrieve account id from Web application after you add your MetaTrader account to our platform. The account id can also be obtained via Provisioning API |
symbol | string | Yes | symbol (e.g. a currency pair or an index) |
Query parameters#
Name | Type | Required | Description |
---|---|---|---|
keepSubscription | boolean | if set to true, the account will get a long-term subscription to symbol market data. Long-term subscription means that on subsequent calls you will get updated value faster. If set to false or not set, the subscription will be set to expire in 12 minutes. |
Responses:
- 200 - Current order book returned successfully. Response schema: MetatraderBook
- 401 - Authorization failed. Response schema: Error
- 404 - MetaTrader account not found or not provisioned yet or symbol is not defined for this broker. Response schema: Error
Examples#
Example request:
curl -X GET --header 'Accept: application/json' --header 'auth-token: token' 'https://mt-client-api-v1.new-york.agiliumtrade.ai/users/current/accounts/865d3a4d-3803-486d-bdf3-a85679d9fad2/symbols/AUDNZD/current-book'
Example response:
{
"symbol": "AUDNZD",
"time": "2020-04-07T03:45:00.000Z",
"brokerTime": "2020-04-07 06:45:00.000",
"book": [
{
"type": "BOOK_TYPE_SELL",
"price": 1.05309,
"volume": 5.67
},
{
"type": "BOOK_TYPE_BUY",
"price": 1.05297,
"volume": 3.45
}
]
}