如何获取在 TripAdvisor 注册的特定酒店的位置 ID

nan*_*and 2 rest

我想获取我正在使用 TripAdvisor API 的特定酒店的评分和评论。

我得到这个链接:

api.tripadvisor.com/api/partner/2.0/location/**8957**5?key=<YOUR KEY HERE> 
Run Code Online (Sandbox Code Playgroud)

但如何获得酒店的唯一 ID(位置 ID)?

Mig*_*uel 5

唯一的 id 是“location/ unique_id ”之后的那个,如何获取酒店的 id 取决于您的应用程序的工作方式。

  1. 您可以浏览 TripAdvisor 网站找到您想要的酒店,id 是 URL 中D 后面的部分:

    http://www.tripadvisor.com/Hotel_Review-g297484-d616578-Reviews-Irotama_Resort-Santa_Marta_Santa_Marta_District_Magdalena_Department.html -> ID 是616578

  2. 或者,您可以使用以下 url 按纬度和经度执行搜索:并使用键"location_id"http://api.tripadvisor.com/api/partner/2.0/map/42.33141,-71.099396?key=<YOUR_KEY> 在结果中选择您想要的位置。

请参阅TripAdvisor 文档了解更多详情。