DrinkDB Logo

Your guide to using the DrinkDB Search API effectively.

DrinkDB Search API Documentation

The DrinkDB API provides access to a comprehensive database of drink recipes. This documentation explains how to use the search endpoint to find drinks by name or ingredients.

API Endpoint: Search Drinks

Retrieve drinks by searching titles or content.

Endpoint URL

GET https://drinkdb.site/drinks/api.php

Query Parameters

Response Format

The API returns a JSON array of drink objects. Each object contains:

Example Request: Specific Drink Search

GET https://drinkdb.site/drinks/api.php?query=Mojito

Example Response:

[
    {
        "id": 1234,
        "title": "Mojito",
        "content": "A delicious recipe for Mojito with white rum lime juice sugar mint leaves soda water and ice"
    },
    {
        "id": 1235,
        "title": "Strawberry Mojito",
        "content": "A delicious recipe for Strawberry Mojito with rum strawberries lime mint sugar and soda water"
    }
]

Example Request: Broad Search

GET https://drinkdb.site/drinks/api.php?query=whiskey

Example Response:

[
    {
        "id": 5678,
        "title": "Whiskey Sour",
        "content": "A delicious recipe for Whiskey Sour with whiskey lemon juice sugar and optional egg white"
    },
    {
        "id": 5679,
        "title": "Old Fashioned",
        "content": "A delicious recipe for Old Fashioned with whiskey sugar bitters and orange peel"
    },
    {
        "id": 5680,
        "title": "Irish Coffee",
        "content": "A delicious recipe for Irish Coffee with Irish whiskey coffee sugar and cream"
    }
]

Example Request: Get All Drinks

GET https://drinkdb.site/drinks/api.php

Example Response:

[
    {
        "id": 1,
        "title": "First Drink",
        "content": "Description of the first drink"
    },
    {
        "id": 2,
        "title": "Second Drink",
        "content": "Description of the second drink"
    },
    // ... continues with all drinks in the database
]

Error Handling

In case of errors, the API returns a JSON object with an error message:

{
    "error": "Connection failed: Could not connect to database"
}

Or:

{
    "error": "SQL query failed - You have an error in your SQL syntax"
}

Implementation Details

The DrinkDB API:

Share This API

Share the link to this API: