列出 Idealista 可细分地区下的子地区,并附各区域房源总数

查看 Idealista 房源数据接口:西班牙、葡萄牙与意大利房产搜索 的全部接口 →

返回某个 Idealista 父级地区的下级地区,例如省份下的区县或市镇,方便你从大范围地点逐级下钻到更细的区域。请求时传入国家代码(location:es、pt 或 it)、父级地区 locationId(必须是标记为 divisible=true 的地区,例如 0-EU-ES-28),以及 operation 和 propertyType 筛选条件,它们决定每个子地区总数统计哪些房源。bedrooms 房源类型只能与租赁(rent)操作搭配使用。在已记录的探测请求中(location=es、locationId=0-EU-ES-28、operation=sale、propertyType=homes),接口返回 HTTP 200 和一个 JSON 对象,包含 locations 数组与整数 total;每个 locations 条目带有 name、locationId、divisible、type、suggestedLocationId、subTypeText 以及整数 total。该接口只返回地点和数量,不返回具体房源。

API 功能

可细分地区逐级下钻 传入任何标记为 divisible=true 的 locationId 即可获得其下级区域;每个子区域都带有自己的 locationId,可以一层一层沿着层级向下走。
随筛选条件变化的区域总数 operation 与 propertyType 会改变每个返回区域的 total,所以数量只反映你指定的买卖或租赁,以及你选择的房源类型。
覆盖西班牙、葡萄牙和意大利的地区层级 location 参数决定使用 es、pt 还是 it 的地区树,三个国家的响应都保持 locations 加 total 的同一结构。
标识与名称同条返回 每个区域都带有 name、locationId、type、subTypeText、divisible 标志和 suggestedLocationId,足够直接渲染选择器,并在不额外查询的情况下接着发起下一次调用。
支持逗号分隔的多值筛选 文档中的默认值同时包含 sale,rent 与全部九种房源类型(从 homes 到 buildings),一次调用即可统计全部,也可以收窄到单一类型。

在线 API 演示

GET /api/project/idealista/get-sublocations

调用成本暂不可用,未假定任何价格。

查看价格

API 响应 (JSON)

{}
curl -X GET 'https://api.opendata-api.com/api/project/idealista/get-sublocations?key=<API_KEY>&location=es&locationId=<locationId>&operation=sale%2Crent&propertyType=homes%2CnewDevelopments%2Cbedrooms%2Coffices%2Cpremises%2Cgarages%2Clands%2CstorageRooms%2Cbuildings'
📢
需要帮助?
如遇接口异常,或需要其他接口需求,可联系我们
联系我们

使用场景

常见问题

这个接口可以传哪些 locationId?

只有标记为 divisible=true 的地区才能展开,文档示例是 0-EU-ES-28。ID 可以来自地名联想查询,或者来自此前子地区响应中 divisible 字段为 true 的 locationId。

operation 和 propertyType 会改变响应中的什么内容?

它们会改变每个返回区域的 total 字段,使其只统计符合该交易类型和房源类型的房源。默认值是 sale,rent,以及 homes、newDevelopments、bedrooms、offices、premises、garages、lands、storageRooms、buildings 九种类型。bedrooms 类型只能与 rent 搭配。

成功的响应是什么样子?

在已记录的探测中,接口返回 HTTP 200 和一个 JSON 对象,包含 locations 数组与整数 total。每个 locations 条目带有 name、locationId、divisible、type、suggestedLocationId、subTypeText 和 total。

支持哪些国家?

location 参数接受 es、pt 或 it。请使用对应的国家代码,并搭配同一国家的 locationId。

这个接口会返回房源本身吗?

不会。它返回带房源数量的下级地区。要获取具体房源,请用你选定的 locationId 调用本 API 的房源搜索接口。

如何继续往下多钻几层?

用任一 divisible 值为 true 的返回区域的 locationId 再次调用本接口。不可细分的区域无法继续展开。

相关接口

相关指南

查看订阅方案 →