# List Analysis

This endpoint allows you to perform analysis on Shopping List or any generic set of items

## Analyze List

<mark style="color:green;">`POST`</mark> `https://graph.whisk.com/v1/lists/analyze`

#### Request Body

| Name  | Type  | Description                                                                   |
| ----- | ----- | ----------------------------------------------------------------------------- |
| items | array | Text of items to analyze. Example: `["1 tbsp olive oil", "2 large tomatoes"]` |

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

```javascript
{
  "analyzedItems": [
    {
      "sourceText": "200g pack smoked salmon",
      "normalized": "200 g smoked salmon",
      "analysis": {
        "product": "smoked salmon",
        "quantity": 200,
        "unit": "g",
        "category": "MEATS AND SEAFOOD"
      }
    },
    ...
    {
      "sourceText": "1 tbsp salt and olive oil to serve",
      "normalized": "olive oil",
      "analysis": {
        "product": "olive oil",
        "category": "CONDIMENTS"
      }
    }
  ]
}
```

{% endtab %}
{% endtabs %}

This endpoint allows you to perform analysis on Shopping List or any generic set of items

### Sample Request

```bash
curl -X POST "https://graph.whisk.com/v1/lists/analyze" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Authorization: Token <Access-Token>" \
  -d '{
    "items": [
      "200g pack smoked salmon",
      "2 slices sharp cheddar cheese",
      "1 tbsp salt and olive oil to serve"
    ]
  }'
```

### Sample Response

```javascript
{
  "analyzedItems": [
    {
      "sourceText": "200g pack smoked salmon",
      "normalized": "200 g smoked salmon",
      "analysis": {
        "product": "smoked salmon",
        "quantity": 200,
        "unit": "g",
        "category": "MEATS AND SEAFOOD"
      }
    },
    ...
    {
      "sourceText": "1 tbsp salt and olive oil to serve",
      "normalized": "olive oil",
      "analysis": {
        "product": "olive oil",
        "category": "CONDIMENTS"
      }
    }
  ]
}
```


---

# 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/master/api/shopping-lists/list-analysis.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.
