---
updatedAt: 2026-10-29T10:55:14.000Z
agentTools:
  projectIndex: https://docs.yotpo.com/llms.txt
---

# Retrieve the reviews payload in HTML

## Definition

**<https://staticw2.yotpo.com/batch>**

## Body

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `app_key`
      </td>

      <td>
        string
      </td>

      <td>
        The store ID
      </td>
    </tr>

    <tr>
      <td>
        `methods[method]`
      </td>

      <td>
        string
      </td>

      <td>
        An array of widget types (methods) and an hash of the parameters for each method
      </td>
    </tr>

    <tr>
      <td>
        `methods[params]`
      </td>

      <td>
        object
      </td>

      <td>
        The specific parameters for the method
      </td>
    </tr>

    <tr>
      <td>
        `is_mobile`
      </td>

      <td>
        boolean false
      </td>

      <td>
        Defines if the response should be for a mobile device or a desktop
      </td>
    </tr>
  </tbody>
</Table>

> 📘 Note:
>
> In order for the Reviews Widget to appear on product pages, be sure to add the HTML below to your product page template. Replace each data element with the appropriate values of your website and product attributes. Note that the data-product-id attribute only supports alphanumeric (a...z, A...Z, 0...9) and "\_" and "-" symbols. :point\_down:

```html Reviews Widget HTML
<div class="yotpo yotpo-main-widget"
data-product-id="SKU/Product_ID"
data-price="Product Price"
data-currency="Price Currency"
data-name="Product Title"
data-url="The url to the page where the product is (url escaped)"
data-image-url="The product image url. Url escaped">
</div>
```

## Batch payload types

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Methods
      </th>

      <th>
        Parameters
      </th>

      <th>
        Batch Result
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `main_widget`
      </td>

      <td>
        `pid` - The product SKU for which to bring the main reviews widget.

        `page` (optional) -\
        The page number of the reviews page as applied by the Reviews Widget.\
        The current reviews page will be passed as a query param called `yoReviewsPage`
      </td>

      <td>
        Full HTML of a reviews widget which belongs to a specific product
      </td>
    </tr>

    <tr>
      <td>
        `bottomline`
      </td>

      <td>
        `pid` - The product SKU for which to bring the bottom line widget.

        `skip_average_score` - Boolean value to show or hide the average score in the bottom line.

        `format` - The format to return the result\
        HTML (default)\
        JSON
      </td>

      <td>
        Star rating widget that belongs to the same specific product
      </td>
    </tr>

    <tr>
      <td>
        `testimonials`
      </td>

      <td>
        `data-product-readonly` - A flag to enable or disable the ability to write new reviews (false if not specified)
      </td>

      <td>
        Reviews tab that opens the site and product reviews pop-up
      </td>
    </tr>

    <tr>
      <td>
        `embedded`
      </td>

      <td>
        `per_page` - Number of reviews per page

        `view` - Customizations for the embedded widget. Refer to your Yotpo Admin page as well.\
        type\
        layout\
        width\
        headerText\
        transparency\
        headerBackgroundColor\
        bodyBackgroundColor\
        fontSize\
        fontColor
      </td>

      <td>
        Embedded widget
      </td>
    </tr>

    <tr>
      <td>
        `badge`
      </td>

      <td>
        None ("params" : \{})
      </td>

      <td>
        The Yotpo badge
      </td>
    </tr>

    <tr>
      <td>
        `questions_bottomline`
      </td>

      <td>
        `pid`- The product SKU for which to bring the questions and answers
      </td>

      <td>
        A summary of the number of questions and answers per product
      </td>
    </tr>
  </tbody>
</Table>

## Example

```json
{
  "methods": [
      {
        "method":"main_widget",
        "params": {
        "pid": "334342199",
        "page":"2"
        }
      },
      {
        "method":"bottomline",
        "params": {
         "pid": "334342199"
        },
        "format": "json"
      }  
],
"app_key":"YOUR_APP_KEY",
"is_mobile":"false"
}
```

## Result format

```json 200 OK
[
	{
		"method":"main_widget",
		"result":"<div class="yotpo-display-wrapper yotpo-no-reviews" style="visibility: hidden;">    <div class="yotpo-label yotpo-small-box "> ....... // HTML is cut for brevity"},
	{	"method":"bottomline",
	"result":"<span class="yotpo-display-wrapper" style="visibility: hidden;">  <div class="standalone-bottomline"> .... // HTML is cut for brevity"
	}
]
```

The methods parameter is an array of methods. Each method is a hash containing the method and parameters, which is an hash of the parameters for the method.

> 📘 Note:
>
> * Include the empty params attribute - "params" : \{} - for the badge method
> * The pid parameter is mandatory and cannot contain the "/" symbol

> 👍 Tip:
>
> It is highly recommended to develop a cache mechanism to save the payload locally and to refresh it periodically. The purpose of this caching is to avoid long loading times every time the widget loads.

# Sibling pages

* [About reviews (storefront)](https://docs.yotpo.com/reference/about-storefront-reviews.md)
* [Top Three 5-Star Reviews](https://docs.yotpo.com/reference/recent-5-star-reviews.md)
* [Upvote or downvote reviews](https://docs.yotpo.com/reference/vote-on-reviews.md)
* [Top mentioned topics](https://docs.yotpo.com/reference/top-mentioned-topics.md)
* [Retrieve LLM schema HTML for a product](https://docs.yotpo.com/reference/retrieve-llm-schema.md)
* [Retrieve star distribution for a product](https://docs.yotpo.com/reference/storefront-star-distribution.md)