最后更新
更新日志/search_hotels5 credits per call搜索酒店
按目的地或地图区域及入住日期查询 Trip.com 上的酒店,每个站点页面 10 家。每家酒店包含 id、英文名称、WGS-84 经纬度(中国大陆酒店另附 GCJ-02 坐标)、物业类型、星级、评论评分和评论数、整个住宿期间的总价及币种、是否含税费、免费取消标记(Trip.com 显示时提供)、图片 URL,以及带有相同日期、入住人数和房间数的酒店页面 URL。可预订的酒店排在前面,其后是已售罄的酒店(available=false,无价格)。按目的地搜索时采用 Trip.com 的推荐排序;按地图区域搜索时按距区域中心由近到远排序,并返回 distance_km。
Authorization: Bearer <key> on every request.Parameters
free text - a city, region, country, district, landmark, station or hotel name (e.g. "Tokyo", "Eiffel Tower"); ignored when a map area is given
check-in date YYYY-MM-DD (default: 30 days from today)
check-out date YYYY-MM-DD (default: 2 nights after checkin)
number of adults in total
number of children (ages taken from child_ages, missing ages count as 8)
comma-separated child ages, e.g. "4,9"
number of rooms
ISO currency code for prices, e.g. USD, EUR, JPY
page number, starting at 1 (in a bounding-box search a page can hold fewer than 10 hotels: those outside the box are left out)
bounding box northern latitude, WGS-84 decimal degrees (give all four of north, south, east, west)
bounding box southern latitude
bounding box eastern longitude
bounding box western longitude
centre latitude, WGS-84 decimal degrees (with lng; used instead of a bounding box)
centre longitude
radius around lat/lng in km (default 2)
Response fields
destination
namee.g."Paris"typee.g."CT"trip_ide.g."192"citye.g."Paris"countrye.g."France"checkine.g."2026-12-28"checkoute.g."2026-12-30"adultse.g.2childrene.g.0roomse.g.1currencye.g."USD"pagee.g.1page_sizee.g.10total_resultse.g.6661is_last_pagee.g.falsehotels
hotel_ide.g."2171570"namee.g."Hotel des Grands Voyageurs"latitudee.g.48.84698longitudee.g.2.32594coordinate_systeme.g."WGS-84"latitude_gcj02longitude_gcj02property_typee.g."Hotel"star_ratinge.g.4review_scoree.g.9.3review_score_maxe.g.10review_counte.g.141areae.g."Near Paris Montparnasse Station | Jardin du Luxembourg"citye.g."Paris"availablee.g.trueavailability_noteroom_namee.g."Classic Room"total_pricee.g.610.77prepay_onlinee.g.573.81currencye.g."USD"taxes_and_fees_includede.g.trueprice_notee.g."Total price: $611 1 room × 2 nights incl. taxes & fees"free_cancellationphotosurle.g."https://us.trip.com/hotels/detail/?hotelId=2171570&checkIn=2026-12-28&checkOut=2026-12-30&adult=2&children=0&ages=&crn=1&curr=USD"pagination
counte.g.10has_moree.g.truenext_cursore.g."WzEsIjBjNmYwZjFlIixudWxsLDAseyJwYWdlIjoyfV0"fetched_ate.g."2026-11-28T14:50:45.093Z"agee.g.0curl "https://api.maviapi.com/v1/sites/trip/search_hotels?destination=Paris&adults=2&children=0&rooms=1¤cy=USD&page=1" \-H "Authorization: Bearer $MAVI_KEY"
{
"destination": {
"name": "Paris",
"type": "CT",
"trip_id": "192",
"city": "Paris",
"country": "France"
},
"checkin": "2026-12-28",
"checkout": "2026-12-30",
"adults": 2,
"children": 0,
"rooms": 1,
"currency": "USD",
"page": 1,
"page_size": 10,
"total_results": 6661,
"is_last_page": false,
"hotels": [
{
"hotel_id": "2171570",
"name": "Hotel des Grands Voyageurs",
"latitude": 48.84698,
"longitude": 2.32594,
"coordinate_system": "WGS-84",
"latitude_gcj02": null,
"longitude_gcj02": null,
"property_type": "Hotel",
"star_rating": 4,
"review_score": 9.3,
"review_score_max": 10,
"review_count": 141,
"area": "Near Paris Montparnasse Station | Jardin du Luxembourg",
"city": "Paris",
"available": true,
"availability_note": null,
"room_name": "Classic Room",
"total_price": 610.77,
"prepay_online": 573.81,
"currency": "USD",
"taxes_and_fees_included": true,
"price_note": "Total price: $611 1 room × 2 nights incl. taxes & fees",
"free_cancellation": null,
"photos": [
"https://ak-d.tripcdn.com/images/0226e12000bkg26ckC720_R_600_600_R5_D.jpg"
],
"url": "https://us.trip.com/hotels/detail/?hotelId=2171570&checkIn=2026-12-28&checkOut=2026-12-30&adult=2&children=0&ages=&crn=1&curr=USD"
}
],
"pagination": {
"count": 10,
"has_more": true,
"next_cursor": "WzEsIjBjNmYwZjFlIixudWxsLDAseyJwYWdlIjoyfV0"
},
"fetched_at": "2026-11-28T14:50:45.093Z",
"age": 0
}Get all the data, no code
Collect every page of GET /search_hotels into a dataset, for one request or for a whole list of them, then download it as CSV or JSON. A page costs the same as one call of the endpoint; the download is free.
Use trip.com API from Claude, ChatGPT and your coding tools
Add this URL as a custom connector and sign in to maviapi. Nothing to install.
https://mcp.maviapi.com/mcpOr run it locally, with each endpoint of trip.com API as its own tool:
claude mcp add maviapi -e MAVIAPI_TOOLS=trip -- npx -y '@maviapi/mcp'Import trip.com API into Postman and other tools
How to importPaste a link into Postman, Insomnia, an agent framework or a no-code tool to get every endpoint with its parameters and response fields. The link always serves the current endpoints, so importing it again picks up new ones.
- OpenAPI 3.1
https://api.maviapi.com/v1/apis/trip/openapi.json - Postman
https://api.maviapi.com/v1/apis/trip/postman.json
The Postman collection sends the shared demo key until you put your own key in its maviapi_key variable.
使用 trip.com API 进行开发
选择一个端点开始
- 搜索酒店
GET /search_hotels按目的地或地图区域及入住日期查询 Trip.com 上的酒店,每个站点页面 10 家。每家酒店包含 id、英文名称、WGS-84 经纬度(中国大陆酒店另附 GCJ-02 坐标)、物业类型、星级、评论评分和评论数、整个住宿期间的总价及币种、是否含税费、免费取消标记(Trip.com 显示时提供)、图片 URL,以及带有相同日期、入住人数和房间数的酒店页面 URL。可预订的酒店排在前面,其后是已售罄的酒店(available=false,无价格)。按目的地搜索时采用 Trip.com 的推荐排序;按地图区域搜索时按距区域中心由近到远排序,并返回 distance_km。
GET /search_hotels 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 destination string / query 否 free text - a city, region, country, district, landmark, station or hotel name (e.g. "Tokyo", "Eiffel Tower"); ignored when a map area is given checkin string / query 否 check-in date YYYY-MM-DD (default: 30 days from today) checkout string / query 否 check-out date YYYY-MM-DD (default: 2 nights after checkin) adults integer / query 否 number of adults in total children integer / query 否 number of children (ages taken from child_ages, missing ages count as 8) child_ages string / query 否 comma-separated child ages, e.g. "4,9" rooms integer / query 否 number of rooms currency string / query 否 ISO currency code for prices, e.g. USD, EUR, JPY page integer / query 否 page number, starting at 1 (in a bounding-box search a page can hold fewer than 10 hotels: those outside the box are left out) north string / query 否 bounding box northern latitude, WGS-84 decimal degrees (give all four of north, south, east, west) south string / query 否 bounding box southern latitude east string / query 否 bounding box eastern longitude west string / query 否 bounding box western longitude lat string / query 否 centre latitude, WGS-84 decimal degrees (with lng; used instead of a bounding box) lng string / query 否 centre longitude radius_km string / query 否 radius around lat/lng in km (default 2) 响应字段 字段 类型 说明 destination object destination.name string destination.type string destination.trip_id string destination.city string destination.country string checkin string checkout string adults integer children integer rooms integer currency string page integer page_size integer total_results integer is_last_page boolean hotels object[] hotels[].hotel_id string hotels[].name string hotels[].latitude number hotels[].longitude number hotels[].coordinate_system string hotels[].latitude_gcj02 null hotels[].longitude_gcj02 null hotels[].property_type string hotels[].star_rating integer hotels[].review_score number hotels[].review_score_max number hotels[].review_count integer hotels[].area string hotels[].city string hotels[].available boolean hotels[].availability_note null hotels[].room_name string hotels[].total_price number hotels[].prepay_online number hotels[].currency string hotels[].taxes_and_fees_included boolean hotels[].price_note string hotels[].free_cancellation null hotels[].photos string[] hotels[].url string pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor string fetched_at string age integer - 搜索酒店 V2
GET /search_hotels-v2按目的地、地图边界框或中心点加半径,以及指定的入住日期,查询 Trip.com 上的酒店,每页最多 100 条。字段与 /search_hotels 相同:id、英文名称、WGS-84 经纬度(中国大陆酒店另附 GCJ-02 坐标)、物业类型、星级、评论评分和评论数、整个住宿期间的总价及币种、是否含税费、照片 URL 和酒店页面 URL。此外,每条可预订记录还包含 free_cancellation(所报价方案是否可免费取消,true/false)和 rooms_priced(total_price 涵盖的房间数:酒店有该房间数且能容纳所选住客的方案时,即为请求的房间数;否则为网站建议的房间数,price_note 中也会注明)。已售罄记录的 available=false,且不含价格字段(total_price、price_note、free_cancellation 和 rooms_priced 均为 null)。可预订酒店排在前面,已售罄酒店排在后面。按目的地搜索时,结果按 Trip.com 的推荐顺序排列。按边界框搜索时,只返回框内的酒店,可预订的在前,每组内按距框中心由近到远排序;total_results 为框内酒店总数(区域内酒店过于密集、无法完整统计时,total_results_exact=false,此时返回的记录和数量仅涵盖离框中心最近的酒店)。按中心点搜索时,返回半径范围内的酒店,按由近到远排序。地图搜索的结果包含 distance_km。
GET /search_hotels-v2 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 destination string / query 否 free text - a city, region, country, district, landmark, station or hotel name (e.g. "Tokyo", "Eiffel Tower"); ignored when a map area is given checkin string / query 否 check-in date YYYY-MM-DD (default: 30 days from today) checkout string / query 否 check-out date YYYY-MM-DD (default: 2 nights after checkin) adults integer / query 否 number of adults in total children integer / query 否 number of children (ages taken from child_ages, missing ages count as 8) child_ages string / query 否 comma-separated child ages, e.g. "4,9" rooms integer / query 否 number of rooms currency string / query 否 ISO currency code for prices, e.g. USD, EUR, JPY page integer / query 否 page number, starting at 1 page_size integer / query 否 hotels per page, 1 to 100 (default 10) north string / query 否 bounding box northern latitude, WGS-84 decimal degrees (give all four of north, south, east, west) south string / query 否 bounding box southern latitude east string / query 否 bounding box eastern longitude west string / query 否 bounding box western longitude lat string / query 否 centre latitude, WGS-84 decimal degrees (with lng; used instead of a destination, ignored with a bounding box) lng string / query 否 centre longitude radius_km string / query 否 radius around lat/lng in km (default 2) 响应字段 字段 类型 说明 destination object destination.name string destination.type string destination.trip_id string destination.city string destination.country string checkin string checkout string adults integer children integer rooms integer currency string page integer page_size integer total_results integer total_results_exact boolean is_last_page boolean hotels object[] hotels[].hotel_id string hotels[].name string hotels[].latitude number hotels[].longitude number hotels[].coordinate_system string hotels[].latitude_gcj02 null hotels[].longitude_gcj02 null hotels[].property_type string hotels[].star_rating integer hotels[].review_score number hotels[].review_score_max number hotels[].review_count integer hotels[].area string hotels[].city string hotels[].available boolean hotels[].availability_note null hotels[].room_name string hotels[].total_price number hotels[].prepay_online number hotels[].currency string hotels[].taxes_and_fees_included boolean hotels[].price_note string hotels[].free_cancellation boolean hotels[].photos string[] hotels[].url string hotels[].rooms_priced integer pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor string fetched_at string age integer - 酒店详情
GET /hotel_details单家 Trip.com 酒店的信息:名称、描述、地址、WGS-84 坐标(中国大陆酒店另附 GCJ-02 坐标)、星级、酒店相册中的全部图片、按类别划分的设施、评论评分和评论数、入住和退房时间、其他政策,以及整个住宿期间的最低总价(所选日期无可预订房间时为 null,且 available=false)。
GET /hotel_details 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 hotel_id string / query 否 Trip.com hotel id, as returned by the search endpoints checkin string / query 否 check-in date YYYY-MM-DD (default: 30 days from today) checkout string / query 否 check-out date YYYY-MM-DD (default: 2 nights after checkin) adults integer / query 否 number of adults in total children integer / query 否 number of children (ages taken from child_ages, missing ages count as 8) child_ages string / query 否 comma-separated child ages, e.g. "4,9" rooms integer / query 否 number of rooms currency string / query 否 ISO currency code for prices, e.g. USD, EUR, JPY 响应字段 字段 类型 说明 hotel_id string name string local_name string star_rating integer star_rating_type string description string address string area string city string province string country string latitude number longitude number coordinate_system string latitude_gcj02 null longitude_gcj02 null opened string renovated string review_score number review_score_max number review_count integer review_subscores object review_subscores.Cleanliness number review_subscores.Amenities number review_subscores.Location number review_subscores.Service number check_in_time string check_out_time string front_desk_hours string policies object[] policies[].title string policies[].text string[] amenities object[] amenities[].category string amenities[].description null amenities[].items object[] amenities[].items[].name string amenities[].items[].note string photos object[] photos[].url string photos[].category string photos[].title string photos[].source string checkin string checkout string adults integer children integer rooms integer available boolean lowest_price object lowest_price.total_price number lowest_price.currency string lowest_price.taxes_and_fees_included boolean lowest_price.pay_now number lowest_price.room_name string lowest_price.meal string lowest_price.cancellation string lowest_price.free_cancellation boolean lowest_price.price_note string url string fetched_at string age integer
将 trip.com 数据导出为 CSV
下面的每个列表都可以下载为 CSV 文件,每条记录一行。用上方控制台下面的 "Get all the data, no code" 卡片把列表收集到数据集中。数据集会逐页读取列表,之后可下载为 CSV、JSON 或 JSONL。
| 列表 | CSV 列 |
|---|---|
搜索酒店GET /search_hotels | hotel_id, name, latitude, longitude, coordinate_system, latitude_gcj02, longitude_gcj02, property_type, star_rating, review_score, review_score_max, review_count, area, city, available, availability_note, room_name, total_price, prepay_online, currency, taxes_and_fees_included, price_note, free_cancellation, photos, url |
搜索酒店 V2GET /search_hotels-v2 | hotel_id, name, latitude, longitude, coordinate_system, latitude_gcj02, longitude_gcj02, property_type, star_rating, review_score, review_score_max, review_count, area, city, available, availability_note, room_name, total_price, prepay_online, currency, taxes_and_fees_included, price_note, free_cancellation, photos, url, rooms_priced |
嵌套的值(列表或对象)以 JSON 写入同一个单元格。 数据集和导出如何工作
trip.com API 常见问题
能获取什么数据、费用多少、如何调用。
trip.com 有官方 API 吗?
这个 trip.com API 不是官方 API。它是 maviapi 针对 trip.com 上的公开数据提供的独立托管 API,并非由 trip.com 开发、认可或支持。trip.com 是否提供自己的开发者 API,请向 trip.com 咨询。这个 API 用一个 maviapi 密钥即可调用,它的每个端点和返回的每个字段都在本页有文档说明。
trip.com API 可以获取哪些数据?
trip.com API 有 3 个端点。每个端点都返回 JSON,参数和字段见上方的文档:
- GET
/search_hotels: 按目的地或地图区域及入住日期查询 Trip.com 上的酒店,每个站点页面 10 家。 - GET
/search_hotels-v2: 按目的地、地图边界框或中心点加半径,以及指定的入住日期,查询 Trip.com 上的酒店,每页最多 100 条。 - GET
/hotel_details: 单家 Trip.com 酒店的信息:名称、描述、地址、WGS-84 坐标(中国大陆酒店另附 GCJ-02 坐标)、星级、酒店相册中的全部图片、按类别划分的设施、评论评分和评论数、入住和退房时间、其他政策,以及整个住宿期间的最低总价(所选日期无可预订房间时为 null,且 available=false)。
trip.com API 的价格是多少?
调用用您 maviapi 套餐中的积分支付,只有成功的调用才会计费。此 API 的每个端点每次调用消耗 5 个积分。在 Hobby 套餐下(每月 $49,含 250,000 个积分),1,000 次调用约 $0.98。失败的调用不收费。Free 套餐每月提供 1,000 个积分,无需信用卡。超出部分请查看套餐和积分价格。
如何调用 trip.com API?
向端点发送 HTTPS 请求,并在 Authorization 请求头中带上您的 API 密钥。例如 GET /search_hotels:
curl 'https://api.maviapi.com/v1/sites/trip/search_hotels' \
-H "Authorization: Bearer $MAVI_KEY"在您的 API 密钥页面创建密钥,或者先在上方的控制台中用免费测试密钥试用任意端点。
以 JSON 获取 trip.com 数据有哪些方式?
以 JSON 获取 trip.com 数据的每种方式适合不同的需求:
- 自己写爬虫: 完全由自己掌控,不依赖任何服务商,但解析、被拦截的请求以及 trip.com 每次改版后的修复都要自己负责。更适合从很少变化的页面一次性获取数据。
- Apify: 一个 Actor 市场,Actor 由您自己运行,输入、输出和价格由各个 Actor 决定。当已有 Actor 能返回您需要的数据,或者您想托管自己的代码时更合适。参见maviapi 与 Apify 的对比。
- RapidAPI: 一个汇集了众多提供方 API 的平台,用一个 RapidAPI 密钥调用,每个 API 单独定价。当您已经在使用该平台,并且其中某个 API 能满足需求时更合适。来源:RapidAPI docs。
- maviapi: 本页的 trip.com API:3 个带文档的端点、公开的响应结构,以及一个可用于整个目录的密钥。当这些数据是您产品的一部分,而您不想维护爬虫时更合适。
trip.com 改版后会怎样?
更新会破坏我的 trip.com API 集成吗?
不会。您正在使用的端点,其结构永远不会改变:新的字段、可选参数和端点只会加在旁边,会破坏调用的变更则作为新端点发布。请忽略您不认识的响应字段,新内容请关注更新日志。
相关 API
- Tripadvisor API
来自 Tripadvisor 的行程规划数据:支持地点搜索,并可按地点(geo_id)获取景点、餐厅和酒店,包含评分、评论、价格和坐标。先用 /search 解析地名,再通过…
- Songkick 演唱会 API
从 Songkick 获取任意城市在指定日期范围内即将举行的演唱会和音乐节,包含场馆、演出者、票价和购票链接。
- Google Maps API
来自 maps.google.com 的结构化数据。