TL;DR
TheCocktailDB (used by App Brewery's mocktail app) is a community-driven database of cocktail recipes from around the world. Search by drink name, main ingredient, or category to get full recipes with exact measurements, ingredients, glassware recommendations, and mixing instructions. It covers classics like the Margarita and Mojito alongside creative modern concoctions.
Quick start: https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita
No API key needed — just make a request!
How to Use This API
1. Search by Name
Find the Margarita recipe:
https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita
Returns full recipe: ingredients (tequila, triple sec, lime juice), measurements, glass type (Cocktail glass), mixing instructions, and even an image URL.
2. Search by Ingredient
https://www.thecocktaildb.com/api/json/v1/1/filter.php?i=gin
Lists all cocktails that contain gin — from Martini to Negroni.
3. Random Cocktail
https://www.thecocktaildb.com/api/json/v1/1/random.php
Great for a "surprise me" feature in your bartending app.
4. List by Category
https://www.thecocktaildb.com/api/json/v1/1/filter.php?c=Cocktail
Filter by categories like "Cocktail", "Shot", "Beer", "Milk / Float", "Punch / Party Drink", "Ordinary Drink", etc.
5. JavaScript — Recipe Search
async function searchCocktail(name) {
const resp = await fetch(
`https://www.thecocktaildb.com/api/json/v1/1/search.php?s=${name}`
);
const data = await resp.json();
if (!data.drinks) return null;
const drink = data.drinks[0];
const ingredients = [];
for (let i = 1; i <= 15; i++) {
const ing = drink[`strIngredient${i}`];
const meas = drink[`strMeasure${i}`];
if (ing) ingredients.push(`${meas || ''} ${ing}`.trim());
}
return {
name: drink.strDrink,
instructions: drink.strInstructions,
ingredients,
glass: drink.strGlass,
image: drink.strDrinkThumb
};
}
searchCocktail('mojito').then(console.log);
6. Python — Get Random Cocktail
import requests
resp = requests.get(
'https://www.thecocktaildb.com/api/json/v1/1/random.php'
)
drink = resp.json()['drinks'][0]
print(f"{drink['strDrink']} ({drink['strAlcoholic']})")
print(f"Glass: {drink['strGlass']}")
print("Ingredients:")
for i in range(1, 16):
ing = drink[f'strIngredient{i}']
meas = drink[f'strMeasure{i}']
if ing:
print(f" {meas or ''} {ing}".strip())
print(f"\nInstructions: {drink['strInstructions']}")
https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita
Frequently Asked Questions
- Is the demo API key (1/1) always available?
- Yes,
/api/json/v1/1/is the free test key for development. It has rate limits (about 150 requests per day per IP). For production, get a free key from TheCocktailDB website. - How many cocktails are in the database?
- Over 600 cocktail recipes with full ingredient lists, measurements, and instructions. New recipes are added regularly by the community.
- Are non-alcoholic mocktails included?
- Yes! Filter by
a=Non_Alcoholicto get mocktails only. ThestrAlcoholicfield indicates "Alcoholic" or "Non alcoholic". - Does it include nutritional information?
- No, the API does not return calorie counts or nutritional data. It focuses on ingredients, measurements, and preparation instructions.
- Can I browse by glass type?
- Yes, use
filter.php?g=Highball_glassor similar. Common glass types: Cocktail glass, Highball glass, Old-fashioned glass, Collins glass, Shot glass, Wine Glass, etc. - Does it support image retrieval?
- Yes, each drink has a
strDrinkThumbURL for a photo of the cocktail. Use it as an image source in your app for a polished look.
API Details
- API URL
https://www.thecocktaildb.com/api/json/v1/1/- Documentation
- www.thecocktaildb.com/api.php
- Category
- Food
- Authentication
- Not Required (uses demo key "1")
- Geographic Coverage
- Global — cocktails from around the world
What You Can Build
- Bartender's companion app with search-by-ingredient functionality
- Party planner that suggests cocktails based on available spirits
- "What can I make?" tool — enter your ingredients, get matching recipes
- Daily cocktail suggestion widget for home bars
- Mocktail finder for non-alcoholic party beverages