Web version with engine 2 returns correct value but not the api version

The online ocr form uses scale=true in the OCR API call (default is scale=false). I think that is reason for the difference in OCR results that you are seeing.

If you still see a difference, please post a test image, and we will check it.