Sand AISand AI MAGI-2MAGI-2 ist jetzt auf SandBase: 1080p-Video mit nativem AudioJetzt testen

Tripadvisor Search

API-Dokumentation
https://api.sandbase.ai/v1/api/tripadvisor/search

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

Preis
$0.00015USD / Aufruf
Methode
POST
Antwort
JSON
Parameter
1 erforderlich · 9 optional

Playground

Eingabe
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
AusgabeBereit

Ihre Ausgabe wird hier angezeigt

Vervollständigen Sie die Eingaben und klicken Sie dann auf Ausführen.

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.

Mehr entdecken

Verwandte APIs

Alle APIs
APIPreisAntwort
Tripadvisor$0.00015 pro AufrufJSON
Tripadvisor$0.00015 pro AufrufAsynchrones JSON
Tripadvisor$0.00015 pro AufrufJSON

Fragen

FAQ

Wie verwende ich die Tripadvisor Search API?

Senden Sie eine POST-Anfrage an https://api.sandbase.ai/v1/api/tripadvisor/search mit Ihrem SandBase API-Schlüssel im Authorization-Header (Bearer) und den Parametern als JSON-Body. Sie können das auch ohne Code direkt auf dieser Seite im Playground testen.

Was kostet die Tripadvisor Search API?

$0.00015 pro Aufruf, abgerechnet von Ihrem SandBase-Guthaben. Es werden nur die von Ihnen getätigten Aufrufe berechnet; es gibt kein Abo.

Welche Parameter akzeptiert die Tripadvisor Search API?

Erforderlich: q (string). Optional: tripadvisor_domain (string), locale (string), geo_id (integer), lat (number), lon (number) und place_type (eines von all, accommodation, attraction, attraction_product, eatery, geo) und 3 weitere. Die Parametertabelle und der Playground auf dieser Seite listen jedes Feld auf.

Was gibt die Tripadvisor Search API zurück?

Eine JSON-Antwort, die in derselben HTTP-Anfrage zurückgegeben wird (synchron). Die README auf dieser Seite enthält eine Beispielantwort.

Benötige ich ein Tripadvisor-Entwicklerkonto oder einen API-Schlüssel?

Nein. Tripadvisor Search läuft über SandBase, daher deckt ein SandBase API-Schlüssel diesen Endpunkt und jede andere API sowie jedes Modell im Katalog ab. Sie müssen keinen separaten Zugang für Tripadvisor API beantragen.