Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

About

Booking API examples in Python and curl: search hotels and stays by destination and read a property's details, guest reviews, and room prices. No Booking account or cookie needed. Works as an MCP tool.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Booking API

English · 中文

English

This repo reads public Booking data with Python or curl. You can search hotels and stays by destination and read a property's details, guest reviews, and room prices. You need one EveryInfra API key. You do not need a Booking account or cookie. The same API also works as an MCP tool in Claude and Cursor. Billing is per call: these 4 capabilities cost $1.39 per 1,000 calls (about $0.0014 per call). Failed calls and empty results are not charged. The EveryInfra Booking API has 4 capabilities, all listed on the platform page: https://everyinfra.com/en/booking-api?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

Quick start

git clone https://github.com/everyinfra/booking-api.git
cd booking-api
pip install -r requirements.txt
export EVERYINFRA_API_KEY=<your API key>
python main.py search Tokyo --out hotels.csv
python main.py hotel "<hotel url>" --out hotel.json
python main.py reviews "<hotel url>" --out reviews.csv
python main.py prices "<hotel url>" --out prices.csv

curl

curl -X POST https://api.everyinfra.com/api/v1/social \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"platform":"booking","action":"search","params":{"keyword":"Tokyo"}}'

All capabilities use the same URL. Change action and params to call another one. Examples for profile, reviews, and prices are in examples/curl.sh.

Claude and Cursor (MCP)

The remote MCP URL is https://api.everyinfra.com/mcp. Add the Authorization: Bearer header with your API key. EveryInfra runs the server, so you install no local program.

Claude Code:

claude mcp add --transport http everyinfra https://api.everyinfra.com/mcp --header "Authorization: Bearer <API Key>"

Cursor and other clients that read mcp.json (examples/mcp.json):

{
  "mcpServers": {
    "everyinfra": {
      "url": "https://api.everyinfra.com/mcp",
      "headers": {
        "Authorization": "Bearer <API Key>"
      }
    }
  }
}

Custom connectors in Claude on the web and desktop, and ChatGPT, accept only a URL. Enter https://api.everyinfra.com/mcp/all, sign in to EveryInfra when asked, and allow access. You do not need to enter a key. Full steps: https://everyinfra.com/en/mcp-server?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

Price

action Per 1,000 calls
search $1.39
profile $1.39
reviews $1.39
prices $1.39

Fields

These are the fields that the 4 capabilities returned in our test. Each meaning is the first sentence of the field's entry in the API documentation. The link under each table has the full text.

search (keyword search)

Field Meaning
id The record's unique ID on the platform.
name Name of the object itself, for account, product and business capabilities.
type Record type; values depend on the capability (for example video / image / text).
url Link to the record on the platform.
text Body text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so).
stars Hotel star class (1–5), an official rating of the property's facilities. It is not the same thing as the guest rating in rating.
address Full address, passed through as is.
city City name in the platform's language, not normalized.
country Country or region: a full name or an ISO code depending on the platform, not normalized.
latitude Latitude.
longitude Longitude.
image_url Image link.
platform Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok).
category_ratings Category scores, each with a name (such as cleanliness or location) and a score; absent when there are none.
image_urls Array of image links in the platform's display order; absent when there are no images.
facilities Facility and service names, in the order of the page's groups; absent when there are none.
breakfast Breakfast note (included, not included or extra).

All parameters and fields: https://everyinfra.com/en/booking-api/search?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

profile (profile or object details)

Field Meaning
id The record's unique ID on the platform.
name Name of the object itself, for account, product and business capabilities.
type Record type; values depend on the capability (for example video / image / text).
url Link to the record on the platform.
text Body text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so).
stars Hotel star class (1–5), an official rating of the property's facilities. It is not the same thing as the guest rating in rating.
address Full address, passed through as is.
city City name in the platform's language, not normalized.
country Country or region: a full name or an ISO code depending on the platform, not normalized.
latitude Latitude.
longitude Longitude.
image_url Image link.
platform Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok).
category_ratings Category scores, each with a name (such as cleanliness or location) and a score; absent when there are none.
image_urls Array of image links in the platform's display order; absent when there are no images.
facilities Facility and service names, in the order of the page's groups; absent when there are none.

All parameters and fields: https://everyinfra.com/en/booking-api/profile?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

reviews (reviews)

Field Meaning
id The record's unique ID on the platform.
rating Rating. The scale varies by platform: rating_scale on the same row gives the maximum (usually 5; Booking, Douban, iQIYI and NAVER use 10).
posted_at Publish time in ISO 8601, UTC (for example 2026-08-07T12:34:56+00:00).
stay_date The month the reviewer stayed, useful for judging how recent the review is.
author_name Author's display name.
room_name Room type name.
platform Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok).
rating_scale Maximum of rating in the same row: 5 for five-star scales, 10 for ten-point scales.
title Title. null when the platform has no titles (for example text-only posts).
text_positive The positive part of the review: Booking asks reviewers to fill in what they liked and disliked separately.
owner_response The business's public reply to this review: text, author_name and posted_at; absent when there is no reply.
text_negative The negative part of the review.

All parameters and fields: https://everyinfra.com/en/booking-api/reviews?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

prices (prices)

Field Meaning
url Link to the record on the platform.
hotel_name Hotel name.
check_in Check-in date this price row is for, YYYY-MM-DD (prices).
check_out Check-out date this price row is for, YYYY-MM-DD (prices).
currency Currency code of the price (for example CNY, USD).
is_sold_out Whether this room type is sold out.
availability_status Room availability status (available, few left, sold out).
rate_options_count Number of rate options available for this room type.
platform Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok).
id The record's unique ID on the platform.
room_name Room type name.
bed_type Bed type description.
max_guests Maximum number of guests for this room type.
room_size_sqm Room area, in square meters.
price Price as a number without a currency symbol; see currency.
taxes_included Whether the quoted price already includes taxes and fees.
rooms_left Number of rooms left.
meal_plan Meal plan (breakfast included, half board, full board and so on).
is_refundable Whether it can be cancelled for free.

All parameters and fields: https://everyinfra.com/en/booking-api/prices?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

FAQ

Do I need a Booking account or cookie to call the API?

No. Send the Authorization: Bearer header with your API key. The request body holds platform, action, and the capability parameters. You do not scan a QR code, keep a login session, or open a browser.

How much does it cost? Are failed calls charged? Is there a free allowance?

Billing is per call, from $1.39 per 1,000 calls. Failed calls, empty results, parameter errors, and authentication failures are not charged. A new account gets a $1 trial allowance, valid for 24 hours. No credit card is needed. How to claim it: https://everyinfra.com/en/pricing?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

Can I connect the Booking API to Claude or Cursor?

Yes. The remote MCP URL is https://api.everyinfra.com/mcp. Add the Authorization: Bearer header with your API key. You install no local program. Setup for Claude, Cursor, ChatGPT, and Claude Code: https://everyinfra.com/en/mcp-server?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api.

What legal points apply when I use Booking data?

The EveryInfra Terms of Service require you to make sure your use of the data follows applicable law and the terms of the relevant platform. Do not use the data for anything illegal or anything that violates privacy or intellectual property rights. Do not use bulk scraping for harassment, fraud, or other abuse. When you use personal information such as nicknames and avatars, keep only the fields your business needs.

Which Booking data can I get?

The EveryInfra Booking API has 4 capabilities:

  • keyword search
  • profile or object details
  • reviews
  • prices

Parameters and return fields for each capability are on the platform page: https://everyinfra.com/en/booking-api?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

Tested

Before release, we ran the 4 commands in Quick start against the live API with this repo's code.

Command Time (Singapore, UTC+8) Rows Charged
python main.py search Tokyo --out hotels.csv 2026-11-29 18:56 10 $0.001389
python main.py hotel "<hotel url>" --out hotel.json 2026-11-29 18:57 1 $0.001389
python main.py reviews "<hotel url>" --out reviews.csv 2026-11-29 18:58 20 $0.001389
python main.py prices "<hotel url>" --out prices.csv 2026-11-29 18:59 8 $0.001389

中文

本仓库用 Python 或 curl 读 Booking 公开数据:按目的地搜酒店和住宿,读住宿资料、住客点评和房型价格。只需一把 EveryInfra API Key,不用 Booking 账号和 Cookie,也能作为 MCP 工具接进 Claude、Cursor。按调用次数计费,这 4 个能力每千次 $1.39(每次约 $0.0014),失败和空结果不收费。Booking 共 4 个能力:https://everyinfra.com/booking-api?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

快速开始

git clone https://github.com/everyinfra/booking-api.git
cd booking-api
pip install -r requirements.txt
export EVERYINFRA_API_KEY=<你的 API Key>
python main.py search Tokyo --out hotels.csv
python main.py hotel "<酒店链接>" --out hotel.json
python main.py reviews "<酒店链接>" --out reviews.csv
python main.py prices "<酒店链接>" --out prices.csv

用 curl 调

curl -X POST https://api.everyinfra.com/api/v1/social \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"platform":"booking","action":"search","params":{"keyword":"Tokyo"}}'

所有能力都发到同一个地址,换 action 和 params 就行;profile、reviews、prices 的写法见 examples/curl.sh。

接进 Claude、Cursor(MCP)

远程 MCP 地址是 https://api.everyinfra.com/mcp,请求头加 Authorization: Bearer 和 API Key;服务器由 EveryInfra 运行,不用装本地程序。

Claude Code:

claude mcp add --transport http everyinfra https://api.everyinfra.com/mcp --header "Authorization: Bearer <API Key>"

Cursor 等读 mcp.json 的客户端(examples/mcp.json):

{
  "mcpServers": {
    "everyinfra": {
      "url": "https://api.everyinfra.com/mcp",
      "headers": {
        "Authorization": "Bearer <API Key>"
      }
    }
  }
}

Claude 网页版和桌面版的自定义连接器、ChatGPT 只能填网址:填 https://api.everyinfra.com/mcp/all,连接时登录 EveryInfra 并允许,不用填 Key。完整步骤见 https://everyinfra.com/mcp-server?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

价格

能力 action 每千次
关键词搜索 search $1.39
主页或对象详情 profile $1.39
评价 reviews $1.39
价格与房型 prices $1.39

返回字段

下面是这 4 个能力实测返回的字段,含义取自接口文档每条说明的第一句,完整说明在每张表下面的链接里。

search(关键词搜索)

字段 含义
id 该记录在原平台上的唯一标识。
name 名称。
type 记录类型,取值随能力而定(如 video / image / text)。
url 该记录在原平台上的可访问链接。
text 正文内容,已去除 HTML 标签,全文返回、不截断(个别平台的列表结果本身只有摘要,以该平台的字段说明为准)。
stars 酒店星级(1–5),是官方评定的硬件等级,与住客评分 rating 不是一回事。
address 详细地址,原文透传。
city 城市名,用原平台的语言书写,未做中英归一。
country 国家或地区。
latitude 纬度。
longitude 经度。
image_url 图片链接。
platform 数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。
category_ratings 分项评分列表,每项含名称(name,如清洁度、位置)和分数(score);没有时不出现这个字段。
image_urls 图片链接数组,按平台展示顺序;没有图片时不出现这个字段。
facilities 设施与服务名称列表,按页面分组顺序展开;没有时不出现这个字段。
breakfast 早餐说明(含/不含/需加购)。

完整参数和字段:https://everyinfra.com/booking-api/search?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

profile(主页或对象详情)

字段 含义
id 该记录在原平台上的唯一标识。
name 名称。
type 记录类型,取值随能力而定(如 video / image / text)。
url 该记录在原平台上的可访问链接。
text 正文内容,已去除 HTML 标签,全文返回、不截断(个别平台的列表结果本身只有摘要,以该平台的字段说明为准)。
stars 酒店星级(1–5),是官方评定的硬件等级,与住客评分 rating 不是一回事。
address 详细地址,原文透传。
city 城市名,用原平台的语言书写,未做中英归一。
country 国家或地区。
latitude 纬度。
longitude 经度。
image_url 图片链接。
platform 数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。
category_ratings 分项评分列表,每项含名称(name,如清洁度、位置)和分数(score);没有时不出现这个字段。
image_urls 图片链接数组,按平台展示顺序;没有图片时不出现这个字段。
facilities 设施与服务名称列表,按页面分组顺序展开;没有时不出现这个字段。

完整参数和字段:https://everyinfra.com/booking-api/profile?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

reviews(评价)

字段 含义
id 该记录在原平台上的唯一标识。
rating 评分。
posted_at 发布时间,ISO 8601 格式、UTC 时区(如 2026-08-07T12:34:56+00:00)。
stay_date 点评人实际入住的月份,用于判断评价的新鲜度。
author_name 作者昵称(显示名)。
room_name 房型名称。
platform 数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。
rating_scale 上一列 rating 的满分。
title 标题。
text_positive 点评里的正面部分,Booking 把好评差评拆成两栏填写。
owner_response 酒店对该条点评的回复。
text_negative 点评里的负面部分。

完整参数和字段:https://everyinfra.com/booking-api/reviews?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

prices(价格与房型)

字段 含义
url 该记录在原平台上的可访问链接。
hotel_name 酒店名称。
check_in 这一行价格对应的入住日期,格式 YYYY-MM-DD(prices)。
check_out 这一行价格对应的退房日期,格式 YYYY-MM-DD(prices)。
currency 价格币种代码(如 CNY、USD)。
is_sold_out 该房型是否已售罄。
availability_status 房态(可订/剩余紧张/售罄)。
rate_options_count 该房型下可选的价格方案数量。
platform 数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。
id 该记录在原平台上的唯一标识。
room_name 房型名称。
bed_type 床型描述。
max_guests 该房型最多入住人数。
room_size_sqm 房间面积,平方米。
price 价格数值,不含货币符号;币种见 currency。
taxes_included 报价是否已含税费。
rooms_left 剩余房间数。
meal_plan 餐食方案(含早/半食宿/全食宿等)。
is_refundable 是否可免费取消。

完整参数和字段:https://everyinfra.com/booking-api/prices?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

常见问题

调用时要不要提供 Booking 账号或 Cookie?

不用,请求头带 Authorization: Bearer 和 API Key 就能调,请求体写 platform、action 和能力参数。不用扫码、维护登录状态,也不用开浏览器。

怎么收费?失败了收不收钱?有免费额度吗?

按调用次数计费,每千次 $1.39 起。失败、空结果、参数错误和鉴权失败都不收费。新账号有 $1 试用额度,24 小时内有效,不用信用卡,领取方式见定价页 https://everyinfra.com/pricing?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

能把 Booking 接口接进 Claude、Cursor 吗?

能,远程 MCP 地址是 https://api.everyinfra.com/mcp,请求头加 Authorization: Bearer 和 API Key,不用装本地程序。Claude、Cursor、ChatGPT、Claude Code 配置见 https://everyinfra.com/mcp-server?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api。

用 Booking 数据要注意哪些合规问题?

EveryInfra 服务条款要求你自行确保数据用法符合适用法律和相关平台条款,禁止用于违法、侵犯隐私或知识产权,或批量抓取用于骚扰、欺诈等恶意用途。用到昵称、头像等个人信息时,只留业务用得上的字段。

可以拿到 Booking 的哪些数据?

Booking 有 4 个能力:关键词搜索、主页或对象详情、评价、价格与房型。每个能力的参数和返回字段见平台页 https://everyinfra.com/booking-api?utm_source=github&utm_medium=example_repo&utm_campaign=booking-api

实测记录

发布前用本仓的代码对线上接口跑过一遍,命令就是「快速开始」里的 4 条。

命令 时间(新加坡时间) 返回条数 扣费
python main.py search Tokyo --out hotels.csv 2026-11-29 18:56 10 $0.001389
python main.py hotel "<酒店链接>" --out hotel.json 2026-11-29 18:57 1 $0.001389
python main.py reviews "<酒店链接>" --out reviews.csv 2026-11-29 18:58 20 $0.001389
python main.py prices "<酒店链接>" --out prices.csv 2026-11-29 18:59 8 $0.001389

profile 返回的一条(正文截到 60 字,作者字段没放进来):

{
  "id": 2708004,
  "type": "guest_house",
  "text": "About this propertyComfortable Accommodations: HISAYO'S INN …"
}

Company

EveryInfra LLC · 30 N Gould St, Ste N, Sheridan, WY 82801, USA · +1 (307) 418-3419 · everyinfra.com

License

MIT

About

Booking API examples in Python and curl: search hotels and stays by destination and read a property's details, guest reviews, and room prices. No Booking account or cookie needed. Works as an MCP tool.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages