# TheCocktailDB API

> Cocktails with ingredients, measures, glass and instructions from thecocktaildb.com pages.

Category: Entertainment & Books. Region: Global. 4 endpoints at `https://api.hoshime.com/v1/thecocktaildb/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/thecocktaildb
## GET /v1/thecocktaildb/drink

One cocktail from its TheCocktailDB page: ingredients with measures, glass, tags and instructions.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Cocktail id such as 11007, or the cocktail's thecocktaildb.com URL. (e.g. 11007) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `glass` (string), `id` (string), `imageUrl` (string), `ingredients` (Ingredient[]), `ingredients[].measure` (string), `ingredients[].name` (string), `instructions` (string), `name` (string), `tags` (string[]), `url` (string)

```bash
curl "https://api.hoshime.com/v1/thecocktaildb/drink?id=11007" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/thecocktaildb/search

Cocktails whose name matches a search, from TheCocktailDB's search page.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words of the cocktail name, such as margarita. (e.g. margarita) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `imageUrl` (string), `name` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/thecocktaildb/search?query=margarita" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/thecocktaildb/letter

Cocktails whose name starts with one letter.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `letter` | string | yes | One letter, a to z. (e.g. m) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `imageUrl` (string), `name` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/thecocktaildb/letter?letter=m" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/thecocktaildb/ingredient

One cocktail ingredient from its page, with the cocktails that use it.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Ingredient id such as 4, or the ingredient's thecocktaildb.com URL. (e.g. 4) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `drinks` (DrinkSummary[]), `drinks[].id` (string), `drinks[].imageUrl` (string), `drinks[].name` (string), `drinks[].url` (string), `id` (string), `imageUrl` (string), `name` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/thecocktaildb/ingredient?id=4" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
