Frequently asked questions¶
This page contains frequently asked questions about cTrader Open API and the answers. On this page you will find frequently asked questions by API users.
Why do I get the 429 error response?
The 429 error response means that the user has sent too many requests in a given period.
You can review the current request rate limitations on the Getting started page.
Why does my application get disconnected frequently?
Applications are disconnected by the server after a period of inactivity. To avoid getting disconnected from the server, make sure that you send a heartbeat to the server at least once every 10 seconds.
Why can I not connect to API during weekends?
Sometimes we do maintenance and upgrades during weekends, and the API is inaccessible during the maintenance period.
Why do I get errors in messages serialisation and deserialisation with Google Protocol Buffers?
Please read the Send and receive Protobuf messages tutorial.
Can I refresh my access token before its expiry?
Yes, you can refresh an access token before or after its expiry. To learn more, please consult the App and account authentication guide.
What is the expiration time of a refresh token?
The refresh token is valid forever until you use it to refresh an access token or if you re-authorise your cTrader ID and trading accounts.
What is the difference between a trading account's login number and ID?
The login number is used for UI purposes. It has no use case in the API. However, you may choose to display account login numbers in your application accounts list or equivalent control.
The trading account ID (ctidTradingAccountId) is the parameter used for sending and receiving several important API messages.
If there were no incoming ticks, will the cTrader backend still return trend bars for the period?
No, trend bars are only created if there are incoming ticks.
How do I get the latest bid and ask prices for a symbol?
To get the latest bid/ask prices, subscribe to ProtoOASubscribeSpotsReq. If the subscription is successful, you will receive a first ProtoOASpotEvent with the latest spot prices and then you will continue receiving price updates as new events are generated. If the markets are closed, you will only receive a single spot event with the closing prices.
How do I calculate profit and loss for a position?
Please read our Calculate profit and loss tutorial.
Can I use Open API on a client-side Web environment like a Web assembly app?
Yes, you can use the WebSocket protocol to connect to the API when accessing it in such environments.
From where should I get notified when there is a change in the API?
Please follow the Open API Proto message files repository and its releases.
How can I contribute?
You are encouraged to fork our SDKs to create your own Open API packages. If you think you have something worthwhile, please contact us and we will add your improvements to our official documentation.
Where should I ask for a new feature, message or question?
You can use either the Proto message files repository issues or the cTrader Discord community.
Need cTrader support?
Reach out through our official channels to resolve any issues:
- Ask questions and connect with traders, developers and other users in the cTrader Discord community.
- Browse archived discussions on the cTrader Community forum. While the forum is no longer open for new posts, it is full of helpful answers to common issues.
- Contact the cTrader support team at support@ctrader.com for technical assistance.