Skip to main content

HTTP API

The ALOR Broker trading system supports interaction via the HTTP protocol, providing access to resources via HTTP API interfaces.

This interaction method has the following advantages over the WebSocket API:

  • Single connection per request: Communication with the system via HTTP API is based on creating a separate connection for each request and terminating it after receiving a response from the server. In some cases, this simplifies interactions with the system by eliminating the need to monitor the stability of the connection without the risk of losing multiple created subscriptions due to a connection failure and then restoring them.
  • No state saving: Each request is treated by the system as an independent entity, unrelated to other requests, so that one request is processed independently of the others.
  • Single Array Data Transfer: HTTP API allows to get large volumes of data of interest (like a history of security market states) without the need to control the number of messages waiting in the connection buffer.

However, these advantages also become disadvantages of the HTTP API when it comes to high-intensity trading:

  • Bulk messages can burden client applications requesting data. For example, a request for list of securities may return a single text message of over 30 MB in response, which the recipient must be able to process in time;
  • The data is being updated at the rate specified by the client software. The selected rate may be lower than the actual rate at which data is updated in the trading system, which may negatively impact the productivity of bidding;
  • Frequent requests for large data amounts have a negative impact on the overall trading system performance stability. This may result in limiting the ability to interact with the system, including temporary suspension due to the system-threatening behavior.

HTTP API is fine to use when:

  • Large amounts of data need to be retrieved in a single request;
  • Historical data for a large period of time is required;
  • Trading is of low intensity and there is no need to send a large number of messages in a short period of time.

For all other cases, we recommend considering using the WebSocket API resources.

caution

Disruptive actions may result in the user being temporarily blocked regardless of the connection protocol chosen. We recommend, among other things, reading the [fair-use] guidelines (/api/usage/fair-use), which we expect all API users to follow.