• 1
  • 16
  • 17
  • 18(current)
  • 19
  • 20
TheCocktailDB.com - An Open Cocktail Database with API
No, you should never query an entire db at once it would be very inefficient and painfully slow for the user interface even with lazy loading.

Use the filters for ingredients and create category buttons in your app. Then list the cocktails to browse, then do another lookup on the ID once a user clicks on the cocktail for the details.
Reply
(2021-02-07, 22:55)docwra Wrote: No, you should never query an entire db at once it would be very inefficient and painfully slow for the user interface even with lazy loading.

Use the filters for ingredients and create category buttons in your app. Then list the cocktails to browse, then do another lookup on the ID once a user clicks on the cocktail for the details.

Thank you! Smart I didn't think of it like that!
Reply
Hello, 


I'm currently having a CORS issue within local dev environment (requests coming from http://localhost:3000) and it doesn't look like the API allows for requests to come from this URL.  Is there anyway to update the CORS policy to allow this?  If not, do we need to email a URL which can be hosted in order to be added to the CORS whitelist?


Thanks in advance!
Reply
Why do I get the error "AppId is over the quota" after paying? I used the key assigned to me
Reply
(2021-05-17, 18:42)uzumwmy Wrote: Why do I get the error "AppId is over the quota" after paying? I used the key assigned to me
There are no quotas, so not sure where you are getting that error from. Its not our site providing it.
Reply
This is a great API! I'm using it for a bootcamp project, but I had a question--

when searching by first letter like so:

https://www.thecocktaildb.com/api/json/v...ch.php?f=a

is there a way to skip past the first 25? I want to try to get a list of all the A's from the data, but I'm stuck for the first 25. 


Thanks!
Reply
Hello, 

I would like to show all the output in german, is there a way to do so? 
also I need an api key please
Reply
Hello, I am potentially interested in becoming a Patreon supporter, but I first would like to know if it is possible to search using multiple queries, e.g. for vodka drinks that go in a cocktail glass (ingredient by name + by glass). If so, what is the URL format. Thanks!
Reply
(2021-11-18, 00:14)AlfieVidrio Wrote: Hello, I am potentially interested in becoming a Patreon supporter, but I first would like to know if it is possible to search using multiple queries, e.g. for vodka drinks that go in a cocktail glass (ingredient by name + by glass). If so, what is the URL format. Thanks!

Not possible to chain quieries sadly yet. Maybe in the next API version.

But you can of course make multiple calls to the API and filter that way on client side.
Reply
(2021-02-07, 22:55)docwra Wrote: No, you should never query an entire db at once it would be very inefficient and painfully slow for the user interface even with lazy loading.

Use the filters for ingredients and create category buttons in your app. Then list the cocktails to browse, then do another lookup on the ID once a user clicks on the cocktail for the details.
This is good advice in terms of huge databased, but in this case of this API, you can load the entire thing in about 2 seconds up-front as the app is starting, then never fire another network request for the life of the app (except to cache images).

What I do is do a load on first-start, save that to disk, and then load the cached data on startup next time, refreshing the db in the background after app has started up.  Gives a really awesome UX as there is no perceptible load time, it works well offline, search is instant etc.

If you want to take it further, you can pretty easily embed a cached version of the db right in the app itself, compressed the entire db is about 42kb.
Reply
In terms of loading the db at once, you can do something like:
```dart
final futures = 'abcdefghijklmnopqrstuvwxyz'.split('').map((char) => _sendRequest('search.php?f=$char'));
final results = await Future.wait(futures);
```
That will fire off 26 concurrent network requests, and load the entire db. It's very fast, and only transfers about 200kb (which is equal to like half of one image)
Reply
Hi wondering if anyone can help.  I'm currently in a coding bootcamp and am using the cocktailDB api as part of a project and I'm having an issue creating a dynamic link to a cocktail ingredient.  If I use the api to get details of an ingredient e.g. `https://www.thecocktaildb.com/api/json/v1/1/search.php?i=vodka`
I don't get the ingredient imageUrl.  I've tried constructing from the ingredient name, ie.`www.thecocktaildb.com/images/ingredients/${strIngredient}-Small.png`, but this only works for a few as there are a lot of other naming conventions.  Is there any api route  that includes the ingredient image path?

Thanks.
Reply
(2022-02-16, 17:31)tomfuller Wrote: Hi wondering if anyone can help.  I'm currently in a coding bootcamp and am using the cocktailDB api as part of a project and I'm having an issue creating a dynamic link to a cocktail ingredient.  If I use the api to get details of an ingredient e.g. `https://www.thecocktaildb.com/api/json/v1/1/search.php?i=vodka`
I don't get the ingredient imageUrl.  I've tried constructing from the ingredient name, ie.`www.thecocktaildb.com/images/ingredients/${strIngredient}-Small.png`, but this only works for a few as there are a lot of other naming conventions.  Is there any api route  that includes the ingredient image path?

Thanks.

Ingredient name should match the Image name exactly. You will need to encode the spaces though I think. Example:
 
Code:
https://www.thecocktaildb.com/images/ingredients/Vodka-Small.png
https://www.thecocktaildb.com/images/ingredients/Iced%20Tea-Small.png
Reply
Tongue 
Thanks for the API !

https://bb-lv.github.io/RudeBartender/



-Very small project, just trying to learn about api's and how to use them.

- Generates A random cocktail or your search of a cocktail in a mildly rude format, have fun.
Reply
Ha! thats pretty cool. Well done on making a nice little project.
Reply
  • 1
  • 16
  • 17
  • 18(current)
  • 19
  • 20

Logout Mark Read Team Forum Stats Members Help
TheCocktailDB.com - An Open Cocktail Database with API2