Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get more reviews from Zomato API

When I try to get more than 5 reviews, the same set of reviews are returned back by the 'reviews' API.

I am getting the reviews using curl requests. For example, I am trying to get 10 reviews of 'Impromptu' with the start index as 20.

curl -X GET --header "Accept: application/json" --header "user-key: <API_KEY>" "https://developers.zomato.com/api/v2.1/reviews?res_id=311104&start=20&count=10"

It gives me the same reviews as it would give, if I didn't give the start and count parameters as the following :

curl -X GET --header "Accept: application/json" --header "user-key: <API_KEY>" "https://developers.zomato.com/api/v2.1/reviews?res_id=311104"

Thus, I get only 5 reviews for a said restaurant. Is this a limitation of my API_KEY?

like image 955
Manish Dwibedy Avatar asked Apr 08 '16 07:04

Manish Dwibedy


2 Answers

Try using V1 API, with something like:

https://api.zomato.com/v1/reviews.json/RESTAURANT-ID/user?count=0&apikey=YOUR-KEY

Setting the count parameter value as 0, will return all the reviews, for the given restaurant ID. Other positive values (< 50) will return the mentioned number of reviews.

like image 56
Sharad Nandanwar Avatar answered Sep 18 '22 19:09

Sharad Nandanwar


Currently, you can get the first 500 characters of the latest 5 reviews of a given restaurant through Zomato public API. That is why the variation in start-and-count parameters does not affect the result set from reviews API.

like image 25
Rohit Chandna Avatar answered Sep 20 '22 19:09

Rohit Chandna