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

Pdfcrowd Error: [503] Simultaneous API calls from a single IP are not allowed.

pixifi wrote on 2017-04-26:
Hey guys,
I'm on the ultimate plan, and my clients are getting this error
very often:
Pdfcrowd Error: [503] Simultaneous API calls from a single IP are not allowed.

Is there a way to remove this limit from my account
as my website is a multi-user website and at anytime
multiple people could be exporting .pdfs of invoices, contracts, questionnaires, etc...


thanks!
-T
support wrote on 2017-04-26:
Hello,

We rate limit the API to ensure fair distribution of capacity among users. You can learn more about the limitations here: <https://pdfcrowd.com/api/html-to-pdf-api/#api-ref-limitations>

If your application sends multiple API requests at a time, the service returns the 503 error. It is perfectly ok to sleep() for a few seconds and then resend the unsuccessful request. Here is an outline:
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)


The effectiveness of this solution depends on how many users will request a PDF at the same time but in our experience this works reasonably well in most cases.