pipedream icon indicating copy to clipboard operation
pipedream copied to clipboard

OCR.space

Open sjn001tvh opened this issue 5 years ago • 3 comments

Greetings,

I found this api App as a free OCR Image to Text reader.

Link to developer documentation

https://ocr.space/OCRAPI https://www.npmjs.com/package/ocr-space-api-wrapper

Is lack of support preventing you from building workflows, or do you have a workaround? I have an image file within Dropbox. I create a shared link, but the link doesn't have the extension attached.

Are there specific actions, or triggers, you'd like to see for this app? Please let us know here or use the Action and Trigger issue templates to open requests for each!

The options would be any image file available such as jpg, png, etc. or PDF.

My nodejs code snippet

x_postUrl = "https://api.ocr.space/parse/image/" x_imageUrl = "https://content.dropboxapi.com/apitl/1/A5_KJq5SRCjSY-qvW9m9C6h54UPqpZFBOj-1ZnPez_PCqqJAshPNn5gHloj6T2O4NSrb-jL2Zwgiq-47RV3Pcb2MgizILhJwgLDF6flVAAn-1Gv1440bab8ymdRHto3CpQIGU5RwAlQ4EAhHZ0UZLqOyiHgAv3x3vXfSNqaFpviHzG9B2VblKrbpS9KGT31ffzXweW6TL2zUEuNlfHUtc_nzjoZUSJOGOuRQcUA79Lt-iCz3pmYgNW2BcPSQn5TX1II33v2Ong1BqRX-uM4a6QBEJWuN46xrKmcKkESPN0MMQvdNbwE_SR6hUl_jHfdf6IXSSQXKch3ZORgQ-yFbQZDCWVvr-UQFmmobGjvAtZk_e8wXkECym046tA5C-E4AyEN6XGfUCvgB199XPv31w572a1WFJfW415tdP2yUzGEs1bkfNqx-JHe47kUMn5ZB0-ex98hytzaf7F78Ui9kdnw0oho3vicIj2g06-6G8wBweQ" x_postLanguage = "eng" x_detectOrientation = "false"

x_serviceAPIKey = "8059f601af88957"

this.resp = await require("@pipedreamhq/platform").axios(this, { method: "post", url: ${x_postUrl}, headers: { "content-type": application/json, "apikey": 8059f601af88957 }, data: { "url": ${x_imageUrl}, "language": "eng" } })

When I run this code, I get the response

Unable to detect the file extension, or the file extension is incorrect, and no 'file type' provided in request. Please provide a file with a proper content type or extension, or provide a file type in the request to manually set the file extension.

You will notice that the shared link that I obtain from Dropbox (x_imageUrl) does not carry with it the file extension.

I hope this is helpful. I was able to generate the response if I did it manually from Chrome. However, it would not return the data from OCR.space because of CORS. The shared link (x_imageUrl) does not carry with it the Authorization key from Dropbox, so it generated a CORS error. In order to securely bypass CORS, I needed a proxy server, and that's where Pipedream would work perfectly for this type of api call.

Thanks,

Scott.

sjn001tvh avatar Oct 11 '21 21:10 sjn001tvh

Hi @sjn001tvh we just added OCR.space as an integrated app on Pipedream: https://pipedream.com/apps/ocrspace

Let us know if this helps unblock your implementation!

dannyroosevelt avatar Oct 12 '21 23:10 dannyroosevelt

Thanks for the response. I'm having a few issues generating the url file link from Dropbox.  And I'm trying to work with them to resolve that particular issue.  But this api call will help when I finally get the url link to the image file. Thanks again, Scott. On Tuesday, October 12, 2021, 04:02:05 PM PDT, Danny Roosevelt @.***> wrote:

Hi @sjn001tvh we just added OCR.space as an integrated app on Pipedream: https://pipedream.com/apps/ocrspace

Let us know if this helps unblock your implementation!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

sjn001tvh avatar Oct 13 '21 18:10 sjn001tvh

I'm closing this since the app is integrated, but let us know if you have any issues or questions about the integration

dylburger avatar Oct 20 '21 23:10 dylburger