Skip to content

最后更新

更新日志

trip.com API

正常只读

来自 trip.com 的结构化数据。 来源: www.trip.com.

基础 URL
https://api.maviapi.com/v1/sites/trip
3
端点
1 h ago
最近验证
3110ms
p50 延迟
GET/search_hotels5 credits per call

搜索酒店

按目的地或地图区域及入住日期查询 Trip.com 上的酒店,每个站点页面 10 家。每家酒店包含 id、英文名称、WGS-84 经纬度(中国大陆酒店另附 GCJ-02 坐标)、物业类型、星级、评论评分和评论数、整个住宿期间的总价及币种、是否含税费、免费取消标记(Trip.com 显示时提供)、图片 URL,以及带有相同日期、入住人数和房间数的酒店页面 URL。可预订的酒店排在前面,其后是已售罄的酒店(available=false,无价格)。按目的地搜索时采用 Trip.com 的推荐排序;按地图区域搜索时按距区域中心由近到远排序,并返回 distance_km。

Bearer auth. Pass your key as Authorization: Bearer <key> on every request.
stringOptionalin 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

stringOptionalin query

check-in date YYYY-MM-DD (default: 30 days from today)

stringOptionalin query

check-out date YYYY-MM-DD (default: 2 nights after checkin)

integerOptionalin query

number of adults in total

integerOptionalin query

number of children (ages taken from child_ages, missing ages count as 8)

stringOptionalin query

comma-separated child ages, e.g. "4,9"

integerOptionalin query

number of rooms

stringOptionalin query

ISO currency code for prices, e.g. USD, EUR, JPY

integerOptionalin 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)

stringOptionalin query

bounding box northern latitude, WGS-84 decimal degrees (give all four of north, south, east, west)

stringOptionalin query

bounding box southern latitude

stringOptionalin query

bounding box eastern longitude

stringOptionalin query

bounding box western longitude

stringOptionalin query

centre latitude, WGS-84 decimal degrees (with lng; used instead of a bounding box)

stringOptionalin query

centre longitude

stringOptionalin query

radius around lat/lng in km (default 2)

destinationobject5 fields
namestringe.g."Paris"
typestringe.g."CT"
trip_idstringe.g."192"
citystringe.g."Paris"
countrystringe.g."France"
checkinstringe.g."2026-12-28"
checkoutstringe.g."2026-12-30"
adultsintegere.g.2
childrenintegere.g.0
roomsintegere.g.1
currencystringe.g."USD"
pageintegere.g.1
page_sizeintegere.g.10
total_resultsintegere.g.6661
is_last_pagebooleane.g.false
hotelsobject[]25 fields
hotel_idstringe.g."2171570"
namestringe.g."Hotel des Grands Voyageurs"
latitudenumbere.g.48.84698
longitudenumbere.g.2.32594
coordinate_systemstringe.g."WGS-84"
latitude_gcj02null
longitude_gcj02null
property_typestringe.g."Hotel"
star_ratingintegere.g.4
review_scorenumbere.g.9.3
review_score_maxnumbere.g.10
review_countintegere.g.141
areastringe.g."Near Paris Montparnasse Station | Jardin du Luxembourg"
citystringe.g."Paris"
availablebooleane.g.true
availability_notenull
room_namestringe.g."Classic Room"
total_pricenumbere.g.610.77
prepay_onlinenumbere.g.573.81
currencystringe.g."USD"
taxes_and_fees_includedbooleane.g.true
price_notestringe.g."Total price: $611 1 room × 2 nights incl. taxes & fees"
free_cancellationnull
photosstring[]
urlstringe.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"
paginationobject3 fields
countintegere.g.10
has_morebooleane.g.true
next_cursorstringe.g."WzEsIjBjNmYwZjFlIixudWxsLDAseyJwYWdlIjoyfV0"
fetched_atstringe.g."2026-11-28T14:50:45.093Z"
ageintegere.g.0
Try itLive
GET
https://api.maviapi.com/v1/sites/trip/search_hotels?destination=Paris&adults=2&children=0&rooms=1&currency=USD&page=1
Request
curl "https://api.maviapi.com/v1/sites/trip/search_hotels?destination=Paris&adults=2&children=0&rooms=1&currency=USD&page=1" \
-H "Authorization: Bearer $MAVI_KEY"
Example1.6 KB
{
  "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.

How to connect
https://mcp.maviapi.com/mcp

Or 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 import

Paste 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 的参数和响应字段
    请求参数
    名称类型 / 位置必填说明
    destinationstring / 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
    checkinstring / query否check-in date YYYY-MM-DD (default: 30 days from today)
    checkoutstring / query否check-out date YYYY-MM-DD (default: 2 nights after checkin)
    adultsinteger / query否number of adults in total
    childreninteger / query否number of children (ages taken from child_ages, missing ages count as 8)
    child_agesstring / query否comma-separated child ages, e.g. "4,9"
    roomsinteger / query否number of rooms
    currencystring / query否ISO currency code for prices, e.g. USD, EUR, JPY
    pageinteger / 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)
    northstring / query否bounding box northern latitude, WGS-84 decimal degrees (give all four of north, south, east, west)
    southstring / query否bounding box southern latitude
    eaststring / query否bounding box eastern longitude
    weststring / query否bounding box western longitude
    latstring / query否centre latitude, WGS-84 decimal degrees (with lng; used instead of a bounding box)
    lngstring / query否centre longitude
    radius_kmstring / query否radius around lat/lng in km (default 2)
    响应字段
    字段类型说明
    destinationobject
    destination.namestring
    destination.typestring
    destination.trip_idstring
    destination.citystring
    destination.countrystring
    checkinstring
    checkoutstring
    adultsinteger
    childreninteger
    roomsinteger
    currencystring
    pageinteger
    page_sizeinteger
    total_resultsinteger
    is_last_pageboolean
    hotelsobject[]
    hotels[].hotel_idstring
    hotels[].namestring
    hotels[].latitudenumber
    hotels[].longitudenumber
    hotels[].coordinate_systemstring
    hotels[].latitude_gcj02null
    hotels[].longitude_gcj02null
    hotels[].property_typestring
    hotels[].star_ratinginteger
    hotels[].review_scorenumber
    hotels[].review_score_maxnumber
    hotels[].review_countinteger
    hotels[].areastring
    hotels[].citystring
    hotels[].availableboolean
    hotels[].availability_notenull
    hotels[].room_namestring
    hotels[].total_pricenumber
    hotels[].prepay_onlinenumber
    hotels[].currencystring
    hotels[].taxes_and_fees_includedboolean
    hotels[].price_notestring
    hotels[].free_cancellationnull
    hotels[].photosstring[]
    hotels[].urlstring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursorstring
    fetched_atstring
    ageinteger
  • 搜索酒店 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 的参数和响应字段
    请求参数
    名称类型 / 位置必填说明
    destinationstring / 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
    checkinstring / query否check-in date YYYY-MM-DD (default: 30 days from today)
    checkoutstring / query否check-out date YYYY-MM-DD (default: 2 nights after checkin)
    adultsinteger / query否number of adults in total
    childreninteger / query否number of children (ages taken from child_ages, missing ages count as 8)
    child_agesstring / query否comma-separated child ages, e.g. "4,9"
    roomsinteger / query否number of rooms
    currencystring / query否ISO currency code for prices, e.g. USD, EUR, JPY
    pageinteger / query否page number, starting at 1
    page_sizeinteger / query否hotels per page, 1 to 100 (default 10)
    northstring / query否bounding box northern latitude, WGS-84 decimal degrees (give all four of north, south, east, west)
    southstring / query否bounding box southern latitude
    eaststring / query否bounding box eastern longitude
    weststring / query否bounding box western longitude
    latstring / query否centre latitude, WGS-84 decimal degrees (with lng; used instead of a destination, ignored with a bounding box)
    lngstring / query否centre longitude
    radius_kmstring / query否radius around lat/lng in km (default 2)
    响应字段
    字段类型说明
    destinationobject
    destination.namestring
    destination.typestring
    destination.trip_idstring
    destination.citystring
    destination.countrystring
    checkinstring
    checkoutstring
    adultsinteger
    childreninteger
    roomsinteger
    currencystring
    pageinteger
    page_sizeinteger
    total_resultsinteger
    total_results_exactboolean
    is_last_pageboolean
    hotelsobject[]
    hotels[].hotel_idstring
    hotels[].namestring
    hotels[].latitudenumber
    hotels[].longitudenumber
    hotels[].coordinate_systemstring
    hotels[].latitude_gcj02null
    hotels[].longitude_gcj02null
    hotels[].property_typestring
    hotels[].star_ratinginteger
    hotels[].review_scorenumber
    hotels[].review_score_maxnumber
    hotels[].review_countinteger
    hotels[].areastring
    hotels[].citystring
    hotels[].availableboolean
    hotels[].availability_notenull
    hotels[].room_namestring
    hotels[].total_pricenumber
    hotels[].prepay_onlinenumber
    hotels[].currencystring
    hotels[].taxes_and_fees_includedboolean
    hotels[].price_notestring
    hotels[].free_cancellationboolean
    hotels[].photosstring[]
    hotels[].urlstring
    hotels[].rooms_pricedinteger
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursorstring
    fetched_atstring
    ageinteger
  • 酒店详情 GET /hotel_details

    单家 Trip.com 酒店的信息:名称、描述、地址、WGS-84 坐标(中国大陆酒店另附 GCJ-02 坐标)、星级、酒店相册中的全部图片、按类别划分的设施、评论评分和评论数、入住和退房时间、其他政策,以及整个住宿期间的最低总价(所选日期无可预订房间时为 null,且 available=false)。

    GET /hotel_details 的参数和响应字段
    请求参数
    名称类型 / 位置必填说明
    hotel_idstring / query否Trip.com hotel id, as returned by the search endpoints
    checkinstring / query否check-in date YYYY-MM-DD (default: 30 days from today)
    checkoutstring / query否check-out date YYYY-MM-DD (default: 2 nights after checkin)
    adultsinteger / query否number of adults in total
    childreninteger / query否number of children (ages taken from child_ages, missing ages count as 8)
    child_agesstring / query否comma-separated child ages, e.g. "4,9"
    roomsinteger / query否number of rooms
    currencystring / query否ISO currency code for prices, e.g. USD, EUR, JPY
    响应字段
    字段类型说明
    hotel_idstring
    namestring
    local_namestring
    star_ratinginteger
    star_rating_typestring
    descriptionstring
    addressstring
    areastring
    citystring
    provincestring
    countrystring
    latitudenumber
    longitudenumber
    coordinate_systemstring
    latitude_gcj02null
    longitude_gcj02null
    openedstring
    renovatedstring
    review_scorenumber
    review_score_maxnumber
    review_countinteger
    review_subscoresobject
    review_subscores.Cleanlinessnumber
    review_subscores.Amenitiesnumber
    review_subscores.Locationnumber
    review_subscores.Servicenumber
    check_in_timestring
    check_out_timestring
    front_desk_hoursstring
    policiesobject[]
    policies[].titlestring
    policies[].textstring[]
    amenitiesobject[]
    amenities[].categorystring
    amenities[].descriptionnull
    amenities[].itemsobject[]
    amenities[].items[].namestring
    amenities[].items[].notestring
    photosobject[]
    photos[].urlstring
    photos[].categorystring
    photos[].titlestring
    photos[].sourcestring
    checkinstring
    checkoutstring
    adultsinteger
    childreninteger
    roomsinteger
    availableboolean
    lowest_priceobject
    lowest_price.total_pricenumber
    lowest_price.currencystring
    lowest_price.taxes_and_fees_includedboolean
    lowest_price.pay_nownumber
    lowest_price.room_namestring
    lowest_price.mealstring
    lowest_price.cancellationstring
    lowest_price.free_cancellationboolean
    lowest_price.price_notestring
    urlstring
    fetched_atstring
    ageinteger

将 trip.com 数据导出为 CSV

下面的每个列表都可以下载为 CSV 文件,每条记录一行。用上方控制台下面的 "Get all the data, no code" 卡片把列表收集到数据集中。数据集会逐页读取列表,之后可下载为 CSV、JSON 或 JSONL。

列表CSV 列
搜索酒店GET /search_hotelshotel_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-v2hotel_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
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 修改页面时,maviapi 会让 trip.com API 保持可用,您继续调用同样的端点,并得到本页文档所述结构的 JSON。它当前的运行状况见状态页,变更记录见它的更新日志。

更新会破坏我的 trip.com API 集成吗?

不会。您正在使用的端点,其结构永远不会改变:新的字段、可选参数和端点只会加在旁边,会破坏调用的变更则作为新端点发布。请忽略您不认识的响应字段,新内容请关注更新日志。

  • Tripadvisor API

    来自 Tripadvisor 的行程规划数据:支持地点搜索,并可按地点(geo_id)获取景点、餐厅和酒店,包含评分、评论、价格和坐标。先用 /search 解析地名,再通过…

  • Songkick 演唱会 API

    从 Songkick 获取任意城市在指定日期范围内即将举行的演唱会和音乐节,包含场馆、演出者、票价和购票链接。

  • Google Maps API

    来自 maps.google.com 的结构化数据。