# How do I use TheCocktailDB in my project?

**URL:** <https://community.thunkable.com/t/how-do-i-use-thecocktaildb-in-my-project/1201427>\
**Category:** Questions about Thunkable X\
**Tags:** webapi\
**Created:** [April 1, 2021, 11:46pm UTC](https://community.thunkable.com/t/how-do-i-use-thecocktaildb-in-my-project/1201427 "2021-04-01T23:46:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottbrown46383u](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@scottbrown46383u](https://community.thunkable.com/u/scottbrown46383u)\
**Post date:** [April 1, 2021, 11:46pm UTC](https://community.thunkable.com/t/how-do-i-use-thecocktaildb-in-my-project/1201427/1 "2021-04-01T23:46:28Z")

</div>

I give up. I have watched the girls tutorial videos of using Api a dozen times and I do not see what I’m missing. I stumbled on a working combination of blocks a few days ago but ended up deleting everything.(Thunkable please add an undelete button.) I simply want to enter in a drink name then click the button. The app gets the drink name from text input searches for drink and gets drink instructions.

 ![Screenshot 2021-04-01 193014](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/6/06e9921fa9439a13f1a6d61fc5032c06673d7960.jpeg) ![Screenshot 2021-04-01 193110](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/8/88c910c332b18c00d32f50177bbf7d8843cac77b.jpeg) ![Screenshot 2021-04-01 193237](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/9/3916438e677e005627d781ee51834a52047afa5f.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:** [April 2, 2021, 12:16am UTC](https://community.thunkable.com/t/how-do-i-use-thecocktaildb-in-my-project/1201427/2 "2021-04-02T00:16:27Z")

</div>

So I’ll just say that APIs are **complicated**. What you’re wanting to do sounds easy and straightforward. And it’s not terribly hard relative to some APIs but it does take a few extra steps beyond what you’ve tried.

To start with, the JSON object is returning a property called “drinks” that contains an array. In Thunkable, you have to access this using list blocks. So just getting the value of “drinks” from the object, as you’ve done, isn’t going to work.

I know nobody wants to be told to go watch a video but I think you’ll find my tutorial pretty helpful:

> [@API JSON Tutorial (Video)](https://community.thunkable.com/t/api-json-tutorial-video/1140575):
>
> Using APIs in Thunkable and understanding how to parse JSON to get certain data from the API response is both a popular and a difficult aspect of using Thunkable. It’s not so much difficult because of Thunkable but because every API url format is different, every API documentation is different, every JSON response is different, etc. In this video, I spend a lot of time talking you through some best practices. It’s not a quick tutorial because if you rush through setting up an API in Thunkable, …

If that gets you a little further and you still have questions, post an update here…

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [April 2, 2021, 1:45am UTC](https://community.thunkable.com/t/how-do-i-use-thecocktaildb-in-my-project/1201427/3 "2021-04-02T01:45:13Z")

</div>

Try this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/7/f7bc4ea677ec3839b16838e82ded6725d5afb802.png)

I dealt with the fact that you’re getting multiple drink objects returned by just showing the first one. That may be the wrong choice, but at least this shows you how to get data out of that json array? 🙂

Now, let me tell you what I did:  
I looked at your sample JSON and saw that your outermost category was ‘drinks’, so I started with the stuff on the right: Get property “drinks” of object (get object from JSON response).  
Then I looked at what was inside drinks and saw the square brackets, which told me that what was in drinks was an array, so I handled that like a list, and just grabbed the first item (I’m going to call it your “first drink object”, ok?) from the list.  
Continuing to work inwards, I found inside { } a whole bunch of information about the first drink object, so I got property “strInstructions” of that drink object.

And there you have it. I’m working through the JSON from outside to inside, but building the blocks backwards, from right to left.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 2, 2021, 4:19am UTC](https://community.thunkable.com/t/how-do-i-use-thecocktaildb-in-my-project/1201427/4 "2021-04-02T04:19:55Z")

</div>

See this post talking about same API.

> [@API object of objects problem](https://community.thunkable.com/t/api-object-of-objects-problem/1195654/8):
>
> Thank you @Muneer yes I’ve understood this watching @Tatiang’s video (Thanks!)… stuck_out_tongue_winking_eye Thank you all my problem was to understand difference between List and Object access. So it is solved! For other people I attach my code block fixed Thank you all

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [April 2, 2021, 6:42am UTC](https://community.thunkable.com/t/how-do-i-use-thecocktaildb-in-my-project/1201427/5 "2021-04-02T06:42:13Z")

</div>

> [@scottbrown46383u](#):
>
> I have watched the girls tutorial videos of using Api a dozen times

Hey @scottbrown46383u - which video were you watching?

---

<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, 1:25pm UTC](https://community.thunkable.com/t/how-do-i-use-thecocktaildb-in-my-project/1201427/6 "2024-11-08T13:25:36Z")

</div>


