qstringobligatoire
Search text, 1 to 500 characters.
https://api.sandbase.ai/v1/api/tripadvisor/searchSearch Tripadvisor hotels, restaurants, attractions and places by keyword.
Votre sortie apparaîtra ici
Complétez les entrées, puis cliquez sur Exécuter.
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.
place_id and page link for a named business before looking up more detail.lat, lon and place_type.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.
| Name | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Search text, 1 to 500 characters. |
geo_id | integer | No | Tripadvisor geography ID to search within. |
lat | number | No | Search center latitude from -90 through 90. Requires lon. |
locale | string | No | Lowercase language code with an optional uppercase country, such as en or en-US. |
lon | number | No | Search center longitude from -180 through 180. Requires lat. |
num | integer | No | Maximum number of search_results, 1 through 30, including any leading exact match. |
place_type | string | No | Restrict results to one entity type. |
start | integer | No | Result offset from 0 through 10,000. Offsets and positions count any leading exact match. |
timeout | number | No | 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 cal |
tripadvisor_domain | string | No | Supported first-party localized Tripadvisor hostname, such as www.tripadvisor.co.uk. |
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
}
]
}
| Field | Meaning |
|---|---|
search_results[].title | Name of the place, such as a hotel, restaurant or attraction. |
search_results[].place_id | Tripadvisor ID of the place, given as a string. It matches the number after -d in the link URL. |
search_results[].type / search_results[].detail_type | Entity 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_rating | Average rating of the place and the top of the rating scale, which is 5 in this response. |
search_results[].reviews | Number of reviews for the place. |
search_results[].link | Full Tripadvisor page URL for the place. |
search_results[].location | City or region text shown for the place, such as Austin, Texas. |
search_results[].position / search_results[].position_in_page | Rank of the result across the whole result set and within the current page. |
search_results[].thumbnail / search_results[].image.url_template | Photo URL for the result. In url_template, replace {width} and {height} to request a size. |
search_information.total_results / search_information.results_on_page | Total number of matches for the query and the number of results returned in this response. |
start (offset) and num (up to 30 results in one response).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.$0.00015 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Commencer à construire
Point de terminaison de l'API de la plateforme avec authentification unifiée et suivi de l'utilisation.
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",
"num": 30,
"start": 0,
"locale": "en-US",
"place_type": "all"
}'Définissez votre clé API SandBase dans l'environnement de votre serveur. Les requêtes utilisent l'authentification Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conservez votre clé côté serveur. Ne l'exposez pas dans le code du navigateur.
qstringobligatoireSearch text, 1 to 500 characters.
tripadvisor_domainstringSupported first-party localized Tripadvisor hostname, such as www.tripadvisor.co.uk.
localestringLowercase language code with an optional uppercase country, such as en or en-US.
Par défaut : "en-US"
geo_idintegerTripadvisor geography ID to search within.
latnumberSearch center latitude from -90 through 90. Requires lon.
lonnumberSearch center longitude from -180 through 180. Requires lat.
place_typestringRestrict results to one entity type.
Par défaut : "all"
Valeurs possibles : all, accommodation, attraction, attraction_product, eatery, geo
startintegerResult offset from 0 through 10,000. Offsets and positions count any leading exact match.
Par défaut : 0
numintegerMaximum number of search_results, 1 through 30, including any leading exact match.
Par défaut : 30
timeoutnumberOptional 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
Exemple de réponse enregistré pour cette API ; aucune requête en direct n'est effectuée lors de l'affichage.
Aucune réponse enregistrée n'a été publiée. Exécutez l'API dans Playground pour inspecter sa réponse.
Explorer plus
| API | Prix | Réponse |
|---|---|---|
Tripadvisor SearchCette API Tripadvisor | $0.00015 par appel | JSON |
Tripadvisor | $0.00015 par appel | JSON asynchrone |
Tripadvisor | $0.00015 par appel | JSON |
Questions
Envoyez une requête POST à https://api.sandbase.ai/v1/api/tripadvisor/search avec votre clé API SandBase dans l’en-tête Authorization (Bearer) et les paramètres dans un corps JSON. Vous pouvez aussi l’essayer dans le Playground sur cette page sans écrire de code.
$0.00015 par appel, facturé depuis votre solde SandBase. Vous ne payez que les appels que vous effectuez ; aucun abonnement.
Obligatoire : q (string). Facultatif : tripadvisor_domain (string), locale (string), geo_id (integer), lat (number), lon (number) et place_type (l’un de all, accommodation, attraction, attraction_product, eatery, geo) et 3 de plus. Le tableau des paramètres et le Playground sur cette page listent tous les champs.
Une réponse JSON renvoyée dans la même requête HTTP (synchrone). Le README sur cette page inclut un exemple de réponse.
Non. Tripadvisor Search fonctionne via SandBase, donc une seule clé API SandBase couvre ce point de terminaison ainsi que toutes les autres API et tous les modèles du catalogue. Vous n’avez pas besoin de demander un accès API Tripadvisor séparément.