开发文档
Bien'ici API 技术参考
Bien'ici API 参考:说明广告编号、搜索筛选、翻页与关键词令牌如何工作,以及房源和搜索结果各字段的含义。
另见: Bien'ici 房源接口概览与价格 · Bien'ici API 指南:搜索、跟踪与比较房源
本页内容
Bien'ici API 读取单条房源及其选项
bienici-listing 读取一条广告,body.ad_id 通过广告编号或完整链接来指明这条广告。url 与 id 被接受为 body.ad_id 的替代名称。
body.include_pii 控制房源是否附带联系信息,开启后会加入联系人的姓名与电话,另有一位独立经纪人的姓名。body.max_rotations 设定操作放弃之前尝试的次数,无效取值会被忽略,改用默认值。
本节涉及的字段(4)
bienici-listing, body.ad_id, body.include_pii, body.max_rotations
房源记录:标识、价格、地点与卖家
data 包含一个 listing,其顶层字段分为以下几组:
- 标识:
ad_id、reference、title、url与status标识这条广告及其状态 - 日期:
published_at与updated_at给出发布日期和更新日期 - 价格:
price与currency,并由price_is_from、price_max、price_not_published和price_has_decreased描述价格 - 地点:
location包含city、zipcode、district、department_id、country、latitude、longitude、coordinates_precision与coordinates_radius_m - 卖家:
seller包含type、account_type、name、siren与has_phone - 媒体:
thumbnail、image_count与images承载照片,description承载正文
本节涉及的字段(1)
bienici-listing
房源内的房产字段
property 描述房屋本身:
- 种类:
property_type、transaction与is_new_build说明房屋种类、交易类型以及是否为新建房屋,available_from给出可入住的日期 - 大小:
surface_m2与surface_max_m2给出居住面积,land_surface_m2给出土地面积,rooms、bedrooms、bathrooms、shower_rooms与toilets是各类房间的数量 - 楼栋:
floor、floors_in_building、elevator、building_year、heating_type与orientation - 附属:
balcony、terrace、garden、pool、cellar、parking_spaces与furnished显示配套设施,features列出其他特征 - 能耗:
energy_class与ghg_class,以及energy_consumption_kwh_m2、ghg_emissions_kg_m2、annual_energy_cost_min和annual_energy_cost_max - 费用:
price_per_m2、rent_excluding_charges、monthly_charges、charges_included、security_deposit、rental_fees、agency_fees_paid_by、agency_fees_pct、price_excluding_fees与annual_condo_charges - 规则:
rent_control给出租金管制的详情,virtual_tour_url链接到虚拟看房
本节涉及的字段(1)
bienici-listing
搜索输入及其组合方式
bienici-search 一次读取一种交易。body.zipcode 接受 5 位法国邮编,可单独发送,也可与 body.city 中的城市名一起发送;body.property_type 可同时接受多个值,所以一次搜索可以把公寓和独栋房屋混在一起,省略它则搜索所有类型。
body.query 是必须全部出现在标题或描述中的关键词,重音与大小写会被忽略。操作通过扫描结果来查找这些关键词,因此关键词搜索的 total 为 null,扫描也要靠令牌继续。
body.price_min 与 body.price_max 以欧元计,对租房则限定月租金,杂费计入其中。body.rooms_min 与 body.rooms_max 按房间数(pièces)计,body.bedrooms_min 只计卧室,所以一次搜索可以同时设定房间数范围和卧室数下限。body.surface_min 与 body.surface_max 以平方米限定居住面积;body.new_build 为 true 时只保留新建房屋,为 false 时只保留现房。
本节涉及的字段(13)
bienici-search, body.city, body.zipcode, body.property_type, body.query, body.price_min, body.price_max, body.surface_min, body.surface_max, body.rooms_min, body.rooms_max, body.bedrooms_min, body.new_build
翻页窗口、排序与继续令牌
一次搜索中排在前 2,500 条之后的结果无法取得。body.page 在这个窗口内选出页码,body.limit 设定每页行数,最多 100 行。
关键词搜索,以及包含多个邮编的城市中的邮编搜索,通过令牌继续:上一页的 next_page_token 放入下次调用的 body.page_token,以恢复同一次扫描。price_asc 与 surface_asc 把最小的数值排在前面,price_desc 与 surface_desc 把最大的排在前面。
本节涉及的字段(5)
bienici-search, body.page, body.limit, body.page_token, body.sort
搜索结果的字段
listings 的每一行对应一条房源,每行的字段与单条房源相同。行的周围还有这些字段:
count:本页包含多少行total:有多少结果匹配page与limit:读取的页码和每页大小has_more:之后是否还有结果next_page_token:放入body.page_token的继续令牌sort_applied:所用的排序location_applied:搜索所解析到的地点,含name、type与postal_codestext_match:关键词匹配情况,含mode、scanned与matched
本节涉及的字段(1)
bienici-search
操作
公共网关操作统一使用 POST /api/v1/{project}/{action}。
使用 JSON 对象,按文档将参数放入 path、query、headers 和 body,省略未使用的位置。input.headers 是供操作使用的 JSON 数据,不是浏览器请求头。请勿在此填写凭证。按文档保留 body 的数组、标量或 null;省略与 null 含义不同。
房源详情
POST /api/v1/bienici/bienici-listing
读取单条房源,含照片、价格、能耗等级和中介信息。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.ad_id | string | 必填 | — | — | — |
body.include_pii | boolean | 可选 | false | — | — |
body.max_rotations | integer | 可选 | 3 | — | 1–5 |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/bienici/bienici-listing' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"ad_id":"ag691943-549827780"}}'房源搜索
POST /api/v1/bienici/bienici-search
按地点、价格、面积、房间数和房产类型搜索待售或出租房源。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.transaction | string | 必填 | — | "sale""rent" | — |
body.bedrooms_min | integer | 可选 | — | — | 1–20 |
body.city | string | 可选 | — | — | — |
body.include_pii | boolean | 可选 | false | — | — |
body.limit | integer | 可选 | 24 | — | 1–100 |
body.max_rotations | integer | 可选 | 3 | — | 1–5 |
body.new_build | boolean | 可选 | — | — | — |
body.page | integer | 可选 | 1 | — | 1–2500 |
body.page_token | string | 可选 | — | — | — |
body.price_max | number | 可选 | — | — | ≥ 0 |
body.price_min | number | 可选 | — | — | ≥ 0 |
body.property_type | string[] | 可选 | — | 12 个值"apartment""house""land""parking""building""office""commercial""loft""townhouse""castle""new_build_programme""other" | — |
body.query | string | 可选 | — | — | — |
body.rooms_max | integer | 可选 | — | — | 1–20 |
body.rooms_min | integer | 可选 | — | — | 1–20 |
body.sort | string | 可选 | "relevance" | "relevance""newest""price_asc""price_desc""surface_asc""surface_desc" | — |
body.surface_max | number | 可选 | — | — | ≥ 0 |
body.surface_min | number | 可选 | — | — | ≥ 0 |
body.zipcode | string | 可选 | — | — | — |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/bienici/bienici-search' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"city":"Lyon","transaction":"sale"}}'调用方式
- 使用
POST /api/v1/bienici/<action>,并携带x-api-key、Content-Type: application/json和必需的Idempotency-Key。 - 调用成功时返回
ok: true:data是操作的结果,meta.requestId标识已记录的请求,meta.chargedCreditUnits是实际扣费金额。否则ok为false,error.code说明原因;请读取ok和error.code,不要只依赖 HTTP 状态码。每个网关响应都带有供支持使用的请求 ID:meta.requestId;没有meta的响应(如受理前被拒绝)则为顶层requestId。 - 只有调用成功才按标价扣费。失败不扣费;结果无法确认时,最多 900 秒后释放,不扣费。
- 请求完成后,以同一个 Idempotency-Key 重复发送相同请求,24 小时内返回已保存的响应,不会再次扣费。
网关调用参考: