Get a Random Cocktail

Learn how we can get a random cocktail recipe using this API.

There are times when we want to drink something but are not sure what we should go for. This is the kind of situation where we can use this endpoint to get the recipe for a random cocktail. The base URI of this endpoint is https://www.thecocktaildb.com/api/json/v1/1/random.php.

Query parameter

This endpoint does not require any query parameter.

Search for a random cocktail

We simply call the base URI to get a random cocktail. The code below shows how we can call this endpoint.

Press + to interact
import json
import requests
url=('https://www.thecocktaildb.com/api/json/v1/1/random.php')
response = requests.request("GET", url).json()
print(json.dumps(response, indent=4))

We’ll get the following data in response:

  • Instructions to create the cocktail
  • Link to an image of the cocktail
  • Image attribution
  • Category of the cocktail
  • Ingredients required
  • Amounts of ingredients
  • Glass type
  • Tags
  • Drink ID
  • Drink specification (Alcoholic/Non-Alcoholic)
  • Name of the drink
  • Last modified date of the recipe
  • License (Yes/No)
  • Video