My OCR is not Working

My OCR app With OCR.space API isn’t Working.



The Text Is Returning null.
Please Help Me.

  1. Try changing the variable Vaue to null instead of true while defining it. (Perhaps Value is its name)
  2. Try getting the error part of the output and display it in a separate label from the Web API Get function.
  3. Check if your API key is correct or not.

Does the full url in your API Get call work in a browser (outside of Thunkable)? If so, post the full JSON response you’re getting as text (not a screenshot) and we can see if the way you’re parsing it is correct.

If it works in a browser, what happens if you set a text input’s text to the green response block? Can you copy the value that is displayed and paste it here?

1 Like

I changed the variable to null, added error blocks, I also Created My New API.
Still, the text is showing null

Here’s My URL
https://api.ocr.space/parse/imageurl?apikey=K86--------8957&url=http://Image URL

You need to change your blocks to the following

See my sample project
https://x.thunkable.com/projectPage/61d9a805c2bd1000108410a6

1 Like

Still It’s Showing “null”.

Even Yours With My API is not Working.


1 Like

It runs as expected with me
image

Check your API configuration and the way you parse the image URL with it.

2 Likes

Remember that API expects a fully qualified URL for the image and will not work with an image saved in your local machine or an image that is stored in the project assets. You need the image to be accessible from a web server or cloud storage.

My API was Working And Here’s my Code-


check your Project with Another API even That is showing null.

@muneer’s project works correctly with my free API key:

image

But I’m confused now… are your blocks working for you or not?

Part of the problem may be that you are assigning a boolean type (true) to the app variable Vaue and then later assigning it a text string type from the API response. Using multiple types in a single variable can cause problems.

Try removing the [true] block from the [initialize] block and see if that helps.

You’ve also removed the list block that @muneer told you you needed! :thinking:

Also, it’s hard to help you because you never answered my questions:

1 Like

Here’s When I tested the URL with a Sample Image URL, these Were The Results:



Please Give Me the Code So that I can Take The Result text Object.

Thanks, @muneer for Your Help!
There were Some mistakes I did But thanks for helping! :grinning: :grinning:

1 Like