Frequently Asked Questions¶
In this page you will find frequently asked questions by API users
Why do I get 429 error response?¶
The 429 error response means that the user has sent too many requests in a given amount of time.
API endpoints or subjects to some limitation, you can find them here
Why does my application get disconnected frequently?¶
Applications are disconnected by the server after some time of inactivity. In order to avoid getting disconnected from the server, make sure that you send a heartbeat to the server at least once every 10 seconds.
Why I can't connect to API during weekends?¶
Sometimes we do maintenance and upgrades during weekends, and the API will be down during the maintenance time.
Why do I get invalid route error?¶
Most probably you are using invalid endpoint, be sure to use the live endpoint for live trading accounts and demo endpoint for demo trading account, for more about endpoints check here.
Why do I get errors in messages serialization/deserialization with Google Protocol Buffers?¶
Please read the sending/receiving tutorial.
Can I refresh my access token before its expiry?¶
Yes, you can refresh an access token before or after its expiry.
For how long the refresh token is valid?¶
Forever, there is no time limit for a refresh token, it will be invalidated if you use it to refresh an access token or if you re-authorize your cTrader ID and trading accounts.
What's the difference between a trading account's login number and ID?¶
The login number is used for UI purpose, it has no use case on the API.
You can use a trading account's login number on your application accounts list, for user.
The trading account ID is the one that you will use for sending/receiving API messages.
If there was no ticks coming then there will be trend bars for that time period or not?¶
No, there will be no trend bars, the trend bars will only be created if there was tick data coming.
How to get all symbols latest bid/ask prices?¶
To get all symbol latest bid/ask prices use the ProtoOASpotEvent, it returns the latest bid/ask prices of your subscribed symbols even if market is closed.
How to calculate a position profit/loss?¶
Please read our profit/loss calculation tutorial.
Can I use Open API on a client side web environment like web assembly apps?¶
Yes, you can use Open API web socket endpoints and connect to API with web socket instead of a TCP connection.
From where should I get notified when there is change in API or proto messages?¶
Please follow Open API Proto message files repository and it's releases.
How can I contribute?¶
Please develop library or package for Open API on your favorite programming language and ask us to add it on documentation SDKs page.
Where should I ask for a new feature/message/question?¶
You can use Proto message files repository issues or cTrader forum Open API section.
Is there any way to increase the current API endpoints limit for my app?¶
It's possible if your app trading volume is high enough, please contact us via email.