curlzomato-api

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?


Solution

  • 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.