# Thecocktaildb Scraper (`zerobreak/thecocktaildb-scraper-202610120341`) Actor

TheCocktailDB Scraper is a Python tool designed to extract cocktail recipes, ingredient quantities, preparation instructions, glassware requirements, and category metadata from TheCocktailDB API. It exports structured beverage datasets into clean CSV or JSON formats for mixology menu analysis.

- **URL**: https://apify.com/zerobreak/thecocktaildb-scraper-202610120341.md
- **Developed by:** [ZeroBreak](https://apify.com/zerobreak) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### TheCocktailDB Scraper — Collect Cocktail Recipes and Ingredients

### Overview

TheCocktailDB Scraper collects publicly available cocktail recipe information and saves each drink as a structured dataset row. Search drinks by name, find cocktails by first letter, filter by ingredient, or retrieve a specific drink using its ID.

Collected information can include drink names, categories, glass types, preparation instructions, ingredients, measurements, thumbnails, and available recipe metadata. Export the dataset in JSON, CSV, or Excel format.

### Features

- **Cocktail name search:** Find drinks by name, such as Margarita.
- **First-letter search:** Collect drinks whose names begin with specified letters.
- **Ingredient filtering:** Find cocktails containing ingredients such as gin.
- **Individual drink lookup:** Retrieve a specific cocktail using its drink ID.
- **Full recipe details:** Retrieve instructions, ingredients, and measurements when available.
- **Multiple language fields:** Preserve recipe instructions in the languages provided by the source.
- **Duplicate removal:** Keep each drink ID only once.
- **Configurable result limits:** Collect up to 1,000 unique drink records per run.
- **Multiple export formats:** Download results as JSON, CSV, or Excel.

### Use Cases

- **Recipe collections:** Build searchable catalogs of cocktails and their ingredients.
- **Menu planning:** Organize drinks by ingredients, glass type, or category.
- **Ingredient research:** Discover cocktails associated with specific ingredients.
- **Alphabetical catalogs:** Collect drink names by their starting letters.
- **Recipe lookup:** Refresh records for known drink IDs.
- **Cocktail data analysis:** Compare ingredients, measurements, categories, and preparation methods.
- **Scheduled collection:** Refresh cocktail datasets periodically.

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `searchQueries` | Array of strings | `["margarita"]` | Drink names to search for. |
| `letters` | Array of strings | `[]` | First letters used to find drinks. Only the first character of each value is used. |
| `ingredients` | Array of strings | `[]` | Ingredients used to filter drinks. |
| `drinkIds` | Array of strings | `[]` | Specific drink IDs to retrieve. |
| `fullDetails` | Boolean | `true` | Retrieves complete recipe details for ingredient-filter results when available. |
| `maxItems` | Integer | `100` | Maximum number of unique cocktail records to save. Maximum: 1,000. |
| `requestDelaySecs` | Number | `0.3` | Delay between requests in seconds. Minimum: 0.3 seconds. |
| `timeoutSecs` | Integer | `300` | Overall run time limit in seconds. |
| `requestTimeoutSecs` | Integer | `30` | Maximum wait for an individual request, in seconds. |

### Example Input

```json id="u8q3mw"
{
  "searchQueries": ["margarita"],
  "letters": [],
  "ingredients": [],
  "drinkIds": [],
  "fullDetails": true,
  "maxItems": 100,
  "requestDelaySecs": 0.3,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30
}
```

This example searches for Margarita recipes and collects up to 100 unique drink records.

### What Data Does This Actor Extract?

Each drink becomes one dataset row. Search results can include complete recipe details, while ingredient-filter results may initially contain only a drink ID, name, and thumbnail. When `fullDetails` is enabled, the actor retrieves additional information for matching drinks when available.

#### Extracted Data Fields

| Field | Description |
|---|---|
| `idDrink` | Unique drink identifier. |
| `strDrink` | Cocktail or drink name. |
| `strDrinkAlternate` | Alternate drink name, when available. |
| `strTags` | Tags associated with the drink. |
| `strVideo` | Related video information, when available. |
| `strCategory` | Drink category, such as Ordinary Drink. |
| `strIBA` | International Bartenders Association classification, when available. |
| `strAlcoholic` | Alcohol classification supplied by the source. |
| `strGlass` | Recommended glass type. |
| `strInstructions` | Preparation instructions in English. |
| `strInstructionsES` and other language fields | Instructions in other available languages. |
| `strDrinkThumb` | Thumbnail image location. |
| `strIngredient1`–`strIngredient15` | Ingredient names. |
| `strMeasure1`–`strMeasure15` | Measurements corresponding to the ingredient fields. |
| `strImageSource` | Image source metadata, when available. |
| `strImageAttribution` | Image attribution information, when available. |
| `strCreativeCommonsConfirmed` | Creative Commons confirmation information, when available. |
| `dateModified` | Last-modified information supplied by the source, when available. |
| `mode` | Collection method: `search`, `letter`, `ingredient`, or `lookup`. |
| `scraped_at` | UTC timestamp indicating when the record was saved. |

Some fields may be null or absent depending on the information available for each drink.

#### Example Output

```json id="f5k9rc"
{
  "idDrink": "11007",
  "strDrink": "Margarita",
  "strDrinkAlternate": null,
  "strTags": "IBA,ContemporaryClassic",
  "strVideo": null,
  "strCategory": "Ordinary Drink",
  "strIBA": "Contemporary Classics",
  "strAlcoholic": "Alcoholic",
  "strGlass": "Cocktail glass",
  "strInstructions": "Rub the rim of the glass with the lime slice to make the salt stick to it.",
  "strInstructionsES": "Frota el borde del vaso con la rodaja de lima para que la sal se adhiera a él.",
  "strDrinkThumb": "COCKTAIL_THUMBNAIL_URL",
  "strIngredient1": "Tequila",
  "strIngredient2": "Triple sec",
  "strIngredient3": "Lime juice",
  "strIngredient4": "Salt",
  "strMeasure1": "1 1/2 oz",
  "strMeasure2": "1/2 oz",
  "strMeasure3": "1 oz",
  "mode": "search",
  "scraped_at": "2026-10-12T00:00:00+00:00"
}
```

The example illustrates the dataset structure. Actual values depend on the drink and the details available in the source.

### Working with Your Dataset

After collection, you can:

- Export cocktail records to JSON, CSV, or Excel.
- Organize drinks by name, category, or glass type.
- Search ingredient fields to find drinks with particular ingredients.
- Review measurements and preparation instructions.
- Build recipe catalogs or cocktail menu spreadsheets.
- Compare recipes and ingredient combinations.
- Use drink IDs to organize records and avoid duplicate entries.

### Important Notes

- The scraper supports name searches, first-letter searches, ingredient filtering, and individual drink lookups.
- Category-based filtering is not supported by the current collection workflow.
- `fullDetails` enables additional recipe lookups for ingredient-filter results.
- Duplicate drink IDs are retained only once.
- The maximum number of saved unique drinks is 1,000 per run.
- Requests are processed sequentially with a configurable delay.
- Temporary request failures may be retried.
- Some drinks may have incomplete instructions, missing ingredients, or unavailable metadata.
- Recipe information and image availability can change over time.

### FAQ

**Can I search for cocktails by ingredient?**

Yes. Add ingredient names to the `ingredients` list to collect matching drinks.

**Can I search by the first letter of a drink?**

Yes. Add letters to `letters`. Only the first character of each supplied value is used.

**Can I retrieve a particular cocktail?**

Yes. Add its drink ID to `drinkIds`.

**Why are some ingredient-filter results missing instructions?**

Ingredient filters may return basic drink information only. Enable `fullDetails` to retrieve additional recipe information when available.

**How many cocktails can one run collect?**

The default limit is 100 unique drinks. You can increase `maxItems` to a maximum of 1,000.

**Are duplicate drinks saved more than once?**

No. The scraper keeps each drink ID only once.

**Can I export the results to Excel?**

Yes. The dataset supports JSON, CSV, and Excel exports.

**How current is the collected information?**

The scraper collects information during each run. The `scraped_at` field records when a row was saved, rather than when the recipe was originally created.

### Disclaimer

This is an independent tool and is not affiliated with, endorsed by, sponsored by, or officially associated with TheCocktailDB or its owners. Users are responsible for ensuring that their collection, storage, redistribution, and use of recipe information comply with applicable laws and the source's terms.

### Is Web Scraping Legal?

Collecting information that is already public is generally legal. Scraping is not the same thing as hacking, and there is no single law that bans it. The limits are the usual ones: do not break into accounts, do not take private or confidential data, and be careful with personal data and copyrighted works. A site's terms can also restrict how you access it. Facts such as a public name, price, or rating are not the same thing as republishing someone's article or photo.

This actor collects information from public pages. It does not log in and it does not bypass access controls.

For a longer explanation, see Apify's article [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

## `searchQueries` (type: `array`):

Drink names to search with the public name search. One name per line, for example margarita.

## `letters` (type: `array`):

First letters of drink names. Each value uses only its first character and calls the letter search.

## `ingredients` (type: `array`):

Ingredient names used as a filter, for example Gin. When full details is on, each match is looked up by id.

## `drinkIds` (type: `array`):

TheCocktailDB drink ids to look up directly, for example 11007.

## `fullDetails` (type: `boolean`):

After an ingredient filter, look up each drink id so the row includes the full recipe. Name search and letter search already return full recipes.

## `maxItems` (type: `integer`):

Maximum number of cocktail rows to save. The free cap is 1000.

## `requestDelaySecs` (type: `number`):

Seconds to wait between API calls. Minimum is 0.3 so requests stay sequential and polite.

## `timeoutSecs` (type: `integer`):

Overall time limit for the run, in seconds. The actor stops fetching when this elapses and keeps rows already saved.

## `requestTimeoutSecs` (type: `integer`):

How long to wait for a single API response before retrying.

## `proxyConfiguration` (type: `object`):

Optional proxy for API requests. Leave Apify Proxy off unless the public endpoint starts blocking your IP.

## Actor input object example

```json
{
  "searchQueries": [
    "margarita"
  ],
  "letters": [],
  "ingredients": [],
  "drinkIds": [],
  "fullDetails": true,
  "maxItems": 100,
  "requestDelaySecs": 0.3,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchQueries": [
        "margarita"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("zerobreak/thecocktaildb-scraper-202610120341").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchQueries": ["margarita"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("zerobreak/thecocktaildb-scraper-202610120341").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchQueries": [
    "margarita"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call zerobreak/thecocktaildb-scraper-202610120341 --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zerobreak/thecocktaildb-scraper-202610120341"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/qUf8kEGeHGfle3hl9/builds/Pmmp4fjzamyl4F4lR/openapi.json
