Need help learning how an API works

Hi all !

Following my last topic to retrieve data from an API, I managed to make it easier with the help of Dora_paz.

Only, I would like to be able to fully use all the possibilities of the API, which can be found at this address on GitHub:

I used the GET function with “random”, it works. But as soon as I do GET with “all” I get this error:

Could someone take some time to walk me through how to use this API please?

My goal for this small project is to have the following functions:

I want to learn how to use this API, so if any of you can explain how to do it, show me examples, etc … that would be great!

Thanks everyone!

My aia :
KaamelottCitation.aia (39.9 KB)

The guide I followed to display a random quote from the API: Guide: How to get JSON data from an Api using dictionaries (and show it on a dynamic cardview)

Different json needs different approach to get data

1 Like

Try this
KaamelottCitation_3.aia (146.3 KB)

Very good, thank you it works!

So as I understand it, this is what I want to recover, the way I want to recover data, I have to use different blocks.

Can’t I get the data back by doing GET all and use that to then do a random citation, or search?

Now with get all since you have all data in lists you can pick a random item from citation and using index in list get info from other lists. Similar way to create a custom search, if in list … find index … then …

1 Like

Thanks, I’ll try it all!

1 Like

I advance slowly, but surely. I’m blocking for the search system. I would like that if the user types the name of a character it displays all the quotes for that character. And if the user types part of a quote, it displays the quotes containing that part of the text.

I tried following a guide for the search bar, but it doesn’t work the way I want, here is the .aia:

KaamelottCitation.aia (271.0 KB)

Try this

KaamelottCitation_search1.aia (287.6 KB)

Thanks, it works. When I compare with what I tried to do, I was not on the right way. I’m slowly starting to understand how it works :slight_smile:

And with this method, I can start with a search or display all the quotes and then do a search, that’s cool!

I think you should do more testing before posting your aia file.

Some users of the community today have a lot of free time to make the blocks ready.

But will they always be here in the community? :thinking:

And will they always be with this availability?
Think about it…

I am experimenting, looking for a lot of tutorial and guide as well, and it’s because I can’t or don’t understand that I come to ask for help. I’m not asking to do it for me, but to help me understand.
If someone gives me a working aia, good, I study it to figure out what I missed :slight_smile: