Sand AISand AI MAGI-2MAGI-2 artık SandBase'de: yerel sesli 1080p videoŞimdi deneyin

Tripadvisor Search

API dokümanları
https://api.sandbase.ai/v1/api/tripadvisor/search

Search Tripadvisor hotels, restaurants, attractions and places by keyword.

Fiyat
$0.00015USD / çağrı
Yöntem
POST
Yanıt
JSON
Parametreler
1 gerekli · 9 isteğe bağlı

Oynatma Alanı

Girdi
Search text, 1 to 500 characters.
Supported first-party localized Tripadvisor hostname, such as www.tripadvisor.co.uk.
Lowercase language code with an optional uppercase country, such as en or en-US.
Tripadvisor geography ID to search within.
Search center latitude from -90 through 90. Requires lon.
Search center longitude from -180 through 180. Requires lat.
Restrict results to one entity type.
Result offset from 0 through 10,000. Offsets and positions count any leading exact match.
Maximum number of search_results, 1 through 30, including any leading exact match.
Optional budget for the entire request in seconds, measured from gateway receipt until the response is ready to send. Includes admission, queueing and settlement. Must be greater than 0 and at most 90. On expiry, the call is not billed and returns 503 request_deadline_exceeded with retryable=true an
ÇıktıHazır

Çıktınız burada görünecek

Girdileri tamamlayın, ardından Çalıştır'a tıklayın.

API README

Tripadvisor Search API

Returns Tripadvisor search results for a keyword query, such as hotels, restaurants, attractions and places. The only required input is q. You can narrow results with geo_id, lat and lon, place_type or a localized Tripadvisor domain.

Use cases

  • Build a list of hotels in a city with ratings and review counts to compare them.
  • Find the Tripadvisor place_id and page link for a named business before looking up more detail.
  • Collect restaurants or attractions near a latitude and longitude using lat, lon and place_type.
  • Run the same query on a schedule to see how the review count and rating of a set of properties change.

Request

curl -X POST "https://api.sandbase.ai/v1/api/tripadvisor/search" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q": "hotels in Austin Texas"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
qstringYesSearch text, 1 to 500 characters.
geo_idintegerNoTripadvisor geography ID to search within.
latnumberNoSearch center latitude from -90 through 90. Requires lon.
localestringNoLowercase language code with an optional uppercase country, such as en or en-US.
lonnumberNoSearch center longitude from -180 through 180. Requires lat.
numintegerNoMaximum number of search_results, 1 through 30, including any leading exact match.
place_typestringNoRestrict results to one entity type.
startintegerNoResult offset from 0 through 10,000. Offsets and positions count any leading exact match.
timeoutnumberNoOptional budget for the entire request in seconds, measured from gateway receipt until the response is ready to send. Includes admission, queueing and settlement. Must be greater than 0 and at most 90. On expiry, the cal
tripadvisor_domainstringNoSupported first-party localized Tripadvisor hostname, such as www.tripadvisor.co.uk.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "map_previews": [],
  "pagination": {},
  "search_information": {
    "results_on_page": 30,
    "total_results": 2000
  },
  "search_results": [
    {
      "description": "Located in Downtown Austin's vibrant Second Street District, Austin Proper Hotel…",
      "detail_type": "Hotel",
      "highlighted_spans": [
        {
          "length": 6,
          "offset": 3
        }
      ],
      "image": {
        "max_height": 2667,
        "max_width": 4000,
        "thumbnail": "https://dynamic-media-cdn.tripadvisor.com/media/photo-o/35/01/4d/b9/outdoor-pool…",
        "url_template": "https://dynamic-media-cdn.tripadvisor.com/media/photo-o/35/01/4d/b9/outdoor-pool…"
      },
      "link": "https://www.tripadvisor.com/Hotel_Review-g30196-d18941405-Reviews-Austin_Proper_…",
      "location": "Austin, Texas",
      "max_rating": 5,
      "mention_count": 16,
      "place_id": "18941405",
      "position": 1,
      "position_in_page": 1,
      "rating": 4.6
    }
  ]
}

Response fields

FieldMeaning
search_results[].titleName of the place, such as a hotel, restaurant or attraction.
search_results[].place_idTripadvisor ID of the place, given as a string. It matches the number after -d in the link URL.
search_results[].type / search_results[].detail_typeEntity type of the result. type is a code such as ACCOMMODATION and detail_type is a label such as Hotel.
search_results[].rating / search_results[].max_ratingAverage rating of the place and the top of the rating scale, which is 5 in this response.
search_results[].reviewsNumber of reviews for the place.
search_results[].linkFull Tripadvisor page URL for the place.
search_results[].locationCity or region text shown for the place, such as Austin, Texas.
search_results[].position / search_results[].position_in_pageRank of the result across the whole result set and within the current page.
search_results[].thumbnail / search_results[].image.url_templatePhoto URL for the result. In url_template, replace {width} and {height} to request a size.
search_information.total_results / search_information.results_on_pageTotal number of matches for the query and the number of results returned in this response.

Notes

  • Page through results with start (offset) and num (up to 30 results in one response).
  • Use place_type to limit results to one type: accommodation, attraction, attraction_product, eatery or geo.
  • place_id is a numeric string. The same value appears after -d in the link URL.
  • To read guest reviews for a result, use Tripadvisor Reviews next.

Pricing

$0.00015 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

Daha fazlasını keşfedin

İlgili APIs

Tüm APIs
APIFiyatYanıt
Tripadvisor$0.00015 çağrı başınaJSON
Tripadvisor$0.00015 çağrı başınaAsenkron JSON
Tripadvisor$0.00015 çağrı başınaJSON

Sorular

SSS

Tripadvisor Search API'sini nasıl kullanırım?

SandBase API anahtarınızı Authorization başlığında (Bearer) ve parametreleri JSON gövdesi olarak ile https://api.sandbase.ai/v1/api/tripadvisor/search adresine bir POST isteği gönderin. Ayrıca bu sayfadaki Playground’da kod yazmadan da deneyebilirsiniz.

Tripadvisor Search API'sinin fiyatı nedir?

çağrı başına $0.00015, SandBase bakiyenizden tahsil edilir. Yalnızca yaptığınız çağrılar için ücretlendirilirsiniz; abonelik yoktur.

Tripadvisor Search API'si hangi parametreleri kabul eder?

Gerekli: q (string). İsteğe bağlı: tripadvisor_domain (string), locale (string), geo_id (integer), lat (number), lon (number) ve place_type (all, accommodation, attraction, attraction_product, eatery, geo arasından biri) ve 3 tane daha. Parametreler tablosu ve bu sayfadaki Playground, tüm alanları listeler.

Tripadvisor Search API'si ne döndürür?

Aynı HTTP isteğinde döndürülen bir JSON yanıtı (senkron). Bu sayfadaki README'de örnek bir yanıt yer alır.

Bir Tripadvisor geliştirici hesabına veya API anahtarına ihtiyacım var mı?

Hayır. Tripadvisor Search, SandBase üzerinden çalışır; bu nedenle tek bir SandBase API anahtarı bu uç noktayı ve katalogdaki diğer tüm API'leri ve modelleri kapsar. Tripadvisor API erişimi için ayrıca başvuru yapmanız gerekmez.