# Google Books API

**URL:** <https://community.thunkable.com/t/google-books-api/812486>\
**Category:** Questions about Thunkable X\
**Created:** [September 12, 2020, 8:19pm UTC](https://community.thunkable.com/t/google-books-api/812486 "2020-09-12T20:19:55Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ianphaas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ianphaas/32/73941_2.png) [@ianphaas](https://community.thunkable.com/u/ianphaas)\
**Post date:** [September 12, 2020, 8:19pm UTC](https://community.thunkable.com/t/google-books-api/812486/1 "2020-09-12T20:19:55Z")

</div>

Hello,

I was wondering if anyone has any suggestions on how to use the Google Books API [(found here)](https://developers.google.com/books/docs/overview).

I have tried using this but I get a white screen.

I want the user to scan a ISBN bar code using the bar code scanner, the API would then tell me what books have been scanned.

I would appreciate any suggestions on how to do this.

Best,  
Ian

---

<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:** [September 12, 2020, 10:09pm UTC](https://community.thunkable.com/t/google-books-api/812486/2 "2020-09-12T22:09:22Z")

</div>

Can you provide an example of a URL you’ve used to get a JSON response from the Google Books API? A white screen usually indicates that you’re getting an error from the API server. But if you’re starting with a valid JSON response, we can probably help you parse the data you need. If you’re starting with an invalid JSON response (a 404 error, etc.) then that needs to get fixed before Thunkable is even a consideration.

---

<div class="post-metadata">

**Author:** ![ianphaas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ianphaas/32/73941_2.png) [@ianphaas](https://community.thunkable.com/u/ianphaas)\
**Post date:** [September 13, 2020, 12:10pm UTC](https://community.thunkable.com/t/google-books-api/812486/3 "2020-09-13T12:10:22Z")

</div>

Hello,

The URL I am using looks something like this, but varies by user: [https://www.googleapis.com/books/v1/volumes?q=isbn:9781524717582&key=myAPIkey](https://www.googleapis.com/books/v1/volumes?q=isbn:9781524717582&key=myAPIkey)

In the app if I set the API to search for a specific book, it returns the correct title. I assume it has something to do with searching by ISBN.

Best,  
Ian

---

<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:** [September 13, 2020, 5:44pm UTC](https://community.thunkable.com/t/google-books-api/812486/4 "2020-09-13T17:44:18Z")

</div>

The response I get from that URL using my API key is:

{  
“kind”: “books#volumes”,  
“totalItems”: 0  
}

And I see that that is a [valid ISBN number](https://www.google.com/search?safe=strict&q=sandapalooza+shake-up+9781524717582&stick=H4sIAAAAAAAAAONgFuLVT9c3NExPt8w1NSox0RLKTrbST8rPzwYTVpnFSXmPGIO5BV7-uCcs5TVpzclrjC5cWBQJ6XGxueaVZJZUCqlwCUqhmqrBIMXPhSrEs4hVuTgxLyWxIDEnP78qUaE4IzE7Vbe0QMHS3MLQ1MjE3NDc1MIIAErd2KmhAAAA&sa=X&ved=2ahUKEwjSua2O1-brAhVPvZ4KHSpiDJQQri4wInoECCMQKQ&cshid=1600018984856778).

That tells me the problem is possibly that you’re not checking for a return value of totalItems=0.

Can you post a screenshot of the API call blocks you’re using?

---

<div class="post-metadata">

**Author:** ![ianphaas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ianphaas/32/73941_2.png) [@ianphaas](https://community.thunkable.com/u/ianphaas)\
**Post date:** [September 13, 2020, 7:00pm UTC](https://community.thunkable.com/t/google-books-api/812486/5 "2020-09-13T19:00:40Z")

</div>

Here are the blocks that I am using.

 ![Screenshot 2020-09-13 135726](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/b/9b2135767b02bf3ca524d56dc2517e6f698d4581.jpeg)

---

<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:** [September 13, 2020, 7:31pm UTC](https://community.thunkable.com/t/google-books-api/812486/6 "2020-09-13T19:31:26Z")

</div>

You’re getting a white screen because you’re trying to retrieve a property that doesn’t exist (“item”). So you need an if/then to see if that property exists.

But the bigger issue — as you mentioned — is that the ISBN call isn’t returning the right information. That was the first time I’ve used Google Books API so I don’t know the answer to that.

I would focus on getting the url call to work in a browser before you do anything else in Thunkable.

---

<div class="post-metadata">

**Author:** ![ianphaas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ianphaas/32/73941_2.png) [@ianphaas](https://community.thunkable.com/u/ianphaas)\
**Post date:** [September 13, 2020, 7:31pm UTC](https://community.thunkable.com/t/google-books-api/812486/7 "2020-09-13T19:31:56Z")

</div>

Ok, I will work on this, thanks for your help!

---

<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:** [September 13, 2020, 7:38pm UTC](https://community.thunkable.com/t/google-books-api/812486/8 "2020-09-13T19:38:37Z")

</div>

> [@ianphaas](#):
>
> 9781524717582

You’re welcome. It’s weird because this works:

[https://www.googleapis.com/books/v1/volumes?q=isbn:0735619670](https://www.googleapis.com/books/v1/volumes?q=isbn:0735619670)

But if I substitute your ISBN, it returns 0 items.

---

<div class="post-metadata">

**Author:** ![ianphaas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ianphaas/32/73941_2.png) [@ianphaas](https://community.thunkable.com/u/ianphaas)\
**Post date:** [September 13, 2020, 7:39pm UTC](https://community.thunkable.com/t/google-books-api/812486/9 "2020-09-13T19:39:05Z")

</div>

Huh, apparently google does not like my book.

---

<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:** [September 13, 2020, 7:44pm UTC](https://community.thunkable.com/t/google-books-api/812486/10 "2020-09-13T19:44:28Z")

</div>

No, it doesn’t. It works with a few other ISBNs I tried. Did you write that book?

---

<div class="post-metadata">

**Author:** ![ianphaas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ianphaas/32/73941_2.png) [@ianphaas](https://community.thunkable.com/u/ianphaas)\
**Post date:** [September 13, 2020, 7:45pm UTC](https://community.thunkable.com/t/google-books-api/812486/11 "2020-09-13T19:45:37Z")

</div>

No. It was just a random book I found sitting around my house, its called Welcome to Wonderland, Sandapalooza Shake-Up.

---

<div class="post-metadata">

**Author:** ![ianphaas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ianphaas/32/73941_2.png) [@ianphaas](https://community.thunkable.com/u/ianphaas)\
**Post date:** [September 14, 2020, 10:16pm UTC](https://community.thunkable.com/t/google-books-api/812486/12 "2020-09-14T22:16:49Z")

</div>

I tested this using a different book with the same code on Thunkable and it worked. I think I will defiantly need to add code that checks if it returned a book before parsing before I update my currently published app to have this feature.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:23pm UTC](https://community.thunkable.com/t/google-books-api/812486/13 "2024-11-08T12:23:58Z")

</div>


