# Getting a product list

To retrieve a list of products, make a request to the following endpoint:

`https://client.experiences.get-potions.com/v1/{siteId}/recos/{recommendationsId}`

## Required Information <a href="#h_01jdq2zxabvyars9ta5vrptpsp" id="h_01jdq2zxabvyars9ta5vrptpsp"></a>

1. **Site ID**
2. **API Key**
3. **Recommendations ID**:
   * This ID is specific to each location.
   * You can find it on the platform under **Personalized Recommendations** or **E-merchandising**.

## Quickstart <a href="#h_01jdq2zxab0vpmgqa5jv8cv7y8" id="h_01jdq2zxab0vpmgqa5jv8cv7y8"></a>

Retrieving a product list requires just a few lines of code. Below are examples in several programming languages.

### Endpoint Options <a href="#h_01jdq2zxabdmvx8pe7mqs9m8a4" id="h_01jdq2zxabdmvx8pe7mqs9m8a4"></a>

1. **GET Method**:
   * Ideal for simple requests.
2. **POST Method**:
   * Not RESTful but allows all parameters to be sent in the request body, which can be more convenient in some cases.

### Examples <a href="#h_01jdq2zxabvsptm5621dqfzdax" id="h_01jdq2zxabvsptm5621dqfzdax"></a>

* Examples are available for the following languages:
  * **Python**

    ```
              import json
          SITE_ID = 504<br/>      API_KEY = 'Z8gib1CBfF2xQyrYVb0PewD4b7KThm8o'<br/>      RECOMMENDATIONS_ID = '70ee825a-6bf9-4d0a-9535-06610ac13563'          <br/>      query = json.dumps({<br/>      "viewing_item": ["8707084648757"],<br/>      "cart_items": ["8706997748021", "8707082354997"]<br/>      })        res = requests.get(<br/>      f'https://uc-info.eu.abtasty.com/v1/reco/{SITE_ID}/recos/{RECOMMENDATIONS_ID}?variables={query}',<br/>      headers={'Authorization': f'Bearer {API_KEY}'}<br/>      )<br/>      res.raise_for_status()<br/>      data = res.json()<br/>      # {"name":"PP - Les internautes ont également aimé - 18.1.24      - OK","description":null,"items":[...]}      /pre  </pre>
    ```
  * **JavaScript**

    ```
              const API_KEY = 'Z8gib1CBfF2xQyrYVb0PewD4b7KThm8o';

              const RECOMMENDATIONS_ID = '70ee825a-6bf9-4d0a-9535-06610ac13563';
          const query = JSON.stringify({<br/>      "viewing_item": ["8707084648757"],<br/>      "cart_items": ["8706997748021", "8707082354997"]<br/>      });          const res = await fetch(<br/>      `https://uc-info.eu.abtasty.com/v1/reco/${SITE_ID}/recos/${RECOMMENDATIONS_ID}?variables=${query}`,<br/>      {<br/>      headers: {<br/>      Authorization: `Bearer ${API_KEY}`<br/>      }<br/>      }<br/>      );<br/>      const data = await res.json();<br/>      // {"name":"PP - Les internautes ont également aimé - 18.1.24      - OK","description":null,"products":[...]}    /pre  </pre>
    ```
  * **Curl**

    ```
            "https://uc-info.eu.abtasty.com/v1/reco/$SITE_ID/recos/$RECOMMENDATIONS_ID?variables=$QUERY"
            \

            -H "Authorization: Bearer $API_KEY"

            # {"name":"PP - Les internautes ont également aimé - 18.1.24 - OK","description":null,"products":[...]} /pre
          
    ```
* The examples are configured for a demo shop but can be adapted with your own **Site ID**, **API Key**, and **Recommendations ID**.

## Technical Documentation <a href="#h_01jdq2zxabvr6yeh8b4x6s1kn8" id="h_01jdq2zxabvr6yeh8b4x6s1kn8"></a>

For in-depth information, explore our API via the **Swagger documentation**:

1. Click on the **“Authorize”** button.
2. Enter your **API Key** to access and try out all endpoints.


---

# 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.abtasty.com/recommendations-and-merchandising_deprecated/recos-and-merch-api/getting-a-product-list.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.
