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.
Measurement Record
What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.
- Request
- GET https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita
- Result
- HTTP 200 · application/json · 17,762 bytes · compressed
- Response time
- 262 ms (median of 3) · fastest 258 ms
- Transport
- TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Google Trust Services
- Browser CORS
- Allowed — Access-Control-Allow-Origin: *
- Served by
- cloudflare
- Recorded
- 2026-08-10
Fields Returned
Top-level fields present in the response we captured, with the type and value we actually received.
| Field | Type | Value received |
|---|---|---|
| drinks | array | [1 item] |
Captured Response
Captured from a real request to https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.
{
"drinks": [
{
"idDrink": "11007",
"strDrink": "Margarita",
"strDrinkAlternate": null,
"strTags": "IBA,ContemporaryClassic",
"strVideo": null,
"strCategory": "Ordinary Drink",
"strIBA": "Contemporary Classics",
"strAlcoholic": "Alcoholic",
"strGlass": "Cocktail glass",
"strInstructions": "Rub the rim of the glass with the lime slice to make the salt stick to it. Take care to moisten only the outer rim and sprinkle the salt on it. The salt shou…",
"strInstructionsES": "Frota el borde del vaso con la rodaja de lima para que la sal se adhiera a él. Procure humedecer sólo el borde exterior y espolvorear la sal sobre él. La sal…",
"strInstructionsDE": "Reiben Sie den Rand des Glases mit der Limettenscheibe, damit das Salz daran haftet. Achten Sie darauf, dass nur der äußere Rand angefeuchtet wird und streue…",
"strInstructionsFR": "Frotter le bord du verre avec la tranche de citron vert pour faire adhérer le sel. Veillez à n'humidifier que le bord extérieur et à y saupoudrer le sel. Le …",
"strInstructionsIT": "Strofina il bordo del bicchiere con la fetta di lime per far aderire il sale.\r\nAvere cura di inumidire solo il bordo esterno e cospargere di sale.\r\nIl sale d…",
"…": "(37 more fields)"
}
]
} 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 Implementation Example
Calls a real endpoint of this API. Replace any placeholder credentials with your own key.
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
Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.
Measured Score Breakdown
Live HTTP request to the API endpoint
Fully tested on Aug 10, 2026
Technical Specifications
Related Tags
Similar APIs
View All →Chomp
The Chomp API provides detailed nutritional data for millions of grocery products and restaurant menu items, including macros, ingredients, and allergen flags.
Edamam nutrition
The Edamam Nutrition Analysis API parses natural-language food descriptions such as "1 cup of oatmeal" or "200g chicken breast" and returns detailed nutritional breakdowns including calories, macros, vitamins, and minerals.
Edamam recipes
⭐ Beginner's PickThe Edamam Recipe Search API lets you search a database of over 2 million recipes filtered by ingredients, diet labels such as vegan or keto, meal type, and cuisine.
Kroger
The Kroger API gives developers access to product catalog data, pricing, store locations, and promotions from one of the largest US grocery chains.
LCBO
The LCBO API provides access to the Liquor Control Board of Ontario product catalog, including wines, spirits, and beers sold in Ontario, Canada.