Complete Guide: How to Scrape Swedish Homes Using Hemnet Scraper
Run the Hemnet Scraper Apify Actor from Python to pull Swedish homes for sale or sold, with prices, areas and brokers, into JSON rows.

This guide shows you how to collect home listings from Hemnet, the Swedish property site that lists homes for sale and homes already sold. You will call the Hemnet Scraper Actor (reventadata/hemnet-scraper) from Python with the official apify-client package, wait for the run to finish, and read the homes back as rows. Each row holds the asking price in SEK, the rooms, the living area, the address, the coordinates and the broker. The sample rows below come from a run on 2026-11-26, so their values are a snapshot of that day. You need no browser, and the scraping runs on Apify while your machine only starts the run and reads the rows back. The guide walks through the input, the run, the fields you will read and the places where a run can stop, in that order. The example uses Stockholms län, the county with the location id 17744, and ten homes.
TL;DR
In this tutorial, you'll learn to start the Apify Actor reventadata/hemnet-scraper from Python, set the place, the housing type and the maximum price, and read the returned dataset. Set locations to a Hemnet location id or a place slug, keep maxItems small for the first run, call the Actor with call(), then read list_items(). The result is one JSON row per home, ready for a spreadsheet or a database.
Prerequisites and setup
You need Python 3, a free Apify account and your Apify API token. Copy the API token from your account. Install the client, and store the token in an environment variable so it never appears in the script:
pip install -U "apify-client~=3.0"
export APIFY_API_TOKEN="your_apify_token_here"
Check the Python version with python --version before you install the client. The token is read from the environment at run time, so a script you share contains no secret. The script below uses the client and the standard library only, so nothing else needs installing.
Understanding Hemnet Scraper
Hemnet Scraper reads the public search pages of hemnet.se. You give it one or more places, choose homes for sale or homes sold, and optionally set a housing type and a maximum price. For each home on the result pages, it saves one row with the address, the area, the housing form, the asking price, the monthly fee, the rooms, the living and plot areas, the coordinates, the broker and the brokerage, the labels and the thumbnails.
For a sold home, the row carries the sale date, the final price and the change against the asking price. For a home for sale, it carries the publishing time and whether the home is new construction. The Actor does not need a login, and the rows hold only the public data the pages show.
Each search returns at most 2,500 homes, which is 50 pages of 50. For a larger area, search by municipality or district, or split the search with a maximum price band.
Step-by-step guide
Step 1: Accessing the Actor
Open the Actor's page in the Apify Store at reventadata/hemnet-scraper. The page lists the input fields and an example of the output. The Python client calls the same Actor by its full name, so you do not need to open the Console to run the script.
Step 2: Configuring the input
The Actor takes these input fields. Only locations is required, and maxItems keeps a first run small:
| Field | Type | What it does |
|---|---|---|
searchType |
string | forSale (default) for homes on sale, or sold for homes already sold. |
locations |
array | Required. A numeric location id such as 17744 for Stockholms län, a place slug as written in hemnet.se links such as stockholms-lan or malmo-kommun, or a pasted hemnet.se search link. One search runs per entry. |
housingType |
string | any (default), villa for houses or bostadsratt for apartments. |
maxPrice |
integer | Optional maximum asking price in SEK. |
maxItems |
integer | Stop after this many homes are saved. |
The script below uses the input of the example run: villas for sale in Stockholms län, ten homes. Once you know the fields, add maxPrice or a second place to the same dictionary.
Step 3: Running the Actor
Save the script as a .py file and run it with python. The call starts the run and waits until it finishes. Then it reads the default dataset of that run.
import os
from apify_client import ApifyClient
# 1. Initialize ApifyClient with the token from the environment
client = ApifyClient(os.environ["APIFY_API_TOKEN"])
# 2. Define the input: villas for sale in Stockholms län, ten homes
run_input = {
"searchType": "forSale",
"locations": ["17744"],
"housingType": "villa",
"maxItems": 10,
}
# 3. Start the Actor run and wait for it to complete
run = client.actor("reventadata/hemnet-scraper").call(run_input=run_input)
if run is None or run.status != "SUCCEEDED":
status = run.status if run else "unknown"
raise SystemExit(f"Run did not succeed (status: {status}).")
# 4. Fetch the resulting dataset items
items = client.dataset(run.default_dataset_id).list_items().items
print(f"Retrieved {len(items)} homes.\n")
# 5. Print the fields you need
for item in items:
print(item.get("askingPrice"), item.get("currency"), item.get("livingAreaM2"), "m2", item.get("rooms"), "rooms")
print(f" {item.get('address')}, {item.get('locationDescription')}")
print(f" {item.get('url')}")
print("-" * 50)
While the run is active, the Actor saves each home to the run's default dataset. If the script stops, the run keeps going on Apify's side, and its dataset stays available for later reads.
Step 4: Examining the results
Each dataset item is one home. This is the first item of the example run. The description, the image and logo links, the record type and the empty fields are left out of the excerpt:
{
"id": "21771283",
"url": "https://www.hemnet.se/bostad/villa-7rum-fredsborg-osterakers-kommun-fredsborgsvagen-4-21771283",
"searchType": "forSale",
"address": "Fredsborgsvägen 4",
"locationDescription": "Fredsborg, Österåkers kommun",
"housingForm": "Villa",
"housingFormCode": "HOUSE",
"askingPrice": 8795000,
"priceOnRequest": false,
"priceFrom": false,
"currency": "SEK",
"rooms": 7,
"livingAreaM2": 194,
"plotAreaM2": 1290,
"latitude": 59.4782075,
"longitude": 18.2537886,
"labels": ["Sön 29 nov kl 13:00", "Max", "Balkong", "Uteplats", "Energieffektiv"],
"brokerName": "Simon Palmqvist",
"agencyName": "SkandiaMäklarna Österåker/Vaxholm",
"publishedAt": "2026-11-26T06:06:43Z",
"isUpcoming": false,
"isNewConstruction": false,
"showings": ["Sön 29 nov kl 13:00"],
"searchLocationId": "17744",
"scrapedAt": "2026-11-26T09:31:21Z"
}
The script prints a shorter form of the same values. Export the full dataset from the Apify Console as JSON, CSV or Excel when you want every column.
Understanding your data
askingPrice is the asking price in SEK. When the listing shows the price as "on request", priceOnRequest is true and the price is empty. priceFrom is true when the price is a starting price. monthlyFee and pricePerSquareMeter are in SEK, when the listing shows them.
rooms is the number of rooms, livingAreaM2 the living area and supplementalAreaM2 any extra area the listing counts. plotAreaM2 is the plot. housingForm is the housing type as the listing names it, and housingFormCode is the site's code for it.
For a sold home, finalPrice, priceChangePercent, soldAt and soldAtLabel hold the sale. priceChangePercent is the final price against the asking price, in percent. For a home for sale, publishedAt, isUpcoming, isNewConstruction and projectId describe the listing. searchLocationId is the location the search used to find the home, and scrapedAt is the time the row was saved. locationDescription names the place the home is in, which is the field to check for homes from neighbouring areas.
Working with the API
The Python client is a thin wrapper over the Apify API. client.actor(...).call(run_input=...) starts the run and returns once it has finished, with the run object. Its status tells you whether the run succeeded, and default_dataset_id tells you where the rows are. client.dataset(...).list_items() returns the rows of that dataset, and .items is the list the script prints.
Each field in run_input is a key of the Actor's input schema. The spelling must match the table in the setup section, because JSON keys are case-sensitive. The first call waits for the run to finish, so the script returns only after the run is over. The example stops on any status other than SUCCEEDED, so a failed run never reaches the dataset step and never looks like an empty result to the script.
The client returns each row as a plain Python dictionary, so the same code can write the rows to JSON, CSV or a database. Read the rows with .get() for the fields that can be empty, such as finalPrice on a home for sale. Check each value against the table before you schedule a run, because a scheduled run repeats the same input every time. Keep the token in an environment variable, never in a file you share.
Advanced usage patterns
Several places can share one run. Put more than one entry in locations, and the Actor runs one search per entry. A home that appears in two searches is saved once, so the dataset holds one row per home, and searchLocationId shows which search found it.
For a sold-price comparison, run the same location twice, once with searchType set to forSale and once with sold. Keep the two datasets apart, and compare the asking price of the homes for sale with the final prices of the homes already sold.
For scheduled runs, set maxPrice and housingType in the input, so the search stays the same from one run to the next. Compare runs by id, and keep scrapedAt with each row, so you know when the price you read was current. Hemnet adds homes from neighbouring areas after the exact matches, and locationDescription shows where each one is, so filter on it if you want only the named place. Each search has its own searchLocationId, so a row always carries the place it came from. Use a separate dataset for each place when you compare them, and keep the input dictionary with the dataset, so a later reader knows which search produced the rows.
Troubleshooting guide
If the run stops with an error about a place, the slug is not one that Hemnet knows. Copy it from a hemnet.se link, or use the numeric location id instead. An entry that is neither a number, a slug nor a hemnet.se search link stops the run before any search starts, and the error names the entry.
If the script prints "Run did not succeed", open the run in the Apify Console. The run log shows the message that ended it. A search with no matches ends as a successful run with no rows, so an empty result is not always an error.
If a run returns fewer homes than you expect, check the listing count in the run log. A search returns at most 2,500 homes, so a large area needs a municipality or a price band. Filter the rows again on housingForm when you use the villa filter, because the filter does not always return only the type its name suggests.
Best practices
Start with maxItems at 10 and check the fields before you raise the limit. Use a place slug from a real hemnet.se link, because a guessed slug stops the run with an error. Keep one dictionary per search, so each run's input is easy to read back.
Download the rows once a run finishes, because Apify keeps unnamed datasets for a limited period. Read the run log when a run finishes with fewer rows than you expected. Store the id of each home, so you can match rows across runs without duplicates. Run on a schedule that fits your use rather than in a tight loop.
Conclusion and next steps
You now have a script that starts Hemnet Scraper, waits for the run, and prints the homes of one Swedish place as rows. The same fields are in the dataset, where you can export them as JSON, CSV or Excel.
Next, try searchType set to sold to read the final prices of the homes already sold in the same area. The Apify documentation at https://docs.apify.com explains schedules and dataset exports. Try Hemnet Scraper yourself and tell us in the comments which area you would track first.
For current pricing and details, see the Store page.
About the author: reventadata builds and maintains scrapers for public marketplace, job and property sites on the Apify Store.
About the author
- Hi, I'm the engineer behind ReventaData. I build pay-per-event Apify Actors that turn public marketplace, classifieds, jobs and real-estate sites into clean, reliable datasets. Here on Hashnode, I share practical tutorials on collecting structured web data with Python and Apify, and on putting it to work: price tracking, lead lists and market analysis. Explore our turnkey scrapers: https://apify.com/reventadata
Comments
Join the discussionNo comments yet. Be the first to comment.



