Hello ladies and gentlemen,
I registered on https://api-ninjas.com a free account which includes 50k free API requests to use Image2Text API.
In order to use it, I created a “Shell” object and this is the code that I’m working with, in my application:
Shell3.ExecuteMode = Shell.ExecuteModes.Asynchronous
Shell3.Execute("curl -X ""POST"" -H ""Content-Type:image/png"" -H ""X-Api-Key:" + App.ap1key + """ --data-binary ""image@temp.png"" https://api.api-ninjas.com/v1/imagetotext")
I’m using Shell.Execute and curl also in other parts of my program where it is working totally fine. Just in this case, I experienced a lot of issues.
I can tell from the response that I receive that I’m at least successfully authenticated, but I get a JSON response with this error message: Text could not be extracted from your image. Please select another image or try again.
This message is complete bullsh*t because I verified it online on their website and the API is totally capable of extracting text from exact that same image.
Here on this page, you can upload an image and try the API service for free. But you could also just register a free account with 50k requests for free without subscription.
If anybody could help me solve this problem, I’d be very thankful.
By the way, I think it has something to do with the curl command and its parameters, or the developer of said API is just a fool.
Also, I could verify that -d
parameter for curl takes files with absolute and relative path. People claimed that on Stackoverflow and other users just confirmed that it is true.