What http status code does the API respond with when over the daily limit?

I want to know this so I can programmatically handle it in my application in the extreme edge case it needs to make over 500 requests in one day. Or does it still return a 200 but the throttled error message inside body response? I looked in the documentation but couldn’t find this information.

Thank you.

^This one.

If you want to test it, you can use the free-for-all “helloworld” ocr api apikey. It allows only 10 calls per IP per day, so you reach the rate limit threshold quickly and can test your code’s error handling.

Example: https://api.ocr.space/parse/imageurl?apikey=helloworld&url=http://i.imgur.com/fwxooMv.png

Thanks for answering.

  • When I tested the example URL provided (get request), after refreshing the page a few times I get an XML wrapped error string.
  • in my application I am using the POST https://api.ocr.space/parse/image endpoint, and wasn’t able to get the same error when testing with the helloworld key.
  • I get a 403 response when hitting that POST endpoint API successive times

Am I safe to assume 403 is an intentional throttle code on your end? Or what do you advise?

My requirement is to deduce when the API is failing due to throttling specifically, so that I can hold off sending any other requests (which would inevitably fail) until a certain period - say 24hr - has passed.

If the limit is reached, the string returned is
You may only perform this action upto maximum 10 number of times within 600 seconds

My Postman test:

If you see anything else, a screenshot of the Postman result would be helpful. You probably know it, but just in case: Postman is a free API test app, see Free OCR API

Thanks. I get the same result. Also with an http status code of 403.
It’s much simpler for me to detect the status code of the response, than parse out text. Especially since an expected result returns JSON.
For this reason I’d like to know if the 403 status is indeed a reliable indicator of being throttled. For example do you return it under any other scenario for an otherwise correct (resulting in a 200 response with documented json response)? If not I will just code my app to delay all requests on receiving a 403 response.

Yes, it is! Throttling results in 403 Forbidden.

By contrast, a simple OCR error (e. g. can not read text in image) still returns 200 with a JSON response and the error information inside the JSON.