---
title: "Bedrooms Distribution"
method: POST
path: "/market-analytics-api/distributions/bedrooms"
tags: ["market-analytics-api---distributions"]
---

# Bedrooms Distribution

`POST /market-analytics-api/distributions/bedrooms`

## Request

- Base URL: `https://api.casafari.com`
- URL: `https://api.casafari.com/market-analytics-api/distributions/bedrooms`
- Auth: HTTP bearer

Returns property distribution based on the number of bedrooms.<br>Each distribution unit includes the bedroom count, number of matching properties, and related analysis.

## Request body

- MarketAnalyticsApiBedroomsDistributionRequestSchema
  - `types` MarketAnalyticsApiExternalApartmentAndHouseEstateTypeEnum[], required: The list of property types by type groups:<br/><strong>apartment: </strong>["apartment", "studio", "duplex", "penthouse", "dachgeschosswohnung", "etagenwohnung", "erdgeschosswohnung"]<br/><strong>house: </strong>["country_house", "house", "palace", "townhouse", "villa", "country_estate", "chalet", "bungalow", "family_house", "reihenhaus", "reihenendhaus", "reihenmittelhaus", "einfamilienhaus", "zweifamilienhaus", "landwirtschaftliche_betriebe"]<br/><strong>development: </strong>["apartment_development", "house_development"]<br/><br/><i>Note that you can select multiple types only from one property type group.</i><br><br><span style="color:red">The list of property types specific to certain countries</span>:<br/><strong>apartment:</strong><br/>&#9675; dachgeschosswohnung: <strong>Germany</strong><br/>&#9675; etagenwohnung: <strong>Germany</strong><br/>&#9675; erdgeschosswohnung: <strong>Germany</strong><br/><strong>house:</strong><br/>&#9675; family_house: <strong>Germany</strong><br/>&#9675; reihenhaus: <strong>Germany</strong><br/>&#9675; reihenendhaus: <strong>Germany</strong><br/>&#9675; reihenmittelhaus: <strong>Germany</strong><br/>&#9675; einfamilienhaus: <strong>Germany</strong><br/>&#9675; zweifamilienhaus: <strong>Germany</strong><br/>&#9675; landwirtschaftliche_betriebe: <strong>Germany</strong>
  - `business_type` 'sale' | 'rent', required
  - `price_range` MarketAnalyticsApiapiSchemaRangesIntRangeSchema8
    - `min` integer, nullable
    - `max` integer, nullable
  - `price_per_sqm_range` MarketAnalyticsApiapiSchemaRangesIntRangeSchema9
    - `min` integer, nullable
    - `max` integer, nullable
  - `rooms_range` MarketAnalyticsApiapiSchemaRangesIntRangeSchema10
    - `min` integer, nullable
    - `max` integer, nullable
  - `bedrooms_range` MarketAnalyticsApiapiSchemaRangesIntRangeSchema16
    - `min` integer, nullable
    - `max` integer, nullable
  - `bathrooms_range` MarketAnalyticsApiapiSchemaRangesIntRangeSchema12
    - `min` integer, nullable
    - `max` integer, nullable
  - `total_area_range` MarketAnalyticsApiapiSchemaRangesIntRangeSchema13
    - `min` integer, nullable
    - `max` integer, nullable
  - `plot_area_range` MarketAnalyticsApiapiSchemaRangesIntRangeSchema14
    - `min` integer, nullable
    - `max` integer, nullable
  - `construction_year_range` MarketAnalyticsApiapiSchemaRangesIntRangeSchema15
    - `min` integer, nullable
    - `max` integer, nullable
  - `characteristics` MarketAnalyticsApiCharacteristicsRequestSchema
    - `must_have` MarketAnalyticsApiExternalCharacteristicEnum[]: Include only properties that have all these characteristics.
    - `exclude` MarketAnalyticsApiExternalCharacteristicEnum[]: Exclude properties that contain any of these characteristics.
  - `conditions` MarketAnalyticsApiExternalConditionEnum[]: Property conditions, as returned by the [GET /api/v1/references/conditions](/#operation/api__get__v1__references__conditions) endpoint.
  - `private` boolean: Whether the property is listed by a private individual, as opposed to an agent or a professional.
  - `bank` boolean: Whether the property is owned by the bank.
  - `auction` boolean: Whether the property is the subject of an auction.
  - `exclude_outliers` boolean: Exclude properties that are significantly underpriced or overpriced compared to similar properties.
  - `custom_location_boundary` MarketAnalyticsApiLocationBoundarySchema, required
    - `location_ids` integer[]: List of location IDs.
    - `polygon` MarketAnalyticsApiGeoPoint[]: List of geo-points to search within. Polygon must contain at least 4 points. First and last points must match.
      - `latitude` number, required
      - `longitude` number, required
    - `circle` MarketAnalyticsApiCircleBoundarySchema
      - `distance` integer, required: Maximum distance in meters from the requested `target_point` to the properties.
      - `target_point` MarketAnalyticsApiGeoPoint, required
        - `latitude` number, required
        - `longitude` number, required

## Response `200`

Successful Response

- MarketAnalyticsApiBedroomsDistributionUnitResponseSchema[]
  - `bedrooms` string, required: The number of bedrooms in the properties that participated in the distribution.
  - `properties_count` integer, required: The number of properties that participated in the distribution.
  - `average_price` number, required: Average price of properties with a specific number of bedrooms.
  - `average_price_per_sqm` number, required: Average price per square meter of properties with a specific number of bedrooms.

## Other responses

- `204`: No Content
- `400`: Bad Request
- `422`: Validation Error

---

[API](https://skmtc.dev/casafari/apis/casafari-api.md) · [All operations](https://skmtc.dev/casafari/apis/casafari-api/llms.txt) · [OpenAPI document](https://skmtc.dev/casafari/apis/casafari-api/revisions/6743b99d4bf9?raw)
