# Analysis

> **Casafari is the AI agent-native real estate data intelligence platform.** The most complete property index in Europe: a deduplicated, cleaned property graph of residential and commercial property, for sale and for rent, in 16 countries. Every property is one record with its full price and market history. [How the property graph is built](/docs/property-graph).

`POST https://api.casafari.com/market-analytics-api/analysis`

[Area Insights](/docs/area-insights) · [REST API](/docs/rest/area-insights). Send `Authorization: Bearer $CASAFARI_TOKEN`; see [how to get a token](/docs/rest#get-a-token).

Over MCP: no tool does this. See [MCP and REST compared](/docs/parity#area-insights).

## Description

Market analysis based on the requested property parameters.

## Request body

Content type `application/json`. Required. Type: `object`.

- `custom_location_boundary` (object, required)
  - `location_ids` (integer[], optional): List of location IDs. 1–10 items; 1–2147483647.
  - `polygon` (object[], optional): List of geo-points to search within. Polygon must contain at least 4 points. First and last points must match. at least 4 items.
    - `latitude` (number, required) -90–90.
    - `longitude` (number, required) -180–180.
  - `circle` (object, optional): Circle boundary to search within.
    - `distance` (integer, required): Maximum distance in meters from the requested `target_point` to the properties. 50–50000.
    - `target_point` (object, required): Target point coordinates to search around.
      - `latitude` (number, required) -90–90.
      - `longitude` (number, required) -180–180.
- `business_type` (string, required): Operation type for which the property is available. Values: `sale`, `rent`.
- `types` (string[], required): The list of property types by type groups: **apartment:** ["apartment", "studio", "duplex", "penthouse", "dachgeschosswohnung", "etagenwohnung", "erdgeschosswohnung"] **house:** ["country_house", "house", "palace", "townhouse", "villa", "country_estate", "chalet", "bungalow", "family_house", "reihenhaus", "reihenendhaus", "reihenmittelhaus", "einfamilienhaus", "zweifamilienhaus", "landwirtschaftliche_betriebe"] **room:** ["room"] **building:** ["apartment_building", "office_building", "mix_use_building"] **investment:** ["retail", "office", "industrial", "warehouse", "hotel", "building", "other_commercial", "restaurant", "werkstatt"] **development:** ["apartment_development", "house_development"] **plot:** ["urban_plot", "rural_plot"] **other:** ["parking", "garage", "other"] *Note that you can select multiple types only from one property type group.* The list of property types specific to certain countries: **apartment:** &#9675; dachgeschosswohnung: **Germany** &#9675; etagenwohnung: **Germany** &#9675; erdgeschosswohnung: **Germany** **house:** &#9675; family_house: **Germany** &#9675; reihenhaus: **Germany** &#9675; reihenendhaus: **Germany** &#9675; reihenmittelhaus: **Germany** &#9675; einfamilienhaus: **Germany** &#9675; zweifamilienhaus: **Germany** &#9675; landwirtschaftliche_betriebe: **Germany** **investment:** &#9675; restaurant: **Germany** &#9675; werkstatt: **Germany** **plot:** &#9675; urban_plot: **Italy, Germany, Portugal, Spain, France** &#9675; rural_plot: **Italy, Germany, Portugal, Spain, France** 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`, `building`, `other_commercial`, `restaurant`, `werkstatt`, `urban_plot`, `rural_plot`, `room`, `parking`, `garage`, `other`, `apartment_building`, `office_building`, `mix_use_building`, `apartment_development`, `house_development`. at least 1 item.
- `conditions` (string[], optional, nullable): Property conditions, as returned by the GET /api/v1/references/conditions endpoint. Values: `used`, `ruin`, `very-good`, `new`, `other`. at least 1 item.
- `energy_ratings` (string[], optional, nullable): List of energy ratings that attests to the energy efficiency of the property. Values: `Unknown`, `A+`, `A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`. at least 1 item.
- `orientations` (string[], optional, nullable): Property view orientation. Values: `exterior`, `interior`. at least 1 item.
- `views` (string[], optional, nullable): List of views from the property. Values: `water`, `landscape`, `city`, `golf`, `park`. at least 1 item.
- `directions` (string[], optional, nullable): List of cardinal directions the property faces. Values: `north`, `south`, `east`, `west`. at least 1 item.
- `floors` (string[], optional, nullable): List of floor types. Values: `no_floor`, `ground`, `middle`, `top`. at least 1 item.
- `price_range` (object, optional, nullable)
  - `min` (integer, optional, nullable) 1–2147483647.
  - `max` (integer, optional, nullable) 1–2147483647.
- `rooms_range` (object, optional, nullable)
  - `min` (integer, optional, nullable) 1–15000.
  - `max` (integer, optional, nullable) 1–15000.
- `bedrooms_range` (object, optional, nullable)
  - `min` (integer, optional, nullable) 0–15000.
  - `max` (integer, optional, nullable) 0–15000.
- `bathrooms_range` (object, optional, nullable)
  - `min` (integer, optional, nullable) 1–15000.
  - `max` (integer, optional, nullable) 1–15000.
- `total_area_range` (object, optional, nullable)
  - `min` (integer, optional, nullable) 1–1000000.
  - `max` (integer, optional, nullable) 1–1000000.
- `plot_area_range` (object, optional, nullable)
  - `min` (integer, optional, nullable) 1–1000000.
  - `max` (integer, optional, nullable) 1–1000000.
- `construction_year_range` (object, optional, nullable)
  - `min` (integer, optional, nullable) 1–3000.
  - `max` (integer, optional, nullable) 1–3000.
- `characteristics` (object, optional, nullable)
  - `must_have` (string[], optional): Include only properties that have all these characteristics. Values: `balcony`, `elevator`, `no_elevator`, `garage`, `garden`, `parking`, `storage`, `swimming_pool`, `terrace`, `rental_license`, `furniture`, `rented_out`, `life_annuity`.
  - `exclude` (string[], optional): Exclude properties that contain any of these characteristics. Values: `balcony`, `elevator`, `no_elevator`, `garage`, `garden`, `parking`, `storage`, `swimming_pool`, `terrace`, `rental_license`, `furniture`, `rented_out`, `life_annuity`.

## Example request

Placeholders only: replace the token and the values with your own.

```bash
curl -X POST "https://api.casafari.com/market-analytics-api/analysis" \
  -H "Authorization: Bearer $CASAFARI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "custom_location_boundary": {
    "location_ids": [
      1
    ]
  },
  "business_type": "sale",
  "types": [
    "apartment"
  ]
}'
```

## Responses

### 200 Successful Response

Type: `object`.

- `price_statistics` (object, required): Statistics including the average price and average price per square meter for properties matching the requested filters.
  - `average_price` (integer, required)
  - `average_price_per_sqm` (integer, required)
- `price_estimation` (object, required): Provides estimated prices, including a quick sale price `fast_market_price` and an inflated price `out_of_market_price`.
  - `fast_market_price` (integer, required)
  - `out_of_market_price` (integer, required)
- `price_evolution` (object, required): Represents time series data showing how average prices and prices per square meter have changed over time for inactive properties.
  - `avg_price` (object, required)
    - `for_the_last_1_month` (integer, required)
    - `for_the_last_3_month` (integer, required)
    - `for_the_last_6_month` (integer, required)
    - `for_the_last_9_month` (integer, required)
    - `for_the_last_12_month` (integer, required)
  - `avg_price_per_sqm` (object, required)
    - `for_the_last_1_month` (integer, required)
    - `for_the_last_3_month` (integer, required)
    - `for_the_last_6_month` (integer, required)
    - `for_the_last_9_month` (integer, required)
    - `for_the_last_12_month` (integer, required)
- `summary_price_evolution` (object, required): Represents time series data showing how average prices and prices per square meter have changed over time for both active and inactive properties.
  - `avg_price` (object, required)
    - `for_the_last_1_month` (integer, required)
    - `for_the_last_3_month` (integer, required)
    - `for_the_last_6_month` (integer, required)
    - `for_the_last_9_month` (integer, required)
    - `for_the_last_12_month` (integer, required)
  - `avg_price_per_sqm` (object, required)
    - `for_the_last_1_month` (integer, required)
    - `for_the_last_3_month` (integer, required)
    - `for_the_last_6_month` (integer, required)
    - `for_the_last_9_month` (integer, required)
    - `for_the_last_12_month` (integer, required)
- `average_days_on_the_market` (integer, required): Indicates the average number of days properties remain listed on the market before being sold or removed.

### 400 Bad Request

Type: `object`.

- `message` (string, required)
- `errors` (string[], optional, nullable)
- `details` (string, optional, nullable)

### 404 Not Found

Type: `object`.

- `message` (string, required)
- `errors` (string[], optional, nullable)
- `details` (string, optional, nullable)

### 422 Validation Error

Type: `object`.

- `detail` (object[], optional)
  - `loc` ((string | integer)[], required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any, optional)
  - `ctx` (object, optional)

## Questions about this

- [Which tools exist only over MCP, and which operations only over REST?](/docs/faq/mcp-only-and-rest-only)
