Hemnet is a Swedish property site that lists homes for sale and homes already sold, with their final price. If you want those homes as rows you can sort in a spreadsheet, a short Python script can collect them for you. This tutorial shows you how to call the Hemnet Scraper Actor (reventadata/hemnet-scraper) with the official apify-client package, wait for the run to finish, and print one block per home. Each home comes back as a JSON row with the asking price in SEK, the rooms, the living area, the broker and the coordinates.
You do not write any scraping code. The Actor reads the public search pages, so no login is needed.
Prerequisites
You need Python 3 and a free Apify account. Copy your Apify API token from your account, then install the client and set the token as an environment variable:
pip install -U "apify-client~=3.0"
export APIFY_API_TOKEN="your_apify_token_here"
Nothing else is required. The script below uses only the client and the standard library.
What you'll achieve
At the end of this tutorial you will have a script that asks Hemnet Scraper for villas for sale in Stockholms län and prints each home's price, living area, rooms and address. The run also saves the same rows to an Apify dataset, so you can download them as JSON, CSV or Excel. A typical use is comparing asking prices in one municipality with the prices of the homes that sold there. The search covers the whole county, Stockholms län, not just one town. Each row also carries the housing form, the coordinates, the labels the listing shows and the time it was published, so the dataset holds more than the script prints.
Step 1: Find 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 that name, so the script below works without any other setup.
Step 2: Set the input
The Actor takes these 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, with their final price. |
locations |
array | Required. Each entry is a numeric Hemnet 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.
Step 3: Run the Actor
Save the script as a .py file and run it with python. The call waits until the run finishes, then reads the dataset.
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: Read 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 results
askingPrice is the asking price in SEK. When the listing shows the price as "on request", priceOnRequest is true and the price is empty, and 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 is the living area, and supplementalAreaM2 is any extra area the listing counts. plotAreaM2 is the plot. housingForm is the housing type in Swedish, with its code in housingFormCode.
For a home for sale, publishedAt, isUpcoming, isNewConstruction and projectId describe the listing. For a sold home, finalPrice, priceChangePercent, soldAt and soldAtLabel hold the sale, and priceChangePercent is the final price against the asking price, in percent. The broker and the brokerage names are in the rows because the site shows them. isNewConstruction is true for a new build, as the site marks it, and searchLocationId is the location id the search used for the home.
Pro tips
Keep maxItems small on the first run, as in the example. Put several entries in locations to run one search per place in the same run. A home that appears in two searches is saved once. For a large area, search by municipality or district, or split the search with maxPrice, because one search returns at most 2,500 homes, which is 50 pages of 50.
Check housingForm on each row when you use the villa filter. In the five saved rows of the example run, three are listed as winterised holiday homes, so the filter does not always return what the name suggests. Filter the rows again on housingForm if you need only one type.
Use searchType set to sold to read the final prices of homes that have already sold, and run the same location with forSale to set the two side by side. Keep the searchLocationId column, so you know which search found each home.
Troubleshooting common issues
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, for example stockholms-lan, or use the numeric location id instead. An entry that is neither a number, a slug nor a hemnet.se search link also stops the run before any search starts.
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.
Next steps
Once the script works, put it on a schedule, load the homes into a database or a spreadsheet, and track one municipality over several weeks. Read the sold side of the same area to see how the asking prices compare with the final prices. The Apify documentation at https://docs.apify.com explains schedules and dataset exports.
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.
Which Swedish area would you compare first? Tell us in the comments.
Top comments (0)