BYTETOOLS

TheCocktailDB API

Free cocktail recipe API with no signup: search drinks by name, ingredient or category, with instructions, measures, glass type and photos. Tested example.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-19

What is the TheCocktailDB API?

TheCocktailDB is a free drink recipe API providing cocktails with instructions, measured ingredients, glass type, category and photos. The developer test key `1` works without registration.

TheCocktailDB is TheMealDB's sibling, built by the same team with an identical schema. It covers cocktails and mixed drinks with instructions, ingredient measures, the recommended glass and whether the drink is alcoholic.

The shared schema is genuinely convenient: if you have already written a parser for TheMealDB's numbered ingredient fields, the same code works here with only the field prefix changed from `strMeal` to `strDrink`.

Quick facts

Base URL
https://www.thecocktaildb.com/api/json/v1/1
Authentication
Test key `1` in the URL path works for everyone with no registration.
Rate limit
No published limit on the test key.
Pricing
Free with the test key; Patreon supporters get a production key.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the TheCocktailDB API

Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.

1. Search for a cocktail by name

GET https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita

curl
curl 'https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita'
JavaScript (fetch)
const res = await fetch("https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200 (truncated)
{
  "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 should present to the lips of the imbiber and never mix into the cocktail. Shake the other ingredients with ice, then carefully pour into the glass.",
      "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 debe presentarse en los labios del imbibidor y nunca mezclarse en el cóctel. Agite los demás ingredientes con hielo y viértalos con cuidado en el vaso.",
      "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 streuen Sie das Salz darauf. Das Salz sollte sich auf den Lippen des Genießers befinden und niemals in den Cocktail einmischen. Die anderen Zutaten mit Eis schütteln und vorsichtig in das Glas geben.",
      "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 sel doit se présenter aux lèvres

Parameters

ParameterTypeRequiredDescription
sstringOptionalSearch drinks by name on /search.php. margarita
istringOptionalFilter by ingredient on /filter.php. gin
cstringOptionalFilter by category on /filter.php. Cocktail
astringOptionalFilter by alcoholic or non-alcoholic. Non_Alcoholic

Response fields

drinksarray|null
Array of drinks, or null when nothing matched.
drinks[].strDrinkstring
Drink name.
drinks[].strInstructionsstring
Mixing instructions.
drinks[].strDrinkThumbstring
Photo URL.
drinks[].strGlassstring
Recommended glassware.
drinks[].strAlcoholicstring
Alcoholic, Non alcoholic or Optional alcohol.
drinks[].strIngredient1-15string
Ingredients in numbered fields, with matching strMeasure values.

What you can build with the TheCocktailDB API

  • Build a cocktail recipe browser or bartending app
  • Suggest drinks based on ingredients the user already has
  • Filter non-alcoholic options for a mocktail feature
  • Add a random cocktail generator to a hospitality site

Common errors and how to fix them

drinks: null

No matches; null rather than an empty array.

Fix: Check for null before iterating.

Ingredient/measure mismatch

Some drinks list an ingredient with no measure.

Fix: Handle a missing measure gracefully rather than rendering 'null' or 'undefined' in the UI.

TheCocktailDB API — frequently asked questions

Is TheCocktailDB free?

Yes, the developer test key `1` is part of the URL and requires no registration. Patreon supporters get a production key with extra endpoints.

Can I search cocktails by ingredient?

Yes, use /filter.php?i=gin to find drinks containing an ingredient. This is the basis of the common 'what can I make with what I have' feature.

How do I find non-alcoholic drinks?

Use /filter.php?a=Non_Alcoholic. Each drink also carries a `strAlcoholic` field you can filter on client-side.

Does it use the same format as TheMealDB?

Yes, identical — including the numbered ingredient and measure fields. A parser written for one works on the other with only the field prefix changed.

Tools that pair with this API

TheCocktailDB is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.