qstring必須
Search text, 1 to 500 characters.
https://api.sandbase.ai/v1/api/tripadvisor/searchSearch Tripadvisor hotels, restaurants, attractions and places by keyword.
出力はここに表示されます
入力を完了してから[実行]をクリックしてください。
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.
開発を始める
統一認証と使用状況の追跡を備えたプラットフォームAPIエンドポイントです。
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"
}'SandBaseのAPIキーをサーバー環境に設定してください。リクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_KEY"キーはサーバー側で管理してください。ブラウザコードに公開しないでください。
qstring必須Search 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.
デフォルト: "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.
デフォルト: "all"
指定可能な値: all, accommodation, attraction, attraction_product, eatery, geo
startintegerResult offset from 0 through 10,000. Offsets and positions count any leading exact match.
デフォルト: 0
numintegerMaximum number of search_results, 1 through 30, including any leading exact match.
デフォルト: 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
このAPIの保存済みサンプルレスポンスです。表示時にライブリクエストは行われません。
保存済みレスポンスはまだ公開されていません。PlaygroundでAPIを実行し、レスポンスを確認してください。
さらに探索
| API | 価格 | レスポンス |
|---|---|---|
Tripadvisor Searchこの API Tripadvisor | $0.00015 / 回 | JSON |
Tripadvisor | $0.00015 / 回 | 非同期 JSON |
Tripadvisor | $0.00015 / 回 | JSON |
質問
Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/tripadvisor/search に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。
1回あたり $0.00015、SandBase 残高から課金されます。課金対象はご利用分のみで、サブスクリプションはありません。
必須: q (string)。 任意: tripadvisor_domain (string), locale (string), geo_id (integer), lat (number), lon (number) と place_type(all, accommodation, attraction, attraction_product, eatery, geo のいずれか) と他 3 件。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。
同じ HTTP リクエスト内で返される JSON レスポンスです(同期)。 このページの README にサンプルレスポンスがあります。
いいえ。Tripadvisor Search は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。Tripadvisor の API アクセスを別途申請する必要はありません。