NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

Cocktail API

The Cocktail API allows you to search thousands of cocktail recipes by name or ingredients.

(4.4)

From 7,417 users

2,400+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
164ms210ms255ms610ms893ms

Similar APIs

Didn't find what you were looking for? Suggest an improvement


/v1/cocktail GET

https://api.api-ninjas.com/v1/cocktail

Returns up to 10 cocktail recipes matching the search parameters.

Parameters

At least one of the following parameters must be present:

  • name  optional

    Name of cocktail. This parameter supports partial matches (e.g. bloody will match bloody mary and bloody margarita).

  • ingredients  optional

    Comma-separated string of ingredients to search. Only cocktails containing all listed ingredients will be returned. For example, to search cocktails containing Vodka and lemon juice, use vodka,lemon juice.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.

  • name

    Name of the cocktail.

  • ingredients

    Array of ingredient strings with measurements.

  • instructions

    Instructions for preparing the cocktail.

Sample Request Live Demo!

name

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/cocktail?name=bloody mary

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    {
      name:"Bloody Mary",
      ingredients:[
        "4.5 cl (3 parts) vodka",
        "9 cl (6 parts) Tomato juice",
        "1.5 cl (1 part) Lemon juice",
        "2 to 3 dashes of Worcestershire Sauce",
        "Tabasco sauce",
        "Celery salt",
        "Black pepper"
      ],
      instructions:"Stirring gently, pour all ingredients into highball glass. Garnish."
    }
]

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/cocktail?name=bloody%20mary" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the Cocktail API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • Use the ingredients parameter with a comma-separated list, such as vodka,lemon juice, and only cocktails containing all listed ingredients are returned. For food recipes built from ingredients, see the Recipe API.
  • No, the name parameter supports partial matches, so searching bloody returns both bloody mary and bloody margarita. You can browse other endpoints in our API catalog.
  • Each object in the JSON array includes the cocktail name, an ingredients array of strings with measurements, and instructions for preparation. To get nutritional breakdowns for those ingredients, pair it with the Nutrition API.
  • The /v1/cocktail endpoint returns up to 10 recipes matching your search parameters per request. Higher request volumes are covered by our paid plans on the pricing page.