get_price_spread
EXPERIMENTAL (beta): may change or be withdrawn; no critical workflows on it. Asking-vs-transaction price spread for a Polish city or county: how far the median asking price per m² of apartments for sale sits above (or below) the median apartment transaction price per m² (RCN). spread_pct = (asking − transaction) / transaction × 100; it can be NEGATIVE in premium-secondary cities (a valid answer). Different sources, so an approximation; not comparable across cities with different as_of dates. Both sides need at least 5 samples or the result is suppressed. marketType 'all' (default) = whole market; 'secondary' or 'primary' narrows both sides to that segment. Coverage: counties (miasta na prawach powiatu) plus Warszawa's 18 districts, only cities with asking-sale data. A gmina name resolves to its county (shown in the answer); a name shared by gminas in several counties returns candidates. Aggregates exclude fractional shares and non-market deeds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| teryt | No | TERYT: 4 digits = county (1465 = Warszawa); 6 digits = a Warszawa district (146510 = Śródmieście); other longer codes truncate to the county. Wins over location. | |
| location | No | County-level city name (a miasto na prawach powiatu or a catalog entry, e.g. 'Warszawa', 'Gdańsk'); a Warszawa district ('Mokotów') narrows to it, 'Kraków-Podgórze' resolves to its parent county; an osiedle 404s - use teryt. This OR teryt. | |
| areaBucket | No | Apartment area range in m², restricting both sides (all = whole stock, default). Buckets are not additive. | |
| marketType | No | Transaction-side segment: 'all' (default, matched to mixed sale offers), 'secondary' or 'primary'. |