开发文档
99acres API 参考文档
99acres API 参考:搜索输入、价格档位与分页如何生效,以及搜索结果行和房源完整记录包含哪些字段。
另见: 99acres 房源数据 API 概览与价格 · 99acres API 指南:搜索、片区、预算与分页
本页内容
99acres API 搜索:地点、物业类型与居室数
post-99acres-search 需要一个搜索地点,可以用 body.city_id、body.locality_id、body.query 或它们的组合来指定:
- 在
body.city_id中,19 是浦那,12 是孟买,1 是德里首都区。 body.locality_id可以一次传入多个片区,用逗号分隔,例如浦那的 Baner 为 1074;任何返回行中的locality_id都可以再传回这个字段。body.query接受 mumbai、baner 这样的地名,并把它解析为城市、片区或项目;无法解析为地点的名称不会被接受。
body.property_type 接受以逗号分隔的类型 id。以下 id 都属于住宅类型,商业类型则使用另外的 id:
- 1 表示公寓
- 2 表示独立住宅与别墅
- 3 表示住宅用地
- 4 表示 builder floor 独层住宅
- 5 表示农舍
- 22 表示服务式公寓
- 90 表示开间公寓
body.bedrooms 的写法相同,填的是 1 到 9 的 BHK 居室数,例如 2,3 会返回两居和三居住宅,9+ 表示九居及以上。把 body.transaction 设为 rent 或 pg 后,价格输入和返回的价格都变成按月计算的金额。
本节涉及的字段(7)
post-99acres-search, body.city_id, body.locality_id, body.query, body.property_type, body.bedrooms, body.transaction
价格档位、面积与发布者筛选
body.price_min 与 body.price_max 是以卢比计的整数金额。价格按固定档位筛选:出售为 5 L、10 L 一直到 1 Cr 及以上,出租为 1K 到 10 L,因此每个边界都会被放宽到最近的档位。由此得到的区间比较宽松:价格在区间之外的行也会返回,这时该行的 outside_price_filter 为 true,客户端在需要严格控制预算时可以据此把它剔除。
面积、发布者、出售类型与发布时间的筛选方式如下:
- 面积的上下限以平方英尺为单位,分别由
body.area_min_sqft与body.area_max_sqft设定。 body.posted_by选择房源的发布方,其中 dealer 指中介。body.sale_type设为 new_booking 时保留由开发商出售的单元,设为 resale 时保留二手房。body.posted_since_days提供 1、3、7、15 或 30 天几种时间窗口,只保留在所选窗口内发布的房源,例如 7 表示最近一周。
本节涉及的字段(8)
post-99acres-search, body.price_min, body.price_max, body.area_min_sqft, body.area_max_sqft, body.posted_by, body.sale_type, body.posted_since_days
post-99acres-search 的分页与结果行类别
body.page 从 1 开始计数,body.limit 设定每页的行数:不传时为 25,最多不超过 50。第 1 页的推广行会在这个数量之外额外返回,因此第一页的行数会超出 limit;listing_kind 用来区分这些行:
featured表示推广位project_unit表示开发商新项目中的单元listing表示普通房源
没有任何输入能调整结果行的先后,所以按价格或日期排列结果是调用之后由客户端完成的工作。保持其他输入不变、逐次增大 body.page,就可以一页一页地读取结果。
本节涉及的字段(3)
post-99acres-search, body.page, body.limit
post-99acres-search 的结果行返回什么
每次搜索调用返回 listings,每条广告占一行。结果行的字段分为以下几组:
| 字段 | 内容 |
|---|---|
listing_id、spid、url、title | 标识这条广告 |
product_type、property_type、property_type_id、transaction、segment | 对这条广告分类 |
bedrooms、bathrooms、balconies、floor、total_floors、furnishing、sale_type、ownership、age | 房间与楼栋信息 |
price_inr、price_max_inr、price_is_range、price_display、price_on_request、price_period | 价格;当 price_is_range 表示区间时,上限在 price_max_inr 中 |
price_per_sqft_inr、price_per_unit_inr、price_per_unit_text、price_per_unit_label、price_per_unit_area_type | 按面积计的价格 |
area | 以平方英尺计的超级面积、超级建筑面积、建筑面积和套内面积,并附有展示面积及其单位 |
locality、locality_id、locality_text、city、city_id、society、building_id、project_id、lat、lng、location_precision | 位置 |
verified、poster_rera_registered、posted_at、updated_at、posted_label、tags、highlights、description、photo_url、photo_count、outside_price_filter | 结果行的其余字段 |
seller | 一个对象,包含 type、label、name、company、photo_url 和 rera_registered |
本节涉及的字段(1)
post-99acres-search
用 post-99acres-listing 打开单条房源
body.listing_id 接受搜索结果行中的 listing_id(一个字母加数字,例如 S94838160),也接受这条广告完整的 99acres 链接,该字段可以填写任意字符串。id 与 prop_id 也可以代替 body.listing_id。在返回的 listing 中:
area对象给出super_area及其自身的super_area_unit,因此与搜索结果行中以平方英尺计的面积比较之前,要先看清这个单位。plot_length与plot_breadth描述地块的尺寸。price_negotiable与price_all_inclusive说明价格能否议价、是否包含全部费用,brokerage给出佣金。amenities、highlights和images都是列表,image_count是图片数量。- 在
seller中,member_since说明刊登者从何时起成为 99acres 的会员,phone_masked是网站上显示的打码电话号码。
本节涉及的字段(2)
post-99acres-listing, body.listing_id
{
"body": {
"query": "baner",
"transaction": "buy",
"price_min": 5000000,
"price_max": 10000000,
"construction_status": "ready_to_move",
"posted_since_days": 7
}
}操作
公共网关操作统一使用 POST /api/v1/{project}/{action}。
使用 JSON 对象,按文档将参数放入 path、query、headers 和 body,省略未使用的位置。input.headers 是供操作使用的 JSON 数据,不是浏览器请求头。请勿在此填写凭证。按文档保留 body 的数组、标量或 null;省略与 null 含义不同。
房源详情
POST /api/v1/acres-99/post-99acres-listing
根据房源 id 或 99acres 房源链接,返回单条房源的详细记录。
输入字段
| 字段 | 类型 | 是否必填 | 允许的值 | 范围限制 |
|---|---|---|---|---|
body.listing_id | 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/acres-99/post-99acres-listing' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"listing_id":"S94838160"}}'响应字段
listinglisting_idspidurltitleheadingtransactionsegmentproperty_typebedroomsbathroomsbalconiesprice_inrprice_max_inrprice_displayprice_textprice_on_requestprice_periodprice_negotiableprice_all_inclusiveprice_per_unit_area_inrbrokerageareasuper_areasuper_area_unitbuilt_up_areacarpet_areaarea_textplot_lengthplot_breadth
floortotal_floorsfacingoverlookingfurnishingownershipavailabilityagesale_typegated_communitycorner_propertyamenities[]highlights[]descriptionlocalitycityaddresslatlngverifiedrera_typereraposted_onupdated_onexpires_onimages[]image_countsellertypenamecompanymember_sinceaddressphone_masked
房源搜索
POST /api/v1/acres-99/post-99acres-search
在某个城市、若干片区内或按地名搜索 99acres 房源,可按交易类型、居室数、价格、面积与发布者筛选。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.area_max_sqft | integer | 可选 | — | — | 0–9007199254740991 |
body.area_min_sqft | integer | 可选 | — | — | 0–9007199254740991 |
body.bedrooms | string | 可选 | — | — | — |
body.city_id | integer | 可选 | — | — | 1–9007199254740991 |
body.construction_status | string | 可选 | — | "ready_to_move""under_construction""new_launch" | — |
body.furnishing | string | 可选 | — | "furnished""semifurnished""unfurnished" | — |
body.limit | integer | 可选 | 25 | — | 1–50 |
body.locality_id | string | 可选 | — | — | — |
body.page | integer | 可选 | 1 | — | 1–9007199254740991 |
body.posted_by | string | 可选 | — | "owner""dealer""builder" | — |
body.posted_since_days | number | 可选 | — | 1371530 | — |
body.price_max | integer | 可选 | — | — | 0–9007199254740991 |
body.price_min | integer | 可选 | — | — | 0–9007199254740991 |
body.property_type | string | 可选 | — | — | — |
body.query | string | 可选 | — | — | — |
body.sale_type | string | 可选 | — | "resale""new_booking" | — |
body.segment | string | 可选 | "residential" | "residential""commercial" | — |
body.transaction | string | 可选 | "buy" | "buy""rent""pg" | — |
body.verified | boolean | 可选 | — | — | — |
请求示例
# 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/acres-99/post-99acres-search' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"bedrooms":"2","city_id":19,"posted_by":"owner","transaction":"buy"}}'调用方式
- 使用
POST /api/v1/acres-99/<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 小时内返回已保存的响应,不会再次扣费。
网关调用参考: