Exponential Backoff
Exponential backoff is a standard algorithm that helps applications define a retry strategy for consuming a network service. This document outlines situations pertaining to Copyleaks server return error message:
- Error code 503: Service Unavailable. Typically, this error will appear when Copyleaks is undergoing a maintenance period. You can be notified for these events using https://status.copyleaks.com by subscribing to alerts. We broadcast a message days prior to the event time so users will be able to make preparations in advance.
- Error code 5xx: Internal errors. There is an issue pertaining to Copyleaks’ service and\or the network.
- Error code 429: Too many requests. Copyleaks, like other REST API services, has a rate limit policy that defines the maximum calls that can be made. Exceeding the maximum calls repeatedly will lead to temporary/permanent blocks.
The Algorithm
For these errors, we recommend implementing a retry algorithm by doing the following:
- Make a request to Copyleaks API.
- If the requests fail, wait 1 +
rand_seconds_number
seconds. Then, retry. - If the requests fail, wait 2 +
rand_seconds_number
seconds. Then, retry. - If the requests fail, wait 4 +
rand_seconds_number
seconds. Then, retry. - If the requests fail, wait 8 +
rand_seconds_number
seconds. Then, retry. - ...
- And so on, up to
max_time
seconds. - Wait
max_time
and retry. - …
Definitions:
rand_seconds_number
- Is a random number with a value between 1 to 10. max_time
- Is the maximum number of seconds to wait. Wait up to 64 seconds.
To ensure superior API performance that consumes reasonable resources for both the user and Copyleaks, users must use Copyleaks’ advanced retry protocol.

Do you have a technical question?
Use stackoverflow.com to get help from our development team and other Copyleaks users.