This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Simultaneous API calls from a single IP are not allowed.

stvogdn wrote on 2013-08-29:
I have been reviewing my system error log and I am finding a large number of these errors. Some of them are duplicate requests where the user may have clicked a link a second time while waiting for the pdf to generate, but a number of them are discrete requests that just happened to come in at the same time.

We have a global site with nine different language sites all running requests though our production server, so it is not unreasonable to believe that we are in fact generating near simultaneous requests. Is there any way around this limitation in the api.

Thanks,

Steve
support wrote on 2013-08-30:
Hello Steve,

To avoid the 503 error, it is perfectly ok to sleep() for a few seconds and then resend the unsuccessful API request. Here is a pseudocode example:
tries = 0
  success = False
  while not success:
     tries += 1
     try:
        call the API
        success = True
     catch (pdfcrowd.Error why):
         if tries == 5:
            some serious error, log or re-throw the exception
         else:
            sleep(1 or 2 seconds)


Hope this helps. You can learn more about the API limitations at http://pdfcrowd.com/api/html-to-pdf-api/#api-ref-limitations