{
  "openapi": "3.1.0",
  "info": {
    "title": "Cocktails API",
    "version": "1.0.0",
    "description": "46 classic cocktails and mocktails with ingredients, measures, glassware, garnish and instructions.\n\nA curated library of 46 classic cocktails and mocktails with ingredients, measures, glassware, garnish, and instructions. Search by name, filter by category, alcoholic/non-alcoholic, or ingredient, pull a random round, or browse the ingredient index.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/cocktails.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/cocktails"
  },
  "servers": [
    {
      "url": "https://api-cocktails.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Food",
      "description": "Cocktails API belongs to the Food category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/cocktails/{slug}": {
      "get": {
        "operationId": "getCocktail",
        "summary": "Get Cocktail",
        "description": "Get Cocktail endpoint of the Cocktails API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/cocktails/get-cocktail"
        },
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "margarita"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "name": "Margarita",
                  "slug": "margarita",
                  "category": "Sour",
                  "glass": "Margarita glass",
                  "alcoholic": true,
                  "ingredients": [
                    {
                      "name": "Tequila",
                      "measure": "2 oz"
                    },
                    {
                      "name": "Lime juice",
                      "measure": "1 oz"
                    },
                    {
                      "name": "Triple sec",
                      "measure": "1 oz"
                    }
                  ],
                  "garnish": "Salt rim and a lime wheel",
                  "instructions": "Shake all ingredients with ice and strain into a salt-rimmed glass over fresh ice.",
                  "tags": [
                    "tequila",
                    "citrus",
                    "iba"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/cocktails": {
      "get": {
        "operationId": "listCocktails",
        "summary": "List Cocktails",
        "description": "List Cocktails endpoint of the Cocktails API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/cocktails/list-cocktails"
        },
        "parameters": [
          {
            "name": "alcoholic",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "false"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "Sour"
          },
          {
            "name": "ingredient",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "gin"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "margarita"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "total": 1,
                  "page": 1,
                  "limit": 20,
                  "count": 1,
                  "results": [
                    {
                      "name": "Margarita",
                      "slug": "margarita",
                      "category": "Sour",
                      "glass": "Margarita glass",
                      "alcoholic": true,
                      "ingredients": [
                        {
                          "name": "Tequila",
                          "measure": "2 oz"
                        },
                        {
                          "name": "Lime juice",
                          "measure": "1 oz"
                        },
                        {
                          "name": "Triple sec",
                          "measure": "1 oz"
                        }
                      ],
                      "garnish": "Salt rim and a lime wheel",
                      "instructions": "Shake all ingredients with ice and strain into a salt-rimmed glass over fresh ice.",
                      "tags": [
                        "tequila",
                        "citrus",
                        "iba"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/cocktails/ingredients": {
      "get": {
        "operationId": "listIngredients",
        "summary": "List Ingredients",
        "description": "List Ingredients endpoint of the Cocktails API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/cocktails/list-ingredients"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "count": 70,
                  "ingredients": [
                    {
                      "name": "Lime juice",
                      "count": 13
                    },
                    {
                      "name": "Gin",
                      "count": 12
                    },
                    {
                      "name": "Lemon juice",
                      "count": 9
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/cocktails/random": {
      "get": {
        "operationId": "randomCocktail",
        "summary": "Random Cocktail",
        "description": "Random Cocktail endpoint of the Cocktails API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/cocktails/random-cocktail"
        },
        "parameters": [
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "1"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "count": 1,
                  "results": [
                    {
                      "name": "Godfather",
                      "slug": "godfather",
                      "category": "Cocktail",
                      "glass": "Old-fashioned glass",
                      "alcoholic": true,
                      "ingredients": [
                        {
                          "name": "Scotch",
                          "measure": "1 1/2 oz"
                        },
                        {
                          "name": "Amaretto",
                          "measure": "3/4 oz"
                        }
                      ],
                      "garnish": "",
                      "instructions": "Stir the ingredients with ice until well chilled, then strain into an old-fashioned glass."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 1 token per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}