Cocktail API
The Cocktail API allows you to search thousands of cocktail recipes by name or ingredients.
From 7,417 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 164ms | 210ms | 255ms | 610ms | 893ms |
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:
nameoptionalName of cocktail. This parameter supports partial matches (e.g.
bloodywill matchbloody maryandbloody margarita).ingredientsoptionalComma-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-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
nameName of the cocktail.
ingredientsArray of ingredient strings with measurements.
instructionsInstructions for preparing the cocktail.
Sample Request Live Demo!
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 maryHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
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
Can I use the Cocktail API for commercial purposes?
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.How do I get an API key and start using the Cocktail API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
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.What happens if a request to the Cocktail API fails?
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.How do I search for cocktails by their ingredients?
Use theingredientsparameter with a comma-separated list, such asvodka,lemon juice, and only cocktails containing all listed ingredients are returned. For food recipes built from ingredients, see the Recipe API.Does the name parameter require an exact cocktail name?
No, thenameparameter supports partial matches, so searchingbloodyreturns bothbloody maryandbloody margarita. You can browse other endpoints in our API catalog.What fields are included in each cocktail result?
Each object in the JSON array includes the cocktailname, aningredientsarray of strings with measurements, andinstructionsfor preparation. To get nutritional breakdowns for those ingredients, pair it with the Nutrition API.How many cocktail recipes does a single request return?
The/v1/cocktailendpoint returns up to 10 recipes matching your search parameters per request. Higher request volumes are covered by our paid plans on the pricing page.