# Hemnet Slutpriser Pro — Swedish Sold Prices & Market Analytics (`vhsgreed/hemnet-slutpriser`) Actor

Swedish sold prices (slutpriser) plus the analytics layer Hemnet does not publish: area x month median/p25/p75 kr/m2, sale-to-asking ratio, days on market, comparables, mäklare league tables and BRF org numbers.

- **URL**: https://apify.com/vhsgreed/hemnet-slutpriser.md
- **Developed by:** [Karl Sundström](https://apify.com/vhsgreed) (community)
- **Categories:** Real estate
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.90 / 1,000 sold property / listing records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Hemnet Slutpriser Pro — Swedish Sold Prices & Market Analytics

Apify actor `vhsgreed/hemnet-slutpriser`. **Swedish property sold prices (slutpriser) plus the market
analytics layer Hemnet does not publish.** Slutpris (final price), utgångspris (asking price), kr/m²,
boarea, avgift, BRF organisationsnummer — and, on top, the derived statistics a buyer cannot read off
the source: area × month medians and percentiles, sale-to-asking ratios, days on market, comparables,
and mäklare league tables.

Most Hemnet scrapers return **asking prices** because that is what listing pages lead with. The data
buyers actually pay for is the **slutpris** — what the home sold for, and whether it went above or
below asking — plus the area-level statistics nobody publishes.

***

### What can a buyer NOT get by going to Hemnet themselves?

Hemnet shows one sold price at a time; it does not hand you a dataset, per-area statistics, a
comparables engine, or change monitoring. This actor computes:

1. **Area × month aggregates** — `median_price_per_sqm_sek`, `p25_`, `p75_`, `sale_count`, and the
   median `sale_to_asking_ratio` per area per month. Nobody publishes sale-to-asking by area.
2. **Sale-to-asking ratio** — final ÷ asking, per record and per area × month.
3. **Days on market** — matched listing → sale (built from listings you capture, plus the run
   watermark across scheduled runs).
4. **Per-record derived** — `price_per_sqm_derived`, `asking_vs_area_median_pct_derived`,
   `price_per_sqm_percentile`.
5. **Comparables engine** — the N most similar sold objects by area/size/rooms, each with its
   price/m² percentile.
6. **Mäklare league tables** — per area × broker/agency: volume, median sale-to-asking, median
   days-on-market.
7. **BRF key + fee history** — `brf_org_number` is always exposed as a join key, and a **BRF fee
   history** is reconstructed from our own accumulating sales over time. Note: the optional
   Bolagsverket *financials* lookup is **best-effort and usually returns null** — in testing, 0 of 6
   real BRF numbers had a digitally filed report in that corpus, because Sweden's digital-filing duty
   covers aktiebolag rather than bostadsrättsföreningar. The fee history does not depend on it.
8. **Incremental monitor mode** — a KV watermark emits `change_type` / `field` / `old_value` /
   `new_value` events so the actor can be scheduled instead of re-pulled.

***

### Output

One dataset, several `record_type`s:

| `record_type` | What it is |
|---|---|
| `sold` | A completed sale (slutpris). The flagship rows. |
| `listing` | An active/upcoming "till salu" object (only if `includeListings` is on). |
| `area_aggregate` | Area × month median/p25/p75 kr/m², sale-to-asking, days on market. |
| `change` | Incremental change event vs the run watermark. |
| `broker_league` | Mäklare league row per area × broker/agency. |
| `brf_fee_history` | Fee (avgift) series per BRF, built from our own sales. |
| `brf_financials` | (optional, best-effort) Bolagsverket figures per BRF — usually absent. |

#### Key sold fields

`record_type`, `hemnet_id`, `listing_id`, `slug`, `url`, `street_address`, `location_description`,
`area`, `municipality`, `zipcode`, `housing_form`, `tenure`, `asking_price_sek` *(utgångspris)*,
`asking_price_formatted`, `final_price_sek` *(slutpris)*, `final_price_formatted`, `price_change_pct`,
`price_per_sqm_sek` *(kr/m²)*, `price_per_sqm_derived`, `asking_vs_area_median_pct_derived`,
`living_area_sqm` *(boarea)*, `land_area_sqm`, `rooms`, `fee_sek_month` *(avgift)*, `build_year`,
`sold_at`, `days_on_market`, `price_per_sqm_percentile`, `comparables[]`, `brf_name`,
`brf_org_number` *(`NNNNNN-NNNN`)*, `broker_agency`, `coordinates`, `features[]`, plus
`source` / `source_url` / `fetched_at` / `actor_version` on every record.

***

### Input (highlights)

| Input | Prefill | Notes |
|---|---|---|
| `locationIds` | `["18028"]` | Numeric Hemnet location ids. `18028` = Solna kommun. |
| `maxRecords` | `25` | Hard cap on delivered property records. |
| `pagesPerLocation` | `1` | Pages per location (50/page). `0` = walk to the ~2,500 ceiling. |
| `includeListings` | `false` | Also return active listings. |
| `enrichBrfFinancials` | `false` | Best-effort Bolagsverket BRF financials probe — usually null (see above). |
| `fetchDetailPages` | `true` | Adds boarea, avgift, byggår, exact kr/m² and `brf_org_number`. |
| `includeBrokerContact` | `false` | Mäklare name/email/phone — PII, off by default. |
| `onlyNewSince` | *(empty)* | Incremental mode; do not set in the default run. |
| `proxyConfiguration` | direct | Swedish residential proxies help for high-volume runs. |

#### Important: slice your area finely

An anonymous Hemnet sold search returns at most ~**2,500 results per query** (50/page; page 50 works,
page 100 is empty). To cover a whole region, pass municipalities or districts as separate
`locationIds` entries. Sub-area slices **must be numeric ids** — slug paths like
`/salda/<stadsdel>` return 404.

***

### Pricing (pay-per-event)

- **`actor-start`** — `$0.01`, charged **once**, only after the first validated record (a failed or
  empty run is never charged).
- **`sold-property`** — `$0.0025` per delivered property record.

Leading competitor `haketa/hemnet-scraper` publishes **$0.004/result**; we sit **below** it on the
per-result event. Two cheaper rivals exist (`memo23` at $0.0015, `ahmed_jasarevic` ~$0.0012), so we are
*not* the cheapest — the differentiation is the sold-field depth plus the analytics layer. Derived
rows (aggregates, league tables, change events, BRF rows) are not charged.

Example: 1,000 sold records ≈ `$0.01 + 1000 × $0.0025 = $2.51`.

***

### Use cases

- **Mäklare** building a comparative-market analysis (jämförelseobjekt) for a valuation or pitch.
- **Valuers / AVM teams** needing an index-ready slutpris time series per area.
- **Property investors** screening yield and price-per-m² trends across municipalities.
- **BRF boards** tracking comparable sales and fee trends in their own area.
- **Analysts & journalists** turning slutpriser into market statistics faster than Svensk Mäklarstatistik.

***

### Responsible use

This actor is a **tool**. It ships no data and does not run itself — whoever operates it chooses how,
and is responsible for that choice.

- **Respect robots.txt, rate limits and Hemnet's terms of service in your own runs.** Hemnet's
  robots.txt disallows only internal paths (`/betalning/*`, `/raketen/*`, `/paket/*`, `/mitt_hemnet/`,
  …); search and listing pages are crawlable — but verify and honour the current text yourself.
- Keep the request delay reasonable (default 500 ms) and do not hammer the site.
- **Do not republish personal data unlawfully.** `includeBrokerContact` is **off by default**; sold
  street addresses can indirectly identify private sellers. See the GDPR note in `PLAN.md`.

No warranty. The source is unofficial and can change at any time; the actor may break, and fixed
prices reflect that risk.

# Actor input Schema

## `locationIds` (type: `array`):

Numeric Hemnet location ids — one entry per search slice. Use numeric ids (e.g. 18028 = Solna kommun); municipality slugs like 'stockholms-kommun' also work, but stadsdel/sub-area slices MUST be numeric ids because slug paths 404 on /salda. Because an anonymous sold search caps at ~2,500 results per query, a large region must be split into municipalities or districts and passed as separate entries.

## `maxRecords` (type: `integer`):

Hard cap on property records delivered across the whole run. 0 = no cap. Each delivered property record is charged one 'sold-property' event.

## `pagesPerLocation` (type: `integer`):

Sold search pages to fetch per location id (50 records per page). 0 = walk to the ~2,500-per-query ceiling. Keep small for a fast, cheap run.

## `includeListings` (type: `boolean`):

Also return active/upcoming listings (no final price). Off by default: the flagship dataset is sold prices (slutpriser). Turning it on doubles the requests and enables days-on-market matching for objects that later appear as sold.

## `enrichBrfFinancials` (type: `boolean`):

BEST-EFFORT and usually returns null: attempts to look up each bostadsrattsforening's annual report in Bolagsverket's public bulk archive by organisationsnummer. In testing, 0 of 6 real BRF numbers had a digitally filed report there (the digital-filing duty covers aktiebolag, not bostadsrattsforeningar), so treat this as an optional probe rather than a dependable enrichment. OFF by default; fails soft per BRF.

## `housingFormGroups` (type: `string`):

Property type filter. Allowed values: ALL (default), APARTMENTS (lägenhet), VILLAS, HOUSES, ROW\_HOUSES (radhus), COTTAGES (fritidshus), PLOTS, OTHER. Anything else is treated as ALL.

## `sort` (type: `string`):

Result ordering. Allowed values: NEWEST (default), OLDEST, PRICE\_DESC, PRICE\_ASC, SQ\_METER\_PRICE\_DESC, SQ\_METER\_PRICE\_ASC.

## `askingPriceMin` (type: `integer`):

Lower bound on asking price, SEK. Leave empty for no bound.

## `askingPriceMax` (type: `integer`):

Upper bound on asking price, SEK. Leave empty for no bound.

## `roomsMin` (type: `integer`):

Minimum rooms (Hemnet counts kitchen/living room). Leave empty for no bound.

## `roomsMax` (type: `integer`):

Maximum rooms (Hemnet counts kitchen/living room). Leave empty for no bound.

## `onlyNewSince` (type: `string`):

ISO date (YYYY-MM-DD). In incremental/monitor mode, keep only sold records with sold\_at on or after this date; change events are computed against the run watermark regardless. Leave empty for a full pull. DO NOT set this in the prefilled/default run — a narrow window can yield an empty dataset.

## `comparablesCount` (type: `integer`):

How many similar sold comparables to attach per sold record (matched by area/size/rooms, with a price/m² percentile).

## `emitAggregates` (type: `boolean`):

Emit area x month aggregates (median/p25/p75 price per m², sale-to-asking ratio, days on market) and per-record derived ratios.

## `computeComparables` (type: `boolean`):

Attach a comparables array and price-per-m² percentile to each sold record.

## `emitLeagueTables` (type: `boolean`):

Emit per-area broker/agency league rows (volume, median sale-to-asking, median days on market) and BRF fee history reconstructed from our own sales.

## `fetchDetailPages` (type: `boolean`):

Follow each sold card's detail page to add boarea, avgift, byggår, exact kr/m², tenure and the BRF organisationsnummer (the tier-3 join key). Costs one extra request per record; keep on to expose brf\_org\_number.

## `includeBrokerContact` (type: `boolean`):

Off by default to minimise personal-data footprint (GDPR): these are professional contact details, but the default ships without them.

## `includeImages` (type: `boolean`):

Off by default. Image URLs (bilder.hemnet.se) are omitted unless requested.

## `brfMaxArchives` (type: `integer`):

When enrichBrfFinancials is on, how many weekly archives (newest first) to scan per BRF before giving up. Keeps the optional join bounded.

## `brfMaxOrgs` (type: `integer`):

When enrichBrfFinancials is on, cap how many distinct BRF organisationsnummer are resolved per run.

## `requestDelayMs` (type: `integer`):

Politeness delay between requests. Keep >= 300 ms.

## `proxyConfiguration` (type: `object`):

Optional. Hemnet sits behind Cloudflare Bot Management; the actor sends a full browser client-hint header set and escalates to a Chrome-TLS client when challenged. Swedish residential proxies are the most reliable for sustained high-volume runs; direct often works for small runs.

## Actor input object example

```json
{
  "locationIds": [
    "18028"
  ],
  "maxRecords": 25,
  "pagesPerLocation": 1,
  "includeListings": false,
  "enrichBrfFinancials": false,
  "housingFormGroups": "ALL",
  "sort": "NEWEST",
  "askingPriceMin": null,
  "askingPriceMax": null,
  "roomsMin": null,
  "roomsMax": null,
  "onlyNewSince": null,
  "comparablesCount": 8,
  "emitAggregates": true,
  "computeComparables": true,
  "emitLeagueTables": true,
  "fetchDetailPages": true,
  "includeBrokerContact": false,
  "includeImages": false,
  "brfMaxArchives": 12,
  "brfMaxOrgs": 10,
  "requestDelayMs": 500,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset of sold/listing property records plus area aggregates, broker league tables, change events and BRF fee history.

## `resultsJson` (type: `string`):

Full dataset items as raw JSON, including comparables, derived ratios and provenance.

## `runStats` (type: `string`):

Run counters written to the default key-value store under OUTPUT\_STATS: records per type, aggregates, change events, joins, fetch errors.

## `runView` (type: `string`):

Inspect this run, its logs and storages in Apify Console.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "locationIds": [
        "18028"
    ],
    "maxRecords": 25,
    "pagesPerLocation": 1,
    "includeListings": false,
    "enrichBrfFinancials": false,
    "fetchDetailPages": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("vhsgreed/hemnet-slutpriser").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "locationIds": ["18028"],
    "maxRecords": 25,
    "pagesPerLocation": 1,
    "includeListings": False,
    "enrichBrfFinancials": False,
    "fetchDetailPages": True,
}

# Run the Actor and wait for it to finish
run = client.actor("vhsgreed/hemnet-slutpriser").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "locationIds": [
    "18028"
  ],
  "maxRecords": 25,
  "pagesPerLocation": 1,
  "includeListings": false,
  "enrichBrfFinancials": false,
  "fetchDetailPages": true
}' |
apify call vhsgreed/hemnet-slutpriser --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vhsgreed/hemnet-slutpriser"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Mb3ViO9LRpxIAOm1d/builds/bd5mk8gPUn2lb8hGe/openapi.json
