Beike APIs - Resale Housing Details (V1)
Retrieves comprehensive information for a specific second-hand property listing on Beike (Lianjia).
The data includes:
- Pricing (total and unit price).
- Physical attributes (area, layout, floor, orientation).
- Listing metadata (tags, listing date).
- Agent contact information.
Typical use cases:
- Displaying a full property profile to users.
- Detailed price comparison between specific listings.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | query | string | Yes | User authentication token. |
cityId | query | string | Yes | The ID of the city (e.g., '110000' for Beijing). |
houseCode | query | string | Yes | The unique identifier for the property listing. |
Code Samples
💡 Environment Note
Default samples use https://api.justoneapi.com (prod-global). For users in Mainland China, it is recommended to replace it with http://47.117.133.51:30015 (prod-cn) for better performance. See Environment Guide.
bash
# Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
curl -X GET "https://api.justoneapi.com/api/beike/ershoufang/detail/v1?token=YOUR_API_KEY&cityId=VALUE&houseCode=VALUE"text
I want to use the "Resale Housing Details (V1)" API from Just One API.
API Endpoint: https://api.justoneapi.com/api/beike/ershoufang/detail/v1
HTTP Method: GET
Authentication: Append "?token=YOUR_API_KEY" to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/beike-apis/resale-housing-details-v1-en.json
Parameters:
- token (query): User authentication token. (Required)
- cityId (query): The ID of the city (e.g., '110000' for Beijing). (Required)
- houseCode (query): The unique identifier for the property listing. (Required)
Return format: JSON
Response Handling & Error Codes:
1. Business results should be determined by the "code" field in the response body (code 0 means success).
2. Timeout Recommendation: Set request timeout to at least 60 seconds.
3. Business Code Reference:
- 0: Success
- 100: Invalid or Inactive Token
- 301: Collection Failed. Please Retry.
- 302: Rate Limit Exceeded
- 303: Daily Quota Exceeded
- 400: Invalid Parameters
- 500: Internal Server Error
- 600: Permission Denied
- 601: Insufficient Balance
Please help me write a script in my preferred programming language to call this API and handle the response.python
# Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
import requests
url = "https://api.justoneapi.com/api/beike/ershoufang/detail/v1?token=YOUR_API_KEY&cityId=VALUE&houseCode=VALUE"
response = requests.get(url)
print(response.json())js
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
const response = await fetch("https://api.justoneapi.com/api/beike/ershoufang/detail/v1?token=YOUR_API_KEY&cityId=VALUE&houseCode=VALUE", {
method: "GET"
});
const data = await response.json();
console.log(data);java
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.justoneapi.com/api/beike/ershoufang/detail/v1?token=YOUR_API_KEY&cityId=VALUE&houseCode=VALUE"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}go
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
client := &http.Client{}
url := "https://api.justoneapi.com/api/beike/ershoufang/detail/v1?token=YOUR_API_KEY&cityId=VALUE&houseCode=VALUE"
req, _ := http.NewRequest("GET", url, nil)
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}php
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.justoneapi.com/api/beike/ershoufang/detail/v1?token=YOUR_API_KEY&cityId=VALUE&houseCode=VALUE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
curl_close($ch);
echo $response;Responses
json
{
"code": 0,
"data": {
"miniProgram": {
"accessKey": "gh_2dbd87cb164c",
"path": "subpackages/ershoufang/pages/esfDetail/esfDetail?cityId=110000&houseCode=101127449675&share_user_id=0&share_device_union_id=&share_user_type=2&share_time=1773065058267&source=share_beikeapp&from=shell&share=true&share_entity_union_id=9bc3e7520cbecc195593a75de78a9ba4&share_id=33f06867fb5e7bdb3ccd8b6de115f13d"
},
"isVr": false,
"verificationInfo": {
"title": "房源维护人",
"agentUcid": "1000000010081720",
"agentName": "张忠良",
"digV": "{\"u\":1000000010081720,\"v\":\"V1\",\"s\":\"NATURAL\",\"adId\":100011429,\"flow\":\"natural\",\"b\":\"HouseHolderAgentBuilder\",\"p\":\"\",\"g\":\"\",\"sid\":\"1000000010081720_1111027379646\",\"rid\":\"8124032703957783648\"}",
"certificateInfo": [
{
"title": "房源发布人",
"icon": "http://ke-image.ljcdn.com/beike/1545043505977.png",
"list": [
{
"name": "从业人员工作牌",
"path": "https://img.ljcdn.com/ehr-personnel/202004111008285365UW0QVPQ.jpg"
},
{
"name": "全国房地产经纪人协理证",
"certCode": "30620191011100002734",
"path": "https://image1.ljcdn.com/ehr-personnel/20190108180804890B5IW0ZJU.png",
"jumpContent": "持有全国房地产经纪人协理职业资格证。\r\n由中国房地产估价师与房地产经纪人学会颁发人力资源社会保障部、住房城乡建设部监制,中国房地产估价师与房地产经纪人学会用印的相应级别《中华人民共和国房地产经纪专业人员职业资格证书》在全国范围有效。"
},
{
"name": "费率",
"path": "https://img.ljcdn.com/ehr-personnel/a810ff7a-e7f0-42fc-a508-96f51c6f94b0.jpg"
}
]
},
{
"title": "房源发布机构",
"icon": "http://ke-image.ljcdn.com/beike/1545043505977.png",
"list": [
{
"name": "营业执照",
"path": "https://img.ljcdn.com/ehr-personnel/20240813183721981NR3TQWSP.jpg",
"jumpContent": "企业信用信息查询网址:http://www.gsxt.gov.cn/index.html"
},
{
"name": "经纪备案",
"path": "https://img.ljcdn.com/ehr-personnel/20240507173107450KNIGTHDT.jpg"
}
]
}
]
},
"headPictures": [
{
"groupId": 2,
"groupName": "户型",
"imgObjectList": [
{
"groupId": 2,
"groupName": "户型",
"imgUrl": "http://ke-image.ljcdn.com/hdic-frame/standard_adc2f732-b0e3-4046-b580-06e34ccc1a75.png.1440x1080.jpg?from=ke.com"
}
]
}
],
"styleSet": {
"styleName": "normal",
"titleSize": 22,
"basicTitleColor": "FA5741",
"basicItemSize": 16,
"jumpItemColor": "3072F6",
"jumpItemSize": 16,
"sectionTitleSize": 20,
"navigateWordColor": "3072F6",
"stressColor": "FA5741"
},
"colorTags": [
{
"desc": "满五年",
"color": "849AAE",
"boldFont": 0
},
{
"desc": "随时可看",
"color": "849AAE",
"boldFont": 0
},
{
"desc": "房主自荐",
"color": "849AAE",
"boldFont": 0
}
],
"basicInfo": {
"isFocus": false,
"isOffSale": false,
"title": "双裕花园西区 1室1厅 63.4平米",
"cityId": "110000",
"houseCode": "101127449675",
"communityId": "1111027379646",
"communityName": "双裕花园西区",
"price": 2350000,
"unitPrice": 37067,
"floorState": "顶层/4层",
"blueprintHallNum": 1,
"blueprintBedroomNum": 1,
"area": 63.4,
"orientation": "南",
"mUrl": "https://m.ke.com/bj/ershoufang/101127449675.html",
"hasFramePoints": 0
},
"basicList": [
{
"name": "售价",
"value": "235万"
},
{
"name": "房型",
"value": "1室1厅"
},
{
"name": "建筑面积",
"value": "63.4㎡"
}
],
"infoList": [
{
"name": "单价:",
"value": "37067元/平"
},
{
"name": "挂牌:",
"value": "2024.11.05"
},
{
"name": "朝向:",
"value": "南"
},
{
"name": "楼层:",
"value": "顶层(共4层)"
},
{
"name": "楼型:",
"value": "板楼"
},
{
"name": "电梯:",
"value": "无"
},
{
"name": "装修:",
"value": "精装"
},
{
"name": "年代:",
"value": "2003年建成",
"alertText": "根据本栋部分房源产权证中《房屋登记表》上的测图日期统计生成,可能本栋不同房源之间存在差异,仅供参考。"
},
{
"name": "用途:",
"value": "普通住宅"
},
{
"name": "权属:",
"value": "商品房"
}
],
"infoJumpList": [
{
"id": "xiaoqurukou",
"name": "小区:",
"value": "双裕花园西区 (顺义区-后沙峪)",
"actionUrl": "lianjiabeike://community/detailv4?communityid=1111027379646"
},
{
"id": "gengduofangyuanxinxi",
"name": "其他:",
"value": "梯户比 供暖方式",
"actionUrl": "lianjiabeike://ershou/detail/info?houseCode=101127449675&strategyInfo=&shareAgentUcid="
},
{
"id": "goufangyusuan",
"sfTotal": 45,
"monthlySupply": 9500,
"name": "首付:",
"value": "净首付(不含税)45万,月供9500元",
"actionUrl": "https://tax.jiaoyi.ke.com/sf/detail?cityCode=110000&houseCode=101127449675&taxStatus=0&source=beike&ots=1773065058000&cjj=2350000&sk=fbf885bd36ea57987a7549dcc233e89d",
"color": "3072F6",
"clickName": "shoufurukou_succeed"
}
],
"userRelated": {
"isFollowed": 0,
"isFollowedPrice": 0,
"isAddCart": 0
},
"isDefault": false,
"hasFollowedPrice": 1,
"textFormatDownPrice": {
"itemKey": "textFormatDownPrice",
"textHead": "专属经纪人",
"textEnd": "电话讲解",
"color": "3072F6"
},
"declareInfo": {
"title": "风险提示",
"icon": "https://img.ljcdn.com/beike/api/1595215420267.png",
"actionUrl": "lianjiabeike://web/main?login=false&url=https%3A%2F%2Fm.ke.com%2Ftext%2Fdisclaimer"
},
"share": {
"showWeixin": true,
"showCircle": true,
"showAgent": true,
"showMsg": true
},
"vrAndLiveCard": [
{
"type": "live",
"url": "lianjiabeike://web/main?login=false&url=https%3A%2F%2Ffang-trade.ke.com%2FliveRoom%2FchannelV2%3FcityId%3D110000%26tagId%3DentityType2",
"statisticsText": "本市直播",
"title": "直播看房",
"subTitle": "随时随地 想看就看",
"buttonTitle": "立即观看",
"iconUrl": "https://img.ljcdn.com/beike/arsenal/1631786157239.gif",
"coverColor": "0DFE615A",
"strokeColor": "FE615A",
"buttonColor": "ED423B"
}
],
"hasLiveCard": true,
"isVrAndLiveCardBottom": 0,
"houseKeys": {
"title": "钥匙房源 随时看房",
"iconUrl": "http://ke-image.ljcdn.com/beike/1568101580073.png",
"actionUrl": "lianjiabeike://ershou/daikan?houseCode=101127449675&cityId=110000&requestFrom=0"
},
"nav": [
{
"name": "房源",
"key": "basicInfo"
}
]
}
}💡 Note: For list data, the example shows only 1-2 items for simplicity. The actual count depends on the API response.
