TheCocktailDB API

⭐ Beginner's Pick Food & Drink / API Key Intermediate HTTPS CORS
Varies by plan (check documentation)

Overview

TheCocktailDB is a free cocktail recipe database with thousands of drinks from around the world. You can search by ingredient, name, or category to find the perfect cocktail. The free tier uses test API key '1' and covers most use cases for learning.

💡

Beginner Tip

Use the free test API key '1' to get started immediately—no registration required. Search by ingredient with ?i=vodka to find all cocktails that use that ingredient.

Available Data

recipe name and ingredients
nutritional values
calorie count
serving size
preparation time
Use case: Integrate cocktail recipes data into web and mobile applications

Example Response

JSON Response
{
  "recipe": "Chicken Stir Fry",
  "calories": 380,
  "protein_g": 32,
  "carbs_g": 28,
  "fat_g": 14,
  "ingredients": [
    "chicken breast",
    "bell pepper",
    "soy sauce",
    "garlic"
  ],
  "prep_time_minutes": 20
}

Field Reference

idDrink Unique identifier for the cocktail
strDrink Name of the cocktail
strCategory Cocktail category such as Ordinary Drink or Cocktail
strInstructions Step-by-step preparation instructions
strIngredient1 First ingredient (up to strIngredient15)
strDrinkThumb URL to the cocktail thumbnail image

Implementation Example

const url = "https://www.thecocktaildb.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized Missing or invalid API key in the URL path
Use '1' as the API key for free access: /api/json/v1/1/search.php
Empty drinks array (null) No cocktail matched the search term
Check the spelling of the cocktail name or try a partial name like 'mar' instead of 'margarita'
CORS error in browser Some browsers block HTTP requests from HTTPS pages
Use HTTPS endpoints (www.thecocktaildb.com) or make requests from a backend server

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 10/20
🔒 Security 15/15
🛠 Developer XP 17/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS YES
Category Food & Drink
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →