# Average registered sale prices by location

> **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://platform.casafari.com/v1/area-insights/sales/average-prices`

[Area Insights](/docs/area-insights) · [REST API](/docs/rest/area-insights). Send `Authorization: Bearer $CASAFARI_API_KEY`: a platform API key (`cf_sk_...`) from [the console](https://platform.casafari.com/console), or an OAuth access token; `X-API-Key` carries the key too. See [platform API keys](/docs/rest#platform-api-keys). Costs 10 tokens a call (1 token = EUR 0.04).

Over MCP: [`area-insights_get_sales_average_prices`](/docs/area-insights/get_sales_average_prices) (equivalent). See [MCP and REST compared](/docs/parity#area-insights).

## Description

Costs 10 tokens a call.

## Request body

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

- `country` (string, required): ES (Spain), FR (France), IT (Italy), PL (Poland) or PT (Portugal: INE's official median per m² by municipality and quarter; area as location_ids, a circle or a polygon, only types and sold_at_range as filters, no counts) or AT (Austria: yearly open-data prices per m² by municipality, district or state; location_ids only; no counts; not available until Casafari names its source). Values: `ES`, `FR`, `IT`, `PL`, `PT`, `AT`.
- `location_boundary` (object, required): The area: exactly one of location_ids (from Location Lookup), circle or polygon.
  - `location_ids` (integer[], optional): Location ids from Location Lookup (locations_search), all in the request's country. 1–100 items; ≥ 1.
  - `circle` (object, optional): A circle: its centre and radius in metres (1 to 50 000).
    - `coordinates` (object, required)
      - `lat` (number, required) -90–90.
      - `lon` (number, required) -180–180.
    - `radius_in_meters` (number, required) 1–50000.
  - `polygon` (object[], optional): A closed polygon: at least 4 points, the last equal to the first. 4–1000 items.
    - `lat` (number, required) -90–90.
    - `lon` (number, required) -180–180.
- `sold_at_range` (object, optional): Sale dates, YYYY-MM-DD: {"gte": "2024-01-01"}, an upper bound with lte, or both (or gt / lt).
  - `gte` (string (date), optional) pattern `^\d{4}-\d{2}-\d{2}$`.
  - `gt` (string (date), optional) pattern `^\d{4}-\d{2}-\d{2}$`.
  - `lte` (string (date), optional) pattern `^\d{4}-\d{2}-\d{2}$`.
  - `lt` (string (date), optional) pattern `^\d{4}-\d{2}-\d{2}$`.
- `types` (string[], optional): Property types, lower case, e.g. ["apartment", "penthouse"] or ["house", "villa"]. 1–40 items; at most 40 characters; pattern `^[a-z][a-z_]*$`.
- `conditions` (string[], optional): Spain, Italy and Poland only: property condition, any of used, ruin, very-good, new, other. Values: `used`, `ruin`, `very-good`, `new`, `other`. 1–5 items.
- `with_mortgage` (boolean, optional): Spain only: true for sales financed with a mortgage, false for sales without one.
- `price_range` (object, optional): Registered sale price in euros: {"gte": n, "lte": n} (or gt / lt); at least one bound.
  - `gte` (number, optional) ≥ 0.
  - `gt` (number, optional) ≥ 0.
  - `lte` (number, optional) ≥ 0.
  - `lt` (number, optional) ≥ 0.
- `price_per_sqm_range` (object, optional): Registered sale price per square metre in euros: {"gte": n, "lte": n} (or gt / lt); at least one bound.
  - `gte` (number, optional) ≥ 0.
  - `gt` (number, optional) ≥ 0.
  - `lte` (number, optional) ≥ 0.
  - `lt` (number, optional) ≥ 0.

## Example request

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

```bash
curl -X POST "https://platform.casafari.com/v1/area-insights/sales/average-prices" \
  -H "Authorization: Bearer $CASAFARI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "country": "ES",
  "location_boundary": {
    "location_ids": [
      1
    ]
  }
}'
```

## Responses

### 200 Success.

Type: `object`.

### Errors

Every error is an `application/problem+json` body (RFC 9457) with `type` (a page that explains it), `title`, `status`, `detail` (what to do), `instance`, `code` and `request_id` (what to quote to support). A `402` carries an `upgrade_url`, a `429` a `Retry-After` header. The codes each status can carry:

- `400`: `invalid_request`, `key_in_query` (https://platform.casafari.com/errors/invalid-request, https://platform.casafari.com/errors/key-in-query)
- `401`: `unauthorized`, `invalid_credential`, `credential_revoked`, `token_expired` (https://platform.casafari.com/errors/unauthorized, https://platform.casafari.com/errors/invalid-credential, https://platform.casafari.com/errors/credential-revoked, https://platform.casafari.com/errors/token-expired)
- `402`: `payment_required` (https://platform.casafari.com/errors/payment-required)
- `403`: `insufficient_scope`, `not_entitled`, `account_suspended` (https://platform.casafari.com/errors/insufficient-scope, https://platform.casafari.com/errors/not-entitled, https://platform.casafari.com/errors/account-suspended)
- `404`: `not_found` (https://platform.casafari.com/errors/not-found)
- `405`: `method_not_allowed` (https://platform.casafari.com/errors/method-not-allowed)
- `409`: `conflict` (https://platform.casafari.com/errors/conflict)
- `413`: `payload_too_large` (https://platform.casafari.com/errors/payload-too-large)
- `415`: `unsupported_media_type` (https://platform.casafari.com/errors/unsupported-media-type)
- `422`: `validation_failed` (https://platform.casafari.com/errors/validation-failed)
- `429`: `rate_limited`, `daily_limit_reached`, `request_limit_reached`, `usage_limit_reached` (https://platform.casafari.com/errors/rate-limited, https://platform.casafari.com/errors/daily-limit-reached, https://platform.casafari.com/errors/request-limit-reached, https://platform.casafari.com/errors/usage-limit-reached)
- `500`: `internal_error` (https://platform.casafari.com/errors/internal-error)
- `502`: `upstream_error` (https://platform.casafari.com/errors/upstream-error)
- `503`: `capacity_exhausted`, `unavailable` (https://platform.casafari.com/errors/capacity-exhausted, https://platform.casafari.com/errors/unavailable)
- `504`: `upstream_timeout` (https://platform.casafari.com/errors/upstream-timeout)

## Related pages

- [Market analysis of an area (POST /v1/area-insights/analysis)](/docs/rest/area-insights/market-analysis-of-an-area)
- [Property type distribution in an area (POST /v1/area-insights/distributions/properties)](/docs/rest/area-insights/property-type-distribution-in-an-area)
- [Price distribution in an area (POST /v1/area-insights/distributions/prices)](/docs/rest/area-insights/price-distribution-in-an-area)
- [Bedrooms distribution in an area (POST /v1/area-insights/distributions/bedrooms)](/docs/rest/area-insights/bedrooms-distribution-in-an-area)
- [Area Insights REST API: all operations](/docs/rest/area-insights)
- [How to get a bearer token for the Casafari REST API](/docs/rest)
- [MCP vs REST API compared](/docs/parity)
