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.