Sand AISand AI MAGI-2ตอนนี้ MAGI-2 อยู่บน SandBase แล้ว: วิดีโอ 1080p พร้อมเสียงในตัวลองใช้เลย

Tripadvisor Search

เอกสาร API
https://api.sandbase.ai/v1/api/tripadvisor/search

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

ราคา
$0.00015USD / คำขอ
Method
POST
การตอบกลับ
JSON
พารามิเตอร์
1 จำเป็น · 9 ไม่บังคับ

Playground

อินพุต
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
เอาต์พุตพร้อมใช้งาน

เอาต์พุตของคุณจะแสดงที่นี่

กรอกอินพุตให้ครบ แล้วคลิก Run

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.

สำรวจเพิ่มเติม

APIs ที่เกี่ยวข้อง

APIs ทั้งหมด
APIราคาการตอบกลับ
Tripadvisor SearchAPI นี้
Tripadvisor
$0.00015 ต่อการเรียกJSON
Tripadvisor$0.00015 ต่อการเรียกAsync JSON
Tripadvisor$0.00015 ต่อการเรียกJSON

คำถาม

คำถามที่พบบ่อย

ฉันจะใช้ Tripadvisor Search API ได้อย่างไร?

ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/tripadvisor/search โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด

Tripadvisor Search API ราคาเท่าไร?

$0.00015 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน

Tripadvisor Search API รับพารามิเตอร์อะไรบ้าง?

ที่ต้องระบุ: 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 ในหน้านี้แสดงทุกฟิลด์

Tripadvisor Search API ส่งคืนอะไร?

การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ

ฉันจำเป็นต้องมีบัญชีนักพัฒนาหรือ API key ของ Tripadvisor ไหม?

ไม่จำเป็น Tripadvisor Search ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Tripadvisor API แยกต่างหาก