package main
import (
"fmt"
"strings"
"net/url"
"net/http"
"io/ioutil"
)
/**
* 使用方法:从getToken接口获取access_token, 替换参数token
*/
//调用接口使用的token, 使用时需要替换
var token = "***************";
func main() {
//请求参数
var params = url.Values{
"standPriceAssessBuildArea": {"99.01"},
"standDetailedAddress": {"重庆市龙湖春森彼岸四期"},
"standCity": {"重庆市"},
"timePeriod": {"LAST_THREE_MONTH"},
}
//请求地址
var uri = "https://gw-open.ke.com/api/assessTransactionCase"
req, _ := http.NewRequest(http.MethodPost, uri, strings.NewReader(params.Encode()))
//设置请求header
req.Header.Add("Content-Type","application/x-www-form-urlencoded")
req.Header.Add("access_token",token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
fmt.Println("调用成交案例库出错")
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"errno": 0,
"errmsg": "",
"traceId": "7894425633240989",
"data": {
"rowKey": "21490183",
"transactionItemListOut": [
{
"resblockName": "慧华苑",
"resblockAlias": "慧华苑小区",
"frameStructure": "平层",
"face": "南,北",
"buildingHeight": "多层",
"buildType": "板楼",
"isElevator": 0,
"buildStructure": "混合结构",
"heatingType": "集中供暖",
"statFunction": "普通住宅",
"dealProperty": "商品房",
"decorationTypeCode": "120002003",
"decorationType": "精装",
"buildYear": 1996,
"frameImage": "https://p.ljcdn.com/v0/hdic.t_m/hdic-frame/standard_b0d86d56-6610-463f-b76c-996132fcafdf.png",
"transDate": "2020-06-15 00:48:41",
"buildSize": "73.04",
"bedroomAmount": 2,
"parlorAmount": 1,
"toiletAmount": 1,
"frame": "二室一厅一卫",
"unitPrice": "46892.12",
"transPrice": "3425000.00",
"listDays": 12,
"listingPrice": 3490000,
"unitListingPrice": 47782.03,
"listingDate": "2020-06-02 19:56:07",
"showingAmount": 0,
"isElevatorStr": "否"
},
{
"resblockName": "慧华苑",
"resblockAlias": "慧华苑小区",
"frameStructure": "平层",
"face": "南,北",
"buildingHeight": "中高层",
"buildType": "板楼",
"isElevator": 0,
"buildStructure": "混合结构",
"heatingType": "集中供暖",
"statFunction": "普通住宅",
"dealProperty": "商品房",
"decorationTypeCode": "120002003",
"decorationType": "精装",
"buildYear": 1995,
"frameImage": "https://p.ljcdn.com/v0/hdic.t_m/hdic-frame/standard_52687356-fc09-4b33-a9bd-774781683238.png",
"transDate": "2020-05-05 13:33:38",
"buildSize": "71.24",
"bedroomAmount": 2,
"parlorAmount": 1,
"toiletAmount": 1,
"frame": "二室一厅一卫",
"unitPrice": "49270.08",
"transPrice": "3510000.00",
"listDays": 2,
"listingPrice": 3690000,
"unitListingPrice": 51796.74,
"listingDate": "2020-05-02 19:04:18",
"showingAmount": 0,
"isElevatorStr": "否"
},
{
"resblockName": "慧华苑",
"resblockAlias": "慧华苑小区",
"frameStructure": "平层",
"face": "南,北",
"buildingHeight": "多层",
"buildType": "板楼",
"isElevator": 0,
"buildStructure": "混合结构",
"heatingType": "集中供暖",
"statFunction": "普通住宅",
"dealProperty": "商品房",
"decorationTypeCode": "120002003",
"decorationType": "精装",
"buildYear": 1996,
"frameImage": "https://p.ljcdn.com/v0/hdic.t_m/hdic-frame/standard_79093a7c-6608-4305-8ba3-cad39c7a546d.png",
"transDate": "2020-05-04 19:31:15",
"buildSize": "73.33",
"bedroomAmount": 2,
"parlorAmount": 1,
"toiletAmount": 1,
"frame": "二室一厅一卫",
"unitPrice": "45506.62",
"transPrice": "3337000.00",
"listDays": 163,
"listingPrice": 3300000,
"unitListingPrice": 45002.04,
"listingDate": "2019-11-23 15:41:30",
"showingAmount": 0,
"isElevatorStr": "否"
}
]
}
}