You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用Python调用BridgeDataOutput.com API获取Zillow特定房产可比数据

通过BridgeDataOutput API获取Zillow房产可比数据的Python实现

一、BridgeDataOutput可比数据接口说明

BridgeDataOutput的可比房产数据通过其Property API的专属端点提供,需先明确两个核心信息:

  • 基础URL:根据你接入的MLS区域,使用对应API域名(如https://api.bridgedataoutput.com搭配区域前缀)
  • 认证方式:将API密钥放在请求头的Authorization字段(格式为Bearer YOUR_API_KEY),或作为查询参数api_key传递

二、Python代码实现

使用requests库完成请求,示例如下:

import requests

def get_property_comps(api_key, bridge_property_id, base_url="https://api.bridgedataoutput.com/api/v2/property"):
    # 构建可比数据请求地址
    comps_endpoint = f"{base_url}/comps"
    request_params = {
        "propertyId": bridge_property_id,
        "limit": 10,  # 可按需调整返回的可比房产数量
    }
    # 安全认证:优先用请求头传递密钥
    request_headers = {
        "Authorization": f"Bearer {api_key}"
    }

    try:
        response = requests.get(comps_endpoint, headers=request_headers, params=request_params)
        response.raise_for_status()  # 触发HTTP错误抛出
        comps_data = response.json()
        # 提取核心可比房产数据返回
        return comps_data.get("data", [])
    except requests.exceptions.RequestException as e:
        print(f"请求出错: {str(e)}")
        return None

# 调用示例
if __name__ == "__main__":
    API_KEY = "你的BridgeDataOutput API密钥"
    TARGET_PROPERTY_ID = "目标房产的Bridge系统ID"  # 注意:必须是Bridge平台内的房产ID,不能直接用Zillow原ID
    
    comparables = get_property_comps(API_KEY, TARGET_PROPERTY_ID)
    if comparables:
        print("获取到的可比房产信息:")
        for index, comp in enumerate(comparables):
            print(f"\n--- 第{index+1}套可比房产 ---")
            print(f"地址: {comp.get('address', {}).get('full', '未知')}")
            print(f"挂牌价: ${comp.get('price', '未知')}")
            print(f"卧室数: {comp.get('bedrooms', '未知')}")
            print(f"浴室数: {comp.get('bathrooms', '未知')}")

三、关键注意事项

  • 房产ID转换:不能直接使用Zillow原生房产ID,需先通过BridgeDataOutput的地址搜索或MLS ID查询接口,将目标房产信息转换为Bridge系统内的propertyId
  • 权限确认:确保你的API密钥已开通可比数据访问权限,部分密钥默认无此权限,需联系BridgeDataOutput客服开通
  • 端点适配:不同MLS区域的API端点可能存在差异,若上述端点返回404,需查阅对应区域的Bridge API文档确认正确路径

四、关于你提供的Node.js代码的问题

你之前使用的Zillow WebService API(依赖zws-id)已完全废弃,Zillow不再维护该服务,因此无论如何调用都会失败,必须切换到BridgeDataOutput这类官方授权的数据接口。

内容的提问来源于stack exchange,提问作者mev

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 22:19:56