正在加载…
TriPrice · 实时机票比价
通过 API 接入 TriPrice 的比价能力,将实时价格数据集成到您的应用中
注册账号并订阅专业版或企业版,在控制台生成 API Key
在请求头中添加 Authorization: Bearer YOUR_API_KEY
使用 GET/POST 请求调用各个端点,获取比价数据
搜索并比较多个平台的酒店价格
| 参数名 | 类型 | 必需 | 说明 |
|---|---|---|---|
| city | string | 是 | 城市名称 |
| checkin_date | string | 是 | 入住日期 (YYYY-MM-DD) |
| checkout_date | string | 是 | 退房日期 (YYYY-MM-DD) |
| guests | integer | 否 | 入住人数,默认2 |
| platforms | string | 否 | 平台列表,逗号分隔 |
curl -X GET "https://api.triprice.net/api/v1/hotels/search?\ city=Shanghai&checkin_date=2026-04-01&\ checkout_date=2026-04-03&guests=2" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"status": "success",
"total_results": 42,
"results": [
{
"hotel_name": "Shanghai Grand Hyatt",
"star_rating": 5,
"prices": [
{ "platform": "booking", "price_cny": 1280 },
{ "platform": "ctrip", "price_cny": 1199 },
{ "platform": "agoda", "price_cny": 1350 }
],
"best_price": 1199,
"best_platform": "ctrip"
}
]
}| 方案 | 每秒请求 | 每日配额 | 每月配额 |
|---|---|---|---|
| 免费版 | 1 | 不支持 | 不支持 |
| 标准版 | 2 | 不支持 | 不支持 |
| 专业版 | 10 | 1,000 | 30,000 |
| 企业版 | 50 | 10,000 | 300,000 |
curl -X GET \ "https://api.triprice.net/api/v1/hotels/search?city=Tokyo&checkin_date=2026-04-01&checkout_date=2026-04-03" \ -H "Authorization: Bearer tp_live_your_api_key"
登录后可以在此创建和管理您的 API 密钥,查看使用统计