Comparables & Valuation · REST API
Search comparables (v1)
POST
https://api.casafari.com/api/v1/comparables/searchBearer token66 parameters
Send Authorization: Bearer $CASAFARI_TOKEN; see how to get a token.
Over MCP: comps_get-comparables (related). MCP and REST compared.
Description
Returns comparable properties by the given parameters.
Request body
Content type application/json. Optional. Type: object.
comparables_countintegerrequiredMaximum number of comparable properties in results.
1–50
coordinatesobjectTarget point coordinates to search around. This field is deprecated and will be removed in the next major update. Please, use
target_point.coordinates field instead.2 properties
latitudenumberrequiredLatitude.
-90–90
longitudenumberrequiredLongitude.
-180–180
target_pointobjectTarget point to search around. Can be defined as coordinates, address or cadastral reference of the property. Only one value should be provided. This field is deprecated and will be removed in the next major update. Please, use
location_boundary.circle field instead.3 properties
coordinatesobjectTarget point coordinates to search around.
2 properties
latitudenumberrequiredLatitude.
-90–90
longitudenumberrequiredLongitude.
-180–180
addressstringAddress of the property to define the point to search around.
cadastral_referenceobjectCadastral reference of the property to define the point to search around. For now available only for Spain.
4 properties
country_codestringrequiredCountry code following the ISO 3166-1 alpha-2 rules.
EScadastral_referencestringrequiredCadastral reference of the estate.
provincestringName of the estate's province.
municipalitystringName of the estate's municipality.
distancenumberMaximum distance in kilometers from the requested
target_point to comparable properties. This field is deprecated and will be removed in the next major update. Please, use location_boundary.circle field instead.0.05–50default 5
location_boundaryobjectrequiredLocation to search within. Can be defined as a polygon of geo-points or a circle with a given target point and a distance. Only one value should be provided.
2 properties
polygonobject[]Closed polygon of geo-points to search within. First and last points must match.
at least 4 items
2 properties
latitudenumberrequiredLatitude.
-90–90
longitudenumberrequiredLongitude.
-180–180
circleobjectCircle boundary to search within.
2 properties
distancenumberMaximum distance in kilometers from the requested
target_point to the properties.0.05–50default 5
target_pointobjectrequiredTarget point to search around. Can be defined as coordinates, address or cadastral reference of the property. Only one value should be provided.
3 properties
coordinatesobjectTarget point coordinates to search around.
2 properties
latitudenumberrequiredLatitude.
-90–90
longitudenumberrequiredLongitude.
-180–180
addressstringAddress of the property to define the point to search around.
cadastral_referenceobjectCadastral reference of the property to define the point to search around. For now available only for Spain.
4 properties
country_codestringrequiredCountry code following the ISO 3166-1 alpha-2 rules.
EScadastral_referencestringrequiredCadastral reference of the estate.
provincestringName of the estate's province.
municipalitystringName of the estate's municipality.
sold_or_rented_afterstring (date)nullableProperties sold/rented since this date (in the format
YYYY-MM-DD) will be considered as possible comparables. Default value: 9 months ago, counting from today. If null is passed, only active properties will be considered.operationstringrequiredOperation type.
sale rentbusiness_typestringOperation type. This field is deprecated and will be removed in the next major update. Please, use
operation field instead.sale rentcomparables_typestringComparables property type, as returned by the GET /api/v1/references/types endpoint. This field is deprecated and will be removed in the next major update. Please, use
comparables_types field instead.40 allowed values
apartment studio duplex penthouse dachgeschosswohnung etagenwohnung erdgeschosswohnung country_house house palace townhouse villa country_estate chalet bungalow family_house reihenhaus reihenendhaus reihenmittelhaus einfamilienhaus zweifamilienhaus landwirtschaftliche_betriebe retail office industrial warehouse hotel other_commercial restaurant werkstatt plot urban_plot rural_plot room other garage parking apartment_building office_building mix_use_buildingcomparables_typesstring[]requiredCountry availability per type is available at the GET /api/v1/references/types endpoint. Property types by type groups: apartment: penthouse, dachgeschosswohnung, erdgeschosswohnung, apartment, etagenwohnung, studio, duplex house: townhouse, reihenmittelhaus, landwirtschaftliche_betriebe, country_house, family_house (DEPRECATED), villa, palace, chalet, zweifamilienhaus, country_estate, reihenendhaus, reihenhaus, bungalow, einfamilienhaus, house room: room building: office_building, apartment_building, mix_use_building investment: retail, hotel, warehouse, office, restaurant, industrial, other_commercial, werkstatt plot: rural_plot, urban_plot, plot (DEPRECATED) other: garage, other, parking Note that you can select multiple types only from one property type group.
40 allowed values
apartment studio duplex penthouse dachgeschosswohnung etagenwohnung erdgeschosswohnung country_house house palace townhouse villa country_estate chalet bungalow family_house reihenhaus reihenendhaus reihenmittelhaus einfamilienhaus zweifamilienhaus landwirtschaftliche_betriebe retail office industrial warehouse hotel other_commercial restaurant werkstatt plot urban_plot rural_plot room other garage parking apartment_building office_building mix_use_buildingproperty_typestringComparables property type, as returned by the GET /api/v1/references/types endpoint. This field is deprecated and will be removed in the next major update. Please, use
comparables_types field instead.40 allowed values
apartment studio duplex penthouse dachgeschosswohnung etagenwohnung erdgeschosswohnung country_house house palace townhouse villa country_estate chalet bungalow family_house reihenhaus reihenendhaus reihenmittelhaus einfamilienhaus zweifamilienhaus landwirtschaftliche_betriebe retail office industrial warehouse hotel other_commercial restaurant werkstatt plot urban_plot rural_plot room other garage parking apartment_building office_building mix_use_buildingmin_priceintegerThe minimum price filter for comparables result.
0–2147483647default 0
max_priceintegerThe maximum price filter for comparables result.
1–2147483647
conditionstringProperty condition, as returned by the GET /api/v1/references/conditions endpoint.
used ruin very-good new otherbedroomsintegerNumber of bedrooms (cannot be used together with
rooms).0–15000
roomsintegerNumber of rooms (cannot be used together with
bedrooms).0–15000
bathroomsintegerNumber of bathrooms.
1–15000
construction_yearintegerDesired construction year.
1–3000
total_areaintegerDesired total area, square meters. This field is required for
hotel, industrial, office, other_commercial, restaurant, retail, warehouse, werkstatt property types if target_point.cadastral_reference is not provided.5–10000000
plot_areaintegerDesired plot area, square meters. This field is required for
rural_plot and urban_plot property types if target_point.cadastral_reference is not provided.20–10000000
floorstringFloor type. This field is deprecated and will be removed in the next major update. Please, use
floors field instead.no_floor ground middle topfloorsstring[]List of floor types.
no_floor ground middle topfloor_numberinteger[]Desired list of floor numbers. Negative values indicate underground floors (e.g. basements). Minimum value is -250. Maximum value is 250.
-250–250
orientationstringProperty view orientation.
exterior interiorviewstringView from the property. This field is deprecated and will be removed in the next major update. Please, use
views field instead.water landscape city golf parkviewsstring[]List of views from the property.
water landscape city golf parkdirectionstringCardinal direction the property faces. This field is deprecated and will be removed in the next major update. Please, use
directions field instead.north south east westdirectionsstring[]List of cardinal directions the property faces.
north south east westcharacteristicsobjectProperty characteristics.
3 properties
must_havestring[]Include only properties that have all these characteristics.
balcony elevator no_elevator garage garden parking storage swimming_pool terrace rental_license furniture rented_out life_annuitynice_to_havestring[]Include properties that have any of these characteristics.
balcony elevator no_elevator garage garden parking storage swimming_pool terrace rental_license furniture rented_out life_annuityexcludestring[]Exclude properties that contain any of these characteristics.
balcony elevator no_elevator garage garden parking storage swimming_pool terrace rental_license furniture rented_out life_annuityenergy_certificatestringEnergy certificate. This field is deprecated and will be removed in the next major update. Please, use
energy_ratings field instead.Unknown A+ A B C D E F G Henergy_certificatesstring[]List of energy certificates. This field is deprecated and will be removed in the next major update. Please, use
energy_ratings field instead.Unknown A+ A B C D E F G Henergy_ratingsstring[]List of energy ratings.
Unknown A+ A B C D E F G Hdays_on_market_fromintegerMinimum days on market value.
1–10000
days_on_market_tointegerMaximum days on market value.
1–10000
with_agenciesstring[]Return properties from specified agencies, companies or sources. To find allowed agency names use the GET /api/v1/references/agencies endpoint.
without_agenciesstring[]Exclude properties from specified agencies, companies or sources. To find allowed agency names use the GET /api/v1/references/agencies endpoint.
exclude_outliersbooleanExclude properties that are significantly underpriced or overpriced compared to similar properties.
default true
Example request
Placeholders only: replace the token and the values with your own.
curl -X POST "https://api.casafari.com/api/v1/comparables/search" \
-H "Authorization: Bearer $CASAFARI_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"comparables_count": 20,
"location_boundary": {
"circle": {
"distance": 3.5,
"target_point": {
"coordinates": {
"latitude": 38.74,
"longitude": -9.17
}
}
}
},
"sold_or_rented_after": "2020-06-01",
"days_on_market_from": 10,
"days_on_market_to": 1000,
"operation": "sale",
"comparables_types": [
"apartment"
],
"bedrooms": 2,
"construction_year": 2010,
"total_area": 125,
"condition": "used",
"floors": [
"middle",
"top"
],
"floor_number": [
3,
5
],
"views": [
"city",
"landscape"
],
"directions": [
"west",
"north"
],
"characteristics": {
"must_have": [
"balcony",
"elevator"
],
"nice_to_have": [
"garage",
"parking",
"storage"
]
},
"energy_ratings": [
"A",
"B",
"C"
]
}'Responses
200 OK
Type: object.
Show the response shape (98 fields)
resultsobject[]requiredArray of found comparable properties.
60 properties
property_idintegerrequiredID of the property.
property_urlstringnullableURL of the property in the CASAFARI website.
primary_listing_idintegerrequiredPrimary listing (ad) ID of the property which is defined after the matching into property.
typestringrequiredProperty type, as returned by the GET /api/v1/references/types endpoint.
40 allowed values
apartment studio duplex penthouse dachgeschosswohnung etagenwohnung erdgeschosswohnung country_house house palace townhouse villa country_estate chalet bungalow family_house reihenhaus reihenendhaus reihenmittelhaus einfamilienhaus zweifamilienhaus landwirtschaftliche_betriebe retail office industrial warehouse hotel other_commercial restaurant werkstatt plot urban_plot rural_plot room other garage parking apartment_building office_building mix_use_buildingtype_groupstringrequiredProperty type group, as returned by the GET /api/v1/references/types endpoint.
apartment house investment plot othercoordinatesobjectrequiredProperty coordinates.
2 properties
latitudenumberrequiredLatitude.
longitudenumberrequiredLongitude.
locationobjectrequiredInformation about property location.
4 properties
location_idintegerrequiredLocation ID, as returned by the POST /api/v1/references/locations endpoint.
namestringrequiredLocation name.
administrative_levelstringrequiredLocation administrative level.
zip_codesstring[]The location zip codes.
default []
locations_structureobject[]requiredInformation about all the parent locations (including property location) up to the country.
4 properties
location_idintegerrequiredLocation ID, as returned by the POST /api/v1/references/locations endpoint.
namestringrequiredLocation name.
administrative_levelstringrequiredLocation administrative level.
zip_codesstring[]The location zip codes.
default []
addressstringrequiredProperty address.
zip_codestringrequiredThe location zip code.
distancenumbernullableDistance in kilometers from target point to the property. Not calculated for search by polygon.
construction_yearintegerrequiredConstruction year.
total_areaintegerrequiredTotal area.
living_areaintegerrequiredLiving area.
plot_areaintegerrequiredPlot area.
terrace_areaintegerrequiredTerrace area.
bedroomsintegerrequiredNumber of bedrooms.
roomsintegerrequiredNumber of rooms.
bathroomsintegerrequiredNumber of bathrooms.
floor_numberintegerrequiredExact floor number. Negative values indicate underground floors (e.g. basements).
conditionstringrequiredProperty condition, as returned by the GET /api/v1/references/conditions endpoint.
used ruin very-good new otherfeaturesobjectrequiredProperty features, as returned by the GET /api/v1/references/features endpoint.
7 properties
floorstringrequiredFloor type.
no_floor ground middle toporientationstringrequiredProperty view orientation.
exterior interiorviewstringrequiredView from the property. This field is deprecated and will be removed in the next major update. Please, use
views field instead.water landscape city golf parkviewsstring[]requiredList of views from the property.
water landscape city golf parkdirectionstringrequiredCardinal direction the property faces. This field is deprecated and will be removed in the next major update. Please, use
directions field instead.north south east westdirectionsstring[]requiredList of cardinal directions the property faces.
north south east westcharacteristicsstring[]requiredProperty characteristics.
balcony elevator no_elevator garage garden parking storage swimming_pool terrace rental_license furniture rented_out life_annuityoperationsstring[]requiredOperation types for which property is available.
sale rentsale_statusstringrequiredSale status.
active reserved hold sold nonesale_currencystringrequiredSale price currency code.
sale_priceintegerrequiredSale price, in the currency of the listings (specified by the
sale_currency field).sale_price_baseintegerrequiredSale price, in Euros.
sale_price_per_sqmnumberrequiredSale price per square meter, in the currency of the listings (specified by the
sale_currency field).sale_price_per_sqm_basenumberrequiredSale price per square meter, in Euros.
rent_statusstringrequiredRent status.
active reserved hold rented nonerent_currencystringrequiredRent price currency code.
rent_priceintegerrequiredRent price, in the currency of the listings (specified by the
rent_currency field).rent_price_baseintegerrequiredRent price, in Euros.
rent_price_per_sqmnumberrequiredRent price per square meter, in the currency of the listings (specified by the
rent_currency field).rent_price_per_sqm_basenumberrequiredRent price per square meter, in Euros.
rent_periodstringrequiredRent period.
day week fortnight month year nonetitlestringrequiredProperty title.
descriptionstringrequiredProperty description.
thumbnailsstring[]List of the thumbnail image URLs.
picturesstring[]List of the original picture image URLs.
gross_yieldnumberrequiredGross yield in percentage.
sold_atstring (date)requiredDate when the property was sold.
rented_atstring (date)requiredDate when the property was rented.
total_sale_price_changenumberrequiredTotal sale price change in percents.
total_rent_price_changenumberrequiredTotal rent price change in percents.
last_sale_price_reductionnumberrequiredLast sale price reduction in percents.
last_rent_price_reductionnumberrequiredLast rent price reduction in percents.
sale_price_last_changeobjectrequiredInformation about the last change of sale price.
3 properties
change_datestring (date)requiredDate of the change.
old_valueintegerrequiredValue before change.
new_valueintegerrequiredValue after change.
rent_price_last_changeobjectrequiredInformation about the last change of rent price.
3 properties
change_datestring (date)requiredDate of the change.
old_valueintegerrequiredValue before change.
new_valueintegerrequiredValue after change.
sale_time_on_marketobjectnullableInformation about the property last activity on the sales market.
rent_time_on_marketobjectnullableInformation about the property last activity on the rental market.
sale_active_listings_countintegerNumber of active listings for this property on the sales market.
rent_active_listings_countintegerNumber of active listings for this property on the rental market.
similarity_scorenumberSimilarity score of the property. Value between 0 and 1. Indicates how property parameters are close to the requested ones.
listing_urlsstring (uri)[]requiredListing urls of the comparable.
is_dvfbooleanWhether the property taken from DVF.
default false
is_outlierbooleanWhether the property is considered an outlier based on its price.
default false
is_private_propertybooleanrequiredWhether the property is listed by a private individual, as opposed to an agent or a professional.
energy_certificatestringEnergy certificate classification that attests to the energy efficiency of a property. This field is deprecated and will be removed in the next major update. Please, use
energy_rating field instead.default ""
energy_ratingstringEnergy rating that attests to the energy efficiency of a property.
default ""
statisticsobjectrequiredStatistics information for the found comparables (for
operation defined in the request).5 properties
average_priceintegerrequiredAverage price.
average_price_per_sqmnumberrequiredAverage price per square meter.
average_time_on_the_marketintegerrequiredAverage number of days on the market.
average_listings_per_propertynumberrequiredAverage number of listings per property.
sold_or_rented_in_last_six_monthsintegerrequiredNumber of properties that were sold or rented during the last 6 months in the requested location.
estimated_pricesobjectrequiredEstimated prices calculated based on the found comparables (for
operation defined in the request).6 properties
fast_sell_priceintegerrequiredFast sell price.
fair_market_priceintegerrequiredFair market price.
out_of_market_priceintegerrequiredOut of market price.
fast_sell_price_per_sqmnumberrequiredFast sell price per square meter.
fair_market_price_per_sqmnumberrequiredFair market price per square meter.
out_of_market_price_per_sqmnumberrequiredOut of market price per square meter.
casafari_linkstring (uri)requiredLink to Comparative Market Analysis page.
pattern
^(?:[a-z0-9.+-]*)://(?:[^\s:@/]+(?::[^\s:@/]*)?@)?(?:(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)(?:\.(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)){3}|\[[0-9a-f:.]+\]|([a-z¡-0-9](?:[a-z¡-0-9-]{0,61}[a-z¡-0-9])?(?:\.(?!-)[a-z¡-0-9-]{1,63}(?<!-))*\.(?!-)(?:[a-z¡--]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\.?|localhost))(?::[0-9]{1,5})?(?:[/?#][^\s]*)?\z400 Bad Request
Type: object.
Show the response shape (1 fields)
errorsobjectDescription of the errors encountered.
401 Unauthorized
Type: object.
Show the response shape (1 fields)
detailstringDescription of the error encountered.
403 Forbidden
Type: object.
Show the response shape (1 fields)
detailstringDescription of the error encountered.