qstringobbligatorio
Search text, 1 to 500 characters.
https://api.sandbase.ai/v1/api/tripadvisor/searchSearch Tripadvisor hotels, restaurants, attractions and places by keyword.
Il tuo output apparirà qui
Completa gli input, poi fai clic su Esegui.
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.
Inizia a costruire
Endpoint API della piattaforma con autenticazione unificata e tracciamento dell'utilizzo.
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"
}'Imposta la tua SandBase API key nell'ambiente del server. Le richieste usano l'autenticazione Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conserva la tua key sul server. Non esporla nel codice del browser.
qstringobbligatorioSearch 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.
Predefinito: "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.
Predefinito: "all"
Valori possibili: all, accommodation, attraction, attraction_product, eatery, geo
startintegerResult offset from 0 through 10,000. Offsets and positions count any leading exact match.
Predefinito: 0
numintegerMaximum number of search_results, 1 through 30, including any leading exact match.
Predefinito: 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
Risposta di esempio salvata per questa API; durante la visualizzazione non viene eseguita alcuna richiesta live.
Nessuna risposta salvata è stata pubblicata. Esegui l'API in Playground per ispezionarne la risposta.
Esplora altro
| API | Prezzo | Risposta |
|---|---|---|
Tripadvisor SearchQuesta API Tripadvisor | $0.00015 per chiamata | JSON |
Tripadvisor | $0.00015 per chiamata | JSON asincrono |
Tripadvisor | $0.00015 per chiamata | JSON |
Domande
Invia una richiesta POST a https://api.sandbase.ai/v1/api/tripadvisor/search con la tua chiave API di SandBase nell'header Authorization (Bearer) e i parametri nel body JSON. Puoi anche provarla nel Playground di questa pagina senza scrivere codice.
$0.00015 per chiamata, addebitato dal tuo saldo SandBase. Paghi solo le chiamate che effettui; non c'è alcun abbonamento.
Richiesti: q (string). Facoltativi: tripadvisor_domain (string), locale (string), geo_id (integer), lat (number), lon (number) e place_type (uno tra all, accommodation, attraction, attraction_product, eatery, geo) e altri 3. La tabella dei parametri e il Playground di questa pagina elencano tutti i campi.
Una risposta JSON restituita nella stessa richiesta HTTP (sincrona). Il README di questa pagina include una risposta di esempio.
No. Tripadvisor Search funziona tramite SandBase, quindi una sola chiave API SandBase copre questo endpoint e tutte le altre API e modelli del catalogo. Non è necessario richiedere separatamente l'accesso alle API Tripadvisor.