nand
nand

Reputation: 517

How to implement trip advisor api to get rating and review about a specific hotel

I am implementing this REST URL to get data

http://api.tripadvisor.com/api/partner/2.0/map/28.5441005,77.2132106?key=<user-key>          <key>

I am getting list of hotels but i want "rating" and "reviews" for a specific hotel.
How can I get that?

How can I get rating and reviews for a specific hotel?

Where are we defining hotel co-ordinate?. name ?

In case of review I didn't find URL for specific hotel?

Upvotes: 1

Views: 3788

Answers (1)

VVB
VVB

Reputation: 7641

If you want to fetch hotel id then you need to hit this url first

http://api.tripadvisor.com/api/partner/2.0/map/lat,lng?key=http://api.tripadvisor.com/api/partner/2.0/map/lat,lng?key=<YOUR TRIP ADVISOR KEY>

In response, you will get JSON in which your required hotel will be there. And, there you can find

"location_id":"xxxxxx"

On getting that location ID, you can hit below url to get ratings, reviews & other required data:

http://api.tripadvisor.com/api/partner/2.0/location/place above location_id here/hotels?key=<YOUR TRIP ADVISOR KEY>

This is the only way so far to get above things done.

Upvotes: 2

Related Questions