Reviews

The Reviews endpoint gives you more flexible access to the individual reviews available for a business. The /search endpoint only displays the Review Summary for a business, and the /getByListingId endpoint returns a maximum of ten reviews for a given business.

You are only eligible to retrieve review data for sources that you have agreed to in the API Key Registration and/or your API keys Account.

Enabling Review Content

New Users

1. Check the box beside the line "Yes, I understand & accept the Yelp API Terms of Use and wish to incorporate Yelp Ratings & Reviews within my SAPI search results." during the signup process

Existing Users

1. Click on My Account

2. Click on Applications

3. Click edit for each of the keys

4. Tick the checkbox "Yes, I understand & accept the Yelp API Terms of Use and wish to incorporate Yelp Ratings & Reviews within my SAPI search results."

5. Click save

Usage

http://api.sensis.com.au/v1/test/businesses/{aboutId}/reviews?key=secret

where aboutId is one of the Sensis ID attributes returned from getByListingId endpoint.

Parameters

The Reviews endpoint takes the following parameters:

Name Type Possible Value Description Default Value
key string API key (required) See Authenticating for details. N/A
sortType string
  • DATE
  • RATING
  • DATE - the date reviews are submitted
  • RATING - the number of ratings for each of the review.
DATE
sortOrder string
  • ASC
  • DESC
  • ASC - sort the reviews ascending or smallest to largest
  • DESC - sort the reviews descending or largest to smallest
DESC
offset number Any integer number Offset is used for pagination. The zero based number of the review to start from. The reviews that start from this offset will be returned. 0
limit number Any integer number Limit is used for pagination. The number of reviews after their offset to return. Limit is the same as page size. 10
namespace string one or more of the namespaces in the reviewSummaries returned by getByListingId endpoint Namespace is used as a filter. Only reviews for this given namespace will be returned. e.g. http://www.yelp.com.au. All namespaces that you are authorised to retrieve

Result

If there is a problem with the request made to the reviews endpoint, the user receives an 'ok' value of 'false' and a description of the failure in the 'reason' field:

  {
     "ok": false,
     "reason": "Requested reviews not available for aboutId 1234abcd"
  }

If no reviews are available for the selected criteria the response is blank:

 
   {
     reviews: [ ]
   }

Example

The default behaviour of this endpoint is to return reviews from all namespaces that you are authorised to see. Reviews from individual sources (namespaces) are fetched by appending the request with the corresponding namespace. Available namespaces for business reviews are revealed in the Review Summary field of the /search endpoint under each listing.

To fetch reviews for aboutId "ABC", assuming your API key was secret, and ABC has only one review:

http://api.sensis.com.au/v1/test/businesses/ABC/reviews?key=secret

This should return a JSON response that looks similar to:

 "reviews": [
    {
        "namespace": "http://www.yelp.com.au",
        "text": "Well, my night at Dracula's wasn't half as painful as I thought it would be! ...",
        "reviewUrl": "http://www.yelp.com.au/biz/draculas-carlton-2#hrid:gGpUJN1cCItli6Dx0tl6Rg",
        "reviewTimestamp": "2011-11-08T20:00:37.000+1100",
        "reviewerName": "John S",
        "reviewerAvatarUrl": "http://s3-media1.ak.yelpcdn.com/photo/not_existence/link.jpg",
        "ratingImageUrl": "http://www.yellowpages.com.au/ui/standard/yelp_4stars.png",
        "ratingSmallImageUrl": "http://www.yellowpages.com.au/ui/standard/yelp_4stars_small.png"
    }
 ]

To fetch only five reviews for a particular business (aboutId=ABCD) sorting by date ascending, with an offset of five and nominating multiple namespaces:

http://api.sensis.com.au/v1/test/businesses/ABCD/reviews?key=secret&sortType=DATE&sortOrder=ASC&offset=5&limit=5&namespace=http://www.yelp.com.au&namespace=http://another_namespace.com 

See also: Examples for how to call endpoints from code.

Things to keep in mind

Your API key is the source of authorisation for determining which review namespaces can be accessed.

You are only eligible (authorised) to retrieve reviews for sources (namespaces) that you have agreed to in the API Key Registration and terms and conditions or your API Account Key profile.