# Get a Recipe

Gets [recipe information](/api/recipes.md#data-structure) by the recipe identifier or by URL

## Get Recipe

<mark style="color:blue;">`GET`</mark> `https://api.whisk.com/recipe/v2/get?id=`

#### Path Parameters

| Name     | Type   | Description                                                                                                                                                                                                                                                                                  |
| -------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id       | string | Recipe Id or URL. (can be a path or a query param id)                                                                                                                                                                                                                                        |
| fields   | array  | Extra fields to return on the recipe. The options are: `RECIPE_FIELD_NORMALIZED_INGREDIENTS`, `RECIPE_FIELD_INSTRUCTIONS`, `RECIPE_FIELD_INSTRUCTION_INTENTS`, `RECIPE_FIELD_NUTRITION`, `RECIPE_FIELD_NUTRITION_COVERAGE`, `RECIPE_FIELD_SAVED`, `RECIPE_FIELD_INGREDIENTS_LINKED_PRODUCTS` |
| servings | number | Scale `normalizedIngredients` amounts to the requested number of servings                                                                                                                                                                                                                    |
| scale    | number | Multiplier for ingredients amounts in recipe: `0.5`, `2`, ...                                                                                                                                                                                                                                |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "recipe": {
    "id": "10166b9b5f457863f73ae1309b2fdf9470b78d75d39",
    "name": "Omelette pancakes with tomato & pepper sauce",
    "description": "Healthy, low-calorie and gluten-free - these herby egg 'pancakes' will become your go-to favourite for a quick midweek meal",
    "ingredients": [
      {
        "text": "4 large eggs"
      },
      ...     
      {
        "text": "wholemeal bread or salad leaves, to serve"
      }
    ],
    "images": [
      {
        "responsive": {
          "url": "https://image-cdn.whisk.com/image/upload/v1523012138/recipe/758058656142eaae402f1781e18c527c.jpg",
          "width": 454,
          "height": 500
        },
        "url": "https://image-cdn.whisk.com/image/upload/v1523012138/recipe/758058656142eaae402f1781e18c527c.jpg"
      }
    ],
    "source": {
      "name": "bbcgoodfood.com",
      "display_name": "BBC Good Food",
      "source_recipe_url": "https://www.bbcgoodfood.com/recipes/omelette-pancakes-tomato-pepper-sauce",
      "image": {
        "responsive": {
          "url": "https://image-cdn.whisk.com/image/upload/publishers/logos/bbcgoodfood-logo.png",
          "width": 256,
          "height": 256
        },
        "url": "https://image-cdn.whisk.com/image/upload/publishers/logos/bbcgoodfood-logo.png"
      },
      "license": "LICENCE_FAIRUSE"
    },
    "servings": 2,
    "durations": {
      "cook_time": 20,
      "prep_time": 10,
      "total_time": 30
    },
    "nutrition": {
      "status": "STATUS_AVAILABLE",
      "total": [
        {
          "label": "Carbohydrate Total",
          "code": "NUTRITION_CODE_CHOCDF",
          "value": 22,
          "unit": "NUTRITION_UNIT_G"
        },
        ...
        {
          "name": "diabetes-friendly",
          "display_name": "Diabetes Friendly"
        }
      ],
      "health_score": {
        "value": 5.372154194041782,
        "nutrients_influence": [
          {
            "code": "NUTRITION_CODE_FAT_UNSAT",
            "influence": 0.7762592808559045,
            "comment": "Strong positive impact"
          },
          ...
          {
            "code": "NUTRITION_CODE_SUGAR",
            "influence": -0.1876448970439361,
            "comment": "Low negative impact"
          }
        ]
      },
      "glycemic_index": {
        "value": 42.12
      },
      "glycemic_load": {
        "value": 7.66
      }
    },
    "labels": {
      "meal_type": [
        {
          "name": "main-course",
          "display_name": "Main Course"
        },
        ...
        {
          "name": "dinner",
          "display_name": "Dinner"
        }
      ],
      "cuisine": [
        {
          "name": "french",
          "display_name": "French"
        }
      ],
      "category": [
        {
          "name": "dinner",
          "display_name": "Dinner"
        },
        {
          "name": "lunch",
          "display_name": "Lunch"
        }
      ],
      "technique": [
        {
          "name": "simmering",
          "display_name": "Simmering"
        },
        ...
        {
          "name": "pan-frying",
          "display_name": "Pan Frying"
        }
      ]
    },
    "constraints": {
      "violates": {
        "diets": [
          "DIET_VEGAN",
          "DIET_LACTO_VEGETARIAN"
        ],
        "avoidances": [
          "AVOIDANCE_YEAST",
          "AVOIDANCE_GLUTEN",
          "AVOIDANCE_SOYBEAN",
          "AVOIDANCE_WHEAT",
          "AVOIDANCE_EGG"
        ]
      }
    },
    "author": {
      "name": "Sara Buenfeld"
    },
    "language": "en"
  }
}
```

{% endtab %}

{% tab title="400 If a recipe is not valid or couldn" %}

```javascript
// Recipe ID not found
{
	"code": "general.badRequest",
	"message": "Can't decode recipe id: 9773cb7eca5d11dwaawe7ae7e42010a9a0035"
}

// Recipe URL not Found
{
	"code": "recipes.unavailable",
	"message": "Can't get recipe"
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
For performance reasons, we recommend including `fields` only when required. Doing so will make the server respond faster by only returning the essential recipe data.
{% endhint %}

### Sample Request - Recipe ID

```bash
curl -X GET "https://api.whisk.com/recipe/v2/get?id=9773cb7eca5d11e7ae7e42010a9a0035" \
    -H "accept: application/json" \
    -H "Authorization: Token <Access-Token>"
```

### Sample Request - URL

```bash
curl -X GET "https://api.whisk.com/recipe/v2/get?id=https%3A%2F%2Fwww.bbcgoodfood.com%2Frecipes%2Fchilli-con-carne-recipe" \
    -H "Accept: application/json" \
    -H "Authorization: Token <Access-Token>"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.whisk.com/api/recipes/get-recipe-nutrition.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
