I made the api request with axios with the following code , but the result is very different and incorrect from the web online version
const response = await axios.post(‘https://api.ocr.space/parse/image’, formData, {
headers: {
‘Content-Type’: ‘multipart/form-data’,
‘apikey’: process.env.NEXT_PUBLIC_OCR_API_KEY,
OCREngine : 2,
language: “eng”,
scale : "true
},
});
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.
I used scale=true but still it did not work.
Here is the image which i am using for testing(please note that it is only a specimen)
And here is the difference in results:
My Code : const response = await axios.post(‘https://api.ocr.space/parse/image’, formData, {
headers: {
‘Content-Type’: ‘multipart/form-data’,
‘apikey’: process.env.NEXT_PUBLIC_OCR_API_KEY,
OCREngine : 2,
SCALE : true
},
});
I tested the issue here, but can not recreate it.
=>If you test the connection with Postman, do you get the “good” or the “bad” result?
You probably know it, but just in case: Postman is a free app, see Free OCR API
If you see the problem even with Postman, a screenshot of the result could be helpful.