By the end of this tutorial you will have a Python script that extracts second-hand listings from blocket.se into structured rows: title, price in SEK, location, seller type, shipping availability, memory size, brand, and photos.
Blocket is Sweden's marketplace for used goods, electronics, furniture, and vehicles. Blocket Scraper (reventadata/blocket-scraper) is the Apify Actor built to search its Torget marketplace and return clean listing rows without running a browser.
This guide runs the Actor from Python using the official Apify API client. The sample rows and results below come from a live run searching for second-hand iPhones across Sweden, not from invented data. ⏱️ This tutorial takes about 10 minutes to complete.
Prerequisites
You need three quick prerequisites:
- Python 3.11 or newer installed on your machine.
- A free Apify account, which you can register using an email address or your GitHub account.
- Your personal Apify API token, found under Settings > API & Integrations in Apify Console.
Install the Apify client and export your token:
pip install -U "apify-client~=3.0"
export APIFY_API_TOKEN="your_apify_token_here"
No local browser setup or custom scraping infrastructure is needed. The Actor handles the collection for you.
What you'll achieve
You will configure and run a search on blocket.se from Python, pull the results into structured dictionaries, and inspect key marketplace attributes including price, seller category, and whether an item can be shipped.
You will see how to distinguish private individuals from company sellers (such as Blocket Nybegagnat), how to filter listings by county and price, and how to read coordinates when available. You will also see how the Actor handles listings with missing fields without failing the run.
The resulting script can be plugged into a price comparison workflow, automated alerts for newly posted electronics, or market research pipelines tracking Swedish second-hand goods. Only the search input needs to change.
Step 1: Open Blocket Scraper
Open the Blocket Scraper page on Apify Store. The Try for free button opens the Actor in Apify Console. For running it from Python via the API, you only need its technical identifier, reventadata/blocket-scraper.
Step 2: Configure your search
The search is configured with a concise set of input parameters:
-
searchQueries: a list of search terms, such as["iphone"]. Each term is searched in turn across Torget. -
category: optional top-level category slug, such aselectronics,furniture-interior, orclothes-cosmetics. Default isany. Any unsupported value is refused before the run starts. -
location: optional county slug covering Sweden's 21 counties (such asstockholm,skane, orvastra-gotaland). Default isany. Unsupported county values are refused before the run starts. -
sellers:any(default),privatefor private sellers only, orcompanyfor companies carrying the site's 'Företag' label. -
tradeType:sell(default, Säljes),giveaway(Bortskänkes),wanted(Köpes), orany. -
minPriceandmaxPrice: inclusive price bounds in SEK applied by the site. IfminPriceis set higher thanmaxPrice, the Actor refuses the input before starting. -
shippingOnly: boolean flag. When set totrue, the Actor keeps only listings offering shipping (Kan skickas). -
excludeForParts: boolean flag. Drops ads whose title indicates spare parts or account lockouts (Reservdel...oriCloud-låst). -
requireKeywordMatch: boolean flag (defaulttrue). Ensures each search word appears in the ad title or brand. -
maxItems: maximum total rows across all search terms (default 100). -
maxPages: maximum result pages per search term (1 to 50, default 50).
To search Stockholm for private smartphone ads offering shipping with a price ceiling, your input would look like this:
{
"searchQueries": ["iphone"],
"category": "electronics",
"location": "stockholm",
"sellers": "private",
"tradeType": "sell",
"minPrice": 1000,
"maxPrice": 8000,
"shippingOnly": true,
"maxItems": 20,
"maxPages": 2
}
Step 3: Run the Actor from Python
This complete script initialises the Apify client, starts reventadata/blocket-scraper with a search for second-hand iPhones, waits for completion, and prints a formatted summary row for each result:
import os
from apify_client import ApifyClient
# 1. Initialise the client with your token from the environment
client = ApifyClient(os.environ["APIFY_API_TOKEN"])
# 2. Describe the search: second-hand iPhones on Blocket
run_input = {
"searchQueries": ["iphone"],
"maxItems": 10,
"maxPages": 1,
}
# 3. Start the Actor and wait for it to finish
run = client.actor("reventadata/blocket-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. Read the rows from the run's default dataset
items = client.dataset(run.default_dataset_id).list_items().items
print(f"Retrieved {len(items)} listings.\n")
# 5. Print a summary line per listing
for item in items:
price = item.get("price")
currency = item.get("currency")
price_str = f"{price} {currency}" if price is not None else "no price"
seller = "Private" if item.get("isPrivate") else ("Company" if item.get("isRetailer") else "Unknown")
shipping = "shipping" if item.get("shippingAvailable") else "pickup only"
print(f"{item.get('title')} | {price_str} | {item.get('location')} | {seller} | {shipping}")
The Actor walks results one page at a time (53 items per page). Keep maxPages small during initial testing.
Step 4: Read the output
Running the script with maxItems: 10 prints ten lines; here are the first four lines from our live capture:
Apple iPhone 15 Pro Max 256 GB | 6000 SEK | Skövde | Private | pickup only
iPhone 14 Pro max som ny ingen skada med laddare | 4200 SEK | Trelleborg | Private | shipping
Apple iPhone 7 plus 64 GB | 750 SEK | Göteborg | Private | shipping
Apple iPhone 11 Pro Max 256 GB | 1500 SEK | Saltsjö-Boo | Private | pickup only
Notice the variations: prices range from 750 SEK for an older iPhone 7 Plus up to 6,000 SEK for recent Pro Max devices. Some sellers offer integrated parcel shipping, while others specify local pickup only.
Understanding your results
Every item saved by Blocket Scraper contains 23 structured fields. The most important fields for data analysis include:
-
idandurl: the unique listing identifier and canonical listing URL on blocket.se. -
titleandprice: the ad heading and numeric asking price in SEK. -
location,latitude,longitude: town or municipality, and geographic coordinates when provided. -
isPrivateandisRetailer: boolean seller classification. Commercial dealers also carry their shop name inorganisationName. -
shippingAvailable,sellerPaysShipping, andbuyNow: flags showing whether shipping or direct checkout is supported. -
brandandmemorySize: parsed device attributes when present (such asAppleand256 GB). -
labels: Swedish badge strings directly from the listing, such asPrivat,Kan skickas, andGratis frakt.
Here is one complete listing row copied verbatim from our test run (imageUrls cut to its first entry):
{
"id": "28290815",
"title": "Apple iPhone 15 Pro Max 256 GB",
"url": "https://www.blocket.se/recommerce/forsale/item/28290815",
"price": 6000,
"currency": "SEK",
"location": "Skövde",
"postedAt": "2026-11-15T20:44:50+00:00",
"latitude": 58.38545,
"longitude": 13.84409,
"imageUrls": [
"https://images.blocketcdn.se/dynamic/default/item/28290815/086cef5e-ec3a-4ab6-8af3-06cf800f69dc"
],
"isPrivate": true,
"isRetailer": false,
"shippingAvailable": false,
"sellerPaysShipping": false,
"buyNow": false,
"labels": [
"Privat"
],
"brand": "Apple",
"memorySize": "256 GB",
"organisationName": null,
"tradeType": "Säljes",
"matchedKeyword": "iphone",
"site": "SE",
"scrapedAt": "2026-11-15T21:03:25.576850+00:00"
}
Pro tips and advanced usage
Here are several recommendations for running production extractions on Blocket:
- Narrow broad searches with price or county filters. Blocket limits search listings to 50 pages (at 53 items per page, a maximum of 2,650 ads per search). When scraping large categories, partition your queries by county or price brackets rather than relying on one query.
-
Filter out damaged gear. Turn on
excludeForParts: trueif you only want functional devices. This drops listings with titles mentioning spare parts or account lockouts. -
Use keyword matching. The
requireKeywordMatchsetting (enabled by default) requires every query word to appear in the listing title or brand, filtering out accessory listings that merely mention the query in their body text. -
Separate commercial from private ads. Filter downstream or set
sellers: "company"to study company sellers, orsellers: "private"to monitor peer-to-peer listings. -
Deduplication is automatic across terms. If you provide multiple terms in
searchQueries, listings returned under multiple terms are saved only once.
Troubleshooting common issues
-
Zero rows, status SUCCEEDED: The query matched no active listings, or your combination of category, county, and price filters was too restrictive (
0 results: page(s) loaded normally, but nothing matched). Verify your search terms directly on blocket.se. -
Zero rows, status FAILED: The Actor was supplied with an invalid input (such as an empty
searchQueriesarray, an unrecognized category or county slug, or aminPricegreater thanmaxPrice), or pages could not be read if the site refused the run. The status message specifies what happened. -
Fewer rows than expected: Check the run logs using
client.log(run.id).get(). The log records skipped items per filter, such as ads dropped for lacking query keywords or ads lacking shipping (duplicate listings across terms are skipped silently).
Blocket's terms of use govern automated collection, so ensure your data collection and processing comply with applicable terms and privacy laws.
Next steps
For current pricing and details, see the Store page.
To automate recurring searches, configure an Apify schedule to trigger the Actor at set intervals. Extracted datasets can be downloaded as JSON, CSV, Excel, XML, or NDJSON (dataset documentation). You can also attach an Apify webhook to receive alerts whenever new listings are extracted.
What second-hand items are you planning to track on Blocket? Let us know in the comments! 💬
About the author: reventadata builds and publishes data extraction Actors on the Apify Store.
Top comments (0)