# OCR API and search results don't show expected output

**URL:** <https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, help\
**Created:** [May 19, 2023, 3:00am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533 "2023-05-19T03:00:34Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 22, 2023, 7:04am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/21 "2023-05-22T07:04:15Z")

</div>

You’re welcome. Google has an [OCR service](https://cloud.google.com/vision/docs/ocr). It seems to work well from my very limited testing. Here’s what it responded with from your sample image:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/4/9446aa38a554d4a17e729e35f4241aedb1ce18aa.png)

You can see the “description” property is **SBA 1234A** which is what is in your Google Sheet.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 22, 2023, 7:06am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/22 "2023-05-22T07:06:48Z")

</div>

It even succeeded with this blurry [license plate image](https://upload.wikimedia.org/wikipedia/commons/5/5e/Heavy_goods_vehicles_licence_plate.jpg):

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/2/42d8fd7c616329ff1e4f3b15b96ca26ec6766acd.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/0/1049d8ba84b4efbdd2034ec0dae29c88358ea9d0.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 22, 2023, 7:11am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/23 "2023-05-22T07:11:48Z")

</div>

I just had to try one more! It even did a perfect OCR reading of this [complicated image](http://1.bp.blogspot.com/_7ns0Ylzn8aA/TIeajMZjhwI/AAAAAAAAEaM/4NxLbLfhESs/s400/signs7.jpg):

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/9/19fddd0c60809898321dece4d2f810211c86ffe1.jpeg)

The JSON response for “description” was:

**8%\nNEXT 3\nMILES\n\<-YOU ARE HERE\nFIRST MILE 55 MPH OK\nSECOND MILE 45 TO 35 CURVES\n15 MPH CURVE 2 MILES\n25 MPH CURVES LAST MILE**

Replacing the \n characters with actual newlines:

**8%**  
**NEXT 3**  
**MILES**  
**\<-YOU ARE HERE**  
**FIRST MILE 55 MPH OK**  
**SECOND MILE 45 TO 35 CURVES**  
**15 MPH CURVE 2 MILES**  
**25 MPH CURVES LAST MILE**

---

<div class="post-metadata">

**Author:** ![guanrong33wm9m](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@guanrong33wm9m](https://community.thunkable.com/u/guanrong33wm9m)\
**Post date:** [May 22, 2023, 7:28am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/24 "2023-05-22T07:28:45Z")

</div>

Is the Google OCR compatible on Thunkable?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 22, 2023, 7:38am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/25 "2023-05-22T07:38:19Z")

</div>

I don’t see why not… most APIs work with Thunkable. But I’ve never tried that one in Thunkable.

---

<div class="post-metadata">

**Author:** ![guanrong33wm9m](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@guanrong33wm9m](https://community.thunkable.com/u/guanrong33wm9m)\
**Post date:** [May 23, 2023, 2:14am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/26 "2023-05-23T02:14:45Z")

</div>

But how come this project can work from steps 1 to 5 when the OCR service that we use is the same for both this project and the previous project?  
[https://www.kapwing.com/646c20bd0a6c420011d0b7a1/studio/editor](https://www.kapwing.com/646c20bd0a6c420011d0b7a1/studio/editor)  
[https://x.thunkable.com/copy/97624fd5e1ba661f8bdfef575e840e89](https://x.thunkable.com/copy/97624fd5e1ba661f8bdfef575e840e89)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 23, 2023, 2:35am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/27 "2023-05-23T02:35:16Z")

</div>

I don’t understand what you mean. You have one Thunkable project that works with the OCR API and one that does not? If so, can you post both links and mention which one works and which one does not?

---

<div class="post-metadata">

**Author:** ![guanrong33wm9m](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@guanrong33wm9m](https://community.thunkable.com/u/guanrong33wm9m)\
**Post date:** [May 23, 2023, 2:40am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/28 "2023-05-23T02:40:56Z")

</div>

[https://x.thunkable.com/copy/3ccef3a06de6387c2419d8b7920a2b3d](https://x.thunkable.com/copy/3ccef3a06de6387c2419d8b7920a2b3d)  
This works  
[https://x.thunkable.com/copy/6b42836309b2ed1559f8e88d8742c05f](https://x.thunkable.com/copy/6b42836309b2ed1559f8e88d8742c05f)  
This doesn’t work when we press the scan button and after taking photo of the plate numbers, it still shows error even though the plate numbers have already been registered inside my Google Sheet.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 23, 2023, 3:31am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/29 "2023-05-23T03:31:44Z")

</div>

When I Live Test both of those projects on my iPhone 13 Pro in Thunkable Live, I get different values for “ParsedText” depending on how I take the photo even though it’s the same license plate image each time.

I find it helpful to add a Text Input at the top of the screen and assign the green [response] block to it so that when the JSON response is displayed, you can copy it and paste it into a JSON viewer if needed.

I feel like a broken record but… **you’re going to need a better OCR API**

---

<div class="post-metadata">

**Author:** ![guanrong33wm9m](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@guanrong33wm9m](https://community.thunkable.com/u/guanrong33wm9m)\
**Post date:** [June 19, 2023, 5:17am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/30 "2023-06-19T05:17:19Z")

</div>

I’ve done some changes to this app but now I want to reduce the time needed for the user to wait for the screen to load finish before displaying the plate number and after the user takes a photo of the plate number? We are just trying to reduce the time needed for the textbox to display the plate number after the user takes a photo using the scan button only

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/d/cd89d5ce26647eb47c3b68c74a03289ba2566536.png)

[https://x.thunkable.com/copy/953ffffc431eb24d444daba43ce97011](https://x.thunkable.com/copy/953ffffc431eb24d444daba43ce97011)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [June 19, 2023, 5:28am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/31 "2023-06-19T05:28:38Z")

</div>

Here’s the slow part:

 ![Screenshot 2023-06-18 at 10.21.17 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/e/1e7a98dc58b77a0a8ac774f4b56d7834f3c70c9b.png)

Uploading an image to Cloudinary and getting a url back can take as much as 10-15 seconds.

In the Files drawer, there is a Resize Image block. Please try resizing the image to see if that helps:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/3/93f65c2dc8654ef3a3f804e13cee734bbac3c348.png)

You’ll have to try different size and quality settings to see what works best for your app.

After doing that, I would remove the wait 7 seconds block. A better idea would be to right-click on the `url from uploaded image` and choose Show Advanced Block and set up your blocks like this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/4/342b47fbdc31892127e36cc6b7d8087aedbb4b96.png)

That way, you don’t have to guess how long the Cloudinary upload takes… once it’s done, the “do” section will fire which includes the `ocr` function block.

Same thing with your `ocr` function, by the way… instead of waiting 7 seconds, just put everything in the “do” section so that it happens after the API call is finished.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [June 19, 2023, 5:36am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/32 "2023-06-19T05:36:48Z")

</div>

The few photos I took using the resize block took on average **1 second** to upload to Cloudinary. I used these blocks to display the duration:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/1/41cbbf68d7ec69268db2038989fb95c5f202df81.png)

---

<div class="post-metadata">

**Author:** ![guanrong33wm9m](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@guanrong33wm9m](https://community.thunkable.com/u/guanrong33wm9m)\
**Post date:** [June 19, 2023, 7:26am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/33 "2023-06-19T07:26:11Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/e/7ee912c1ddcf416e7b00560a8cdbc3d18ed269c8.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/9/6945862ac51ffcb0a33db96f2c865e73ef8e992d.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/1/21ae0c1a5e5497a91b843bec586fc67e20fe15cc.png)  
Now the time to upload to cloudinary has been cut significantly shorter, but the status doesn’t show anything after uploading to cloudinary, what should I do in order for the status to show after the image gets uploaded onto Cloudinary?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [June 19, 2023, 4:17pm UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/34 "2023-06-19T16:17:37Z")

</div>

I don’t know what you mean by “in order for the status to show” but I can tell you that you need to put **all** of the blocks you want to happen after the file is uploaded to Cloudinary inside the “do” section of the upload file block. Otherwise, blocks below the upload file block happen immediately after the file **starts** uploading.

---

<div class="post-metadata">

**Author:** ![guanrong33wm9m](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@guanrong33wm9m](https://community.thunkable.com/u/guanrong33wm9m)\
**Post date:** [June 20, 2023, 2:08am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/35 "2023-06-20T02:08:39Z")

</div>

Our app works when the user takes a photo of a license plate number that has already been registered into our Google Sheet and upon pressing tick to confirm the image, the photo will then be automatically be uploaded into Cloudinary and the license plate will then be automatically displayed in the textbox beside the search button. After displaying in the textbox, I want the status bar to automatically show whether the license plate has been registered or not without the user pressing the search button, how do I enable this function?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/1/119134310b71c6fbec13f43f8ca45139c6eb01b8.png)

[https://x.thunkable.com/copy/cc71b0333202e055a3db29578bda2570](https://x.thunkable.com/copy/cc71b0333202e055a3db29578bda2570)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [June 20, 2023, 2:33am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/36 "2023-06-20T02:33:50Z")

</div>

Do your SEARCH blocks work? If so, just move them to the “do” section of the “ocr” function so that they happen automatically after that.

---

<div class="post-metadata">

**Author:** ![guanrong33wm9m](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@guanrong33wm9m](https://community.thunkable.com/u/guanrong33wm9m)\
**Post date:** [June 20, 2023, 2:54am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/37 "2023-06-20T02:54:40Z")

</div>

Our search function doesn’t work. What should I do?

[https://x.thunkable.com/copy/a1caeb5fa50686090b9fbc23d0d05288](https://x.thunkable.com/copy/a1caeb5fa50686090b9fbc23d0d05288)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [June 20, 2023, 4:19am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/38 "2023-06-20T04:19:12Z")

</div>

It’s hard to know because I still don’t know if you found a better OCR API. With the one you were using, your search function is never going to work consistently.

If you’d like more help from me, please send me a private message. I’ve offered a lot but at this point, we would need to work out a consulting plan for this extensive amount of help.

---

<div class="post-metadata">

**Author:** ![guanrong33wm9m](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@guanrong33wm9m](https://community.thunkable.com/u/guanrong33wm9m)\
**Post date:** [July 11, 2023, 4:17am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/39 "2023-07-11T04:17:41Z")

</div>

I’m trying to understand what the blocks mean, so the seconds since 1970 and the app variable startTime helps to decrease the time to upload to Cloudinary to 1 second, but what about the resize image block? How does the resizing of the image increase the speed of OCR?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [July 11, 2023, 6:26am UTC](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533/40 "2023-07-11T06:26:13Z")

</div>

The seconds since 1970 block and startTime variables are **only** for calculating how long something takes in Thunkable.

I had suggested that resizing your photo before uploading it to Cloudinary would reduce the amount of time it takes to upload to Cloudinary.

[Previous page](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533.md?page=1)

[Next page](https://community.thunkable.com/t/ocr-api-and-search-results-dont-show-expected-output/2425533.md?page=3)
