Retrieve reviews for a product

GET | https://api-cdn.yotpo.com/v1/widget/:app_key/products/:product_id/reviews.json

curl --request GET \
     --url https://api-cdn.yotpo.com/v1/widget/app_key/products/product_id/reviews.json \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json'
const fetch = require('node-fetch');

const url = 'https://api-cdn.yotpo.com/v1/widget/app_key/products/product_id/reviews.json';
const options = {
  method: 'GET',
  headers: {Accept: 'application/json', 'Content-Type': 'application/json'}
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api-cdn.yotpo.com/v1/widget/app_key/products/product_id/reviews.json")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api-cdn.yotpo.com/v1/widget/app_key/products/product_id/reviews.json",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import requests

url = "https://api-cdn.yotpo.com/v1/widget/app_key/products/product_id/reviews.json"

headers = {
    "Accept": "application/json",
    "Content-Type": "application/json"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
{  
  "status":{  
     "code":200,
     "message":"OK"
  },
  "response":{  
     "pagination":{  
        "page":2,
        "per_page":5,
        "total":9
     },
     "bottomline":{  
        "total_review":11,
        "average_score":4.81818,
        "star_distribution":{  
           "4":2,
           "5":9,
           "1":0,
           "2":0,
           "3":0
        },
        "custom_fields_bottomline":null
     },
     "products":[  
        {  
           "id":13,
           "domain_key":"412790437",
           "name":"Yotpo Mug",
           "social_links":{  
              "facebook":"https://yotpo.com/go/r1wYoVa9",
              "twitter":"https://yotpo.com/go/pg4zelyR",
              "linkedin":"https://yotpo.com/go/6PvD9jsG",
              "google_oauth2":"https://yotpo.com/go/srIsHCrr"
           },
           "embedded_widget_link":"https://yotpo.com/go/mjbdNtvQ",
           "testimonials_product_link":"https://yotpo.com/go/45Vp7nuj",
           "product_link":"https://yotpo.com/go/lnhRGFr0"
        }
     ],
     "product_tag":[  

     ],
     "reviews":[  
        {  
           "id":110,
           "score":5,
           "votes_up":1,
           "votes_down":0,
           "content":"Great mug",
           "title":"Perfect",
           "sentiment": 0.852,
           "created_at":"2016-06-16T12:16:05.354Z",
           "verified_buyer":true,
           "source_review_id":null,
           "custom_fields":null,
           "product_id":13,
           images_data:[
                           {
                           id: 13,
                           thumb_url: "http://s3.amazonaws.com/yotpo-images-test/Review/29/13/square.jpeg?1457513657",
                           original_url: "http://s3.amazonaws.com/yotpo-images-test/Review/29/13/original.jpeg?1457513657"
                          },
                          {
                          id: 14,
                          thumb_url: "http://s3.amazonaws.com/yotpo-images-test/Review/29/14/square.jpeg?1457513714",
                          original_url: "http://s3.amazonaws.com/yotpo-images-test/Review/29/14/original.jpeg?1457513714"
                          },
                       ],
          
           "user":{  
              "user_id":18,
              "display_name":"John Doe",
              "social_image":"https://ddcfq0gxiontw.cloudfront.net/images/anonymous_user.png",
              "user_type":"User",
              "is_social_connected":0
           }
        },
       "comment": {
          "id": 1336007,
          "content": "Thanks for your review",
          "created_at": "2017-05-03T07:19:25.734Z",
          "comments_avatar": null
        }
     ]
  }
}
{
    "status": {
        "code": 200,
        "message": "OK"
    },
    "response": {
        "pagination": {
            "page": 1,
            "per_page": 1,
            "total": 82
        },
        "bottomline": {
            "total_review": 82,
            "average_score": 4.90244,
            "total_organic_reviews": 0,
            "organic_average_score": 0,
            "star_distribution": {
                "1": 1,
                "2": 0,
                "3": 0,
                "4": 4,
                "5": 77
            },
            "custom_fields_bottomline": null
        },
        "syndication_data": {},
        "grouping_data": {},
        "products": [
            {
                "id": 25066514,
                "domain_key": "domain key",
                "name": "White Sneakers",
                "social_links": {
                    "facebook": "https://yotpo.com/go/3WyJHb1w",
                    "twitter": "https://yotpo.com/go/ssniEAg4",
                    "linkedin": "https://yotpo.com/go/rhstgPxO",
                    "google_oauth2": "https://yotpo.com/go/Sm9zyBzc"
                },
                "embedded_widget_link": "https://yotpo.com/go/0cS3riZz",
                "testimonials_product_link": "https://yotpo.com/go/cFDmjHmG",
                "product_link": "https://yotpo.com/go/ZgpCJJ3t",
                "image_url": "https://dxogntwdcfq0i.cloudfront.net/Product/25066514/18972967/square.jpg?1507141113"
            }
        ],
        "product_tags": [],
        "reviews": [
            {
                "id": 47405454,
                "score": 5,
                "votes_up": 0,
                "votes_down": 0,
                "content": "I like everything about the sneakers",
                "title": "I love my new kicks",
                "created_at": "2017-11-08T01:23:18.000Z",
                "verified_buyer": true,
                "source_review_id": null,
                "sentiment": 0.526509,
                "custom_fields": {
                    "--6688": {
                        "title": "Recommended",
                        "form_id": 7144,
                        "value": "Yes",
                        "field_type": "SingleChoice"
                    },
                    "--6689": {
                        "title": "Comfort",
                        "form_id": 7144,
                        "value": 5,
                        "field_type": "Rating"
                    },
                    "--6690": {
                        "title": "How was the delivery service?",
                        "form_id": 7144,
                        "field_type": "CustomerFreeText",
                        "value": "The package arrived intact and on time"
                    },
                    "--6691": {
                        "title": "What is your favorite thing about the shoes?",
                        "form_id": 7144,
                        "field_type": "ProductFreeText",
                        "value": "I love the fact that they are lightweight and comfy"
                    }
                },
                "product_id": 25066514,
                "user": {
                    "user_id": 14229046,
                    "display_name": "Fred P.",
                    "social_image": null,
                    "user_type": "User",
                    "is_social_connected": 0
                }
            }
        ]
    }
}

Path params

Param

Type

Description

app_key (required)

String

Your Yotpo account API key

product_id (required)

String

The ID of the product on your site. Default: 10 Max: 150 reviews per page

Query params

Param

Type

Description

per_page

String

Reviews per page

page

String

Page number to return reviews for

star

Integer

Star rating for the product (1 to 5)

sort

String

Responses can be sorted by: date, votes_up, votes_down, time, rating, or reviewer_type

direction

String

Sort order: desc or asc

👍

Rate limit & data freshness SLA applies!

  • Requests for this endpoint are limited to 30,000 requests/minute, per IP address.
  • Data retrieved by this endpoint will be no older than 3 hours.

📘

Notes:

  • The maximum number of product reviews returned per product is 150 per page in a paginated response. The default number returned is 10 reviews.
  • The product_id only supports alphanumeric (a...z, A...Z, 0...9), "_" and "-" characters.

🚧

Custom Questions

Click the Create Review + Custom Questions tab to view a sample response of a review with custom question fields. Contact your Yotpo Customer Success Manager if you need help identifying the custom_field slug.