mcpField
R
rapidapi

rapidapi

github.com/borski其他78075 次安装2 天前更新
代码仓库

关于 rapidapi

RapidAPI 是旅行搜索技能,可查询 Google Flights 实时机票价格以及 Booking.com 酒店和度假租赁价格,作为定向比价的辅助来源。

主要功能

  1. 01搜索实时单程和往返航班
  2. 02设置乘客人数和舱位
  3. 03搜索酒店和度假租赁
  4. 04按价格和评分筛选住宿
  5. 05获取酒店详情

适用场景

  1. 01通过其他来源核对机票价格
  2. 02查询目的地的 Booking.com 价格
  3. 03按日期和预算比较酒店选项

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/borski/travel-hacking-toolkit --skill rapidapi

安装后在 Claude Code 中输入/rapidapi确认已加载。

详细介绍

RapidAPI 技能

通过 RapidAPI 抓取工具搜索 Google Flights 和 Booking.com。作为现金机票价格和酒店/度假租赁价格的辅助来源。

来源:

身份验证

.env 中已设置 RAPIDAPI_KEY。所有请求均使用 x-rapidapi-key 标头。

Google Flights Live API

实时抓取 Google Flights 数据。当 SerpAPI 结果似乎过时,或需要第二个价格参考时使用。

搜索单程航班
curl -s -X POST "https://google-flights-live-api.p.rapidapi.com/api/v1/searchFlights" \
  -H "x-rapidapi-key: $RAPIDAPI_KEY" \
  -H "x-rapidapi-host: google-flights-live-api.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{
    "origin": "SFO",
    "destination": "NRT",
    "date": "2026-08-10",
    "adults": 2,
    "cabinClass": "economy",
    "currency": "USD"
  }' | jq '.'
搜索往返航班
curl -s -X POST "https://google-flights-live-api.p.rapidapi.com/api/v1/searchFlights" \
  -H "x-rapidapi-key: $RAPIDAPI_KEY" \
  -H "x-rapidapi-host: google-flights-live-api.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{
    "origin": "SFO",
    "destination": "NRT",
    "date": "2026-08-10",
    "returnDate": "2026-08-26",
    "adults": 2,
    "cabinClass": "economy",
    "currency": "USD"
  }' | jq '.'
参数
参数必填说明
origin是机场 IATA 代码
destination是机场 IATA 代码
date是出发日期,格式为 YYYY-MM-DD
returnDate否往返行程的返程日期,格式为 YYYY-MM-DD
adults否默认为 1
children否默认为 0
infants否默认为 0
cabinClass否economy、premium_economy、business、first
currency否默认为 USD

Booking.com Live API

使用 Booking.com 的实时价格搜索酒店和度假租赁。可作为 SerpAPI Hotels 和 LiteAPI 的良好补充。

搜索酒店
curl -s "https://booking-live-api.p.rapidapi.com/api/v1/searchHotels?location=Tokyo%2C%20Japan&checkin=2026-08-10&checkout=2026-08-13&adults=2&rooms=1&currency=USD" \
  -H "x-rapidapi-key: $RAPIDAPI_KEY" \
  -H "x-rapidapi-host: booking-live-api.p.rapidapi.com" | jq '.'
参数
参数必填说明
location是城市/区域名称:Tokyo, Japan
checkin是格式为 YYYY-MM-DD
checkout是格式为 YYYY-MM-DD
adults否默认为 2
children否默认为 0
rooms否默认为 1
currency否默认为 USD
sortBy否price、rating、popularity
minPrice否最低价格筛选
maxPrice否最高价格筛选
starRating否以逗号分隔的 3,4,5
获取酒店详情
curl -s "https://booking-live-api.p.rapidapi.com/api/v1/getHotelDetails?hotelId=HOTEL_ID&checkin=2026-08-10&checkout=2026-08-13&adults=2" \
  -H "x-rapidapi-key: $RAPIDAPI_KEY" \
  -H "x-rapidapi-host: booking-live-api.p.rapidapi.com" | jq '.'

速率限制

免费套餐:所有 RapidAPI API 每月共 100 次请求。 请节省使用。航班优先使用 SerpAPI,酒店优先使用 LiteAPI/SerpAPI 作为主要来源。

适用场景

  • Google Flights Live:当 SerpAPI 结果似乎不准确,或搜索 SerpAPI 覆盖不佳的航线时,用作辅助价格参考。
  • Booking.com Live:需要查询 Booking.com 特有的价格/可订情况时使用(其库存与 Google Hotels 不同)。

请勿:

  • 将其用作主要搜索来源(主要来源是 SerpAPI 和 Seats.aero)。
  • 在宽泛搜索中耗尽免费额度。请进行有针对性的搜索。

评论

支持 Markdown