Skip to content

Using streaming API#

MetaApi allows you to receive terminal state updates (account information, open positions, orders, history updates and quotes) in real time via streaming API. To initiate the streaming process, your application must synchronize to the terminal state first by emiting request event of synchronize type and pass desired time to start history synchronization from. For more see Synchronize request.

Please note, that streaming API has evolved over time and currently the protocol is complex. We insist you to use an SDK if you want to use the streaming API. In case you need to use the streaming API from a language different from javascript or python, the best strategy would be to convert the complete SDK from javascript to the language of your choice.

Some WebSocket responses may contain information about synchronization status of the MetaApi with the terminal. Namely:

  • synchronizing field in responses to requests for retrieving history orders and deals indicates that the received data might be incomplete due to initial data synchronization process not completed yet
  • NotSynchronizedError processingError indicates that the requested data has not yet been synchronized and cannot be returned yet
  • synchronization event of the dealSynchronizationFinished type notifies that the transaction history synchronization has been completed
  • synchronization event of the orderSynchronizationFinished type notifies that the history order synchronization has been completed