# Foodpairing

### Use-case request examples

#### Get suitable recipes by a canonical name of a product

Currently supported search by RED WINE, WHITE WINE, SPARKLING WINE, PORT WINE.

The complete schema for request and response with paging can be found in [API Spec](https://api.whisk.com/spec/#/FoodPairingAPI/FoodPairingAPI_GetRecipesByProduct)

```
curl -X POST "https://api.whisk.com/foodpairing/v2/get" \
-H "accept: application/json" \
-H "Authorization: Bearer %USER_TOKEN%" \
-H "Content-Type: application/json" \
-d "{ \"canonical_name\": \"RED WINE\" }"
```

#### Get well-with products for a recipe

An inside-out version of the method above. Allows to get products that accompany well a certain recipe. Flag `products_only_from_foodlist` makes it possible to filter out products a user does not have.

```
curl -X POST --location "https://api.whisk.com/foodpairing/v2/get/by_recipe" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer %USER_TOKEN%" \
-d "{
  \"recipe_id\": \"1010ea47e45b8a17393f4aac6346dc0bca01a3cd42c\",
  \"products_only_from_foodlist\": false,
  \"cursor\": {
    \"limit\": 10
  }
}"
```

#### &#x20;
