DEV Community

Cover image for How to Scrape Tori.fi Second-Hand Listings with Python
ReventaData
ReventaData

Posted on Originally published at apify.com

How to Scrape Tori.fi Second-Hand Listings with Python

By the end of this tutorial you will have a short Python script that pulls second-hand ads from tori.fi into structured rows. Each row carries the ad's title, price in euros, town, posting time, seller type, shipping flag and image links. The example search is for sohva, the Finnish word for sofa.

Tori.fi Scraper (reventadata/tori-scraper) is the Apify Actor built for this site. You give it one or more search terms, and it returns one row per ad. This guide runs it from Python with the Apify API client. The rows in Step 4 come from a sample captured with the input shown in Step 2.

The Actor is unofficial. It is not affiliated with or endorsed by tori.fi or its owner. It reads the public search results that tori.fi shows to every visitor.


Prerequisites

You need three things:

  1. Python 3.11 or newer, which the Apify client for Python requires.
  2. A free Apify account. You can sign up with an email address or a GitHub login.
  3. Your Apify API token.

Install the client and export the token:

pip install -U "apify-client~=3.0"
export APIFY_API_TOKEN="your_apify_token_here"
Enter fullscreen mode Exit fullscreen mode

No tori.fi account is needed, because the Actor reads public pages with no login.


What you'll achieve

You will search tori.fi for sofas and read the results in Python. Each row holds the ad's title and link, its asking price in euros, the district and town, when it was posted, and whether the seller is a private person or a company. The row also carries a shipping flag, the brand where the ad gives one, and the image links.

By default the Actor keeps only ads whose title or brand contains every word of the search term, so loosely related ads drop out. The script prints one line per ad, so you can check the results on screen before you save them.


Step 1: Open the Tori.fi Scraper

Open the Tori.fi Scraper page on Apify Store. This guide calls the Actor from Python, so the detail you need is its name, reventadata/tori-scraper. The Try for free button on that page opens the Actor in Apify Console if you would rather run it by clicking.


Step 2: Choose the search

These input fields set the search:

  • searchQueries: one or more search terms, such as sohva. Required.
  • category: one of the top-level categories, or any for all of tori.fi.
  • location: one of the 19 Finnish regions, or any for the whole country.
  • sellers: any, private or company. The site decides who counts as a company.
  • tradeType: sell (the default, ads for sale), giveaway, wanted or any.
  • minPrice and maxPrice: optional bounds in euros, inclusive and applied by the site.
  • shippingOnly: keeps only ads that offer shipping.
  • requireKeywordMatch: on by default, as described above.
  • maxItems: a cap on the rows saved across all search terms.
  • maxPages: pages per search term, from 1 to 50. The site serves at most 50 pages for one search, which is 2,650 ads, so split a broad search by category, region or price to see more.

The sample input for this guide is:

{
    "searchQueries": ["sohva"],
    "maxItems": 10,
    "maxPages": 1
}
Enter fullscreen mode Exit fullscreen mode

Keep maxPages at 1 while you test. Ads come back in the site's default order; the Actor sends no sort option.


Step 3: Run it from Python

This script starts the Actor, waits for it to finish, reads the dataset and prints one line per ad:

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: one term, a small cap, one page
run_input = {
    "searchQueries": ["sohva"],
    "maxItems": 10,
    "maxPages": 1,
}

# 3. Start the Actor and wait for it to finish
run = client.actor("reventadata/tori-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

# 5. Print one line per ad: title, town, seller type and link
for item in items:
    seller = "private" if item.get("isPrivate") else "company"
    print(f"{item.get('title')} | {item.get('location')} | {seller} | {item.get('url')}")
Enter fullscreen mode Exit fullscreen mode

Step 4: Read the rows

Each ad is one row in the run's dataset. Sample from a capture dated 2026-11-26, copied whole:

[
  {
    "id": "50444835",
    "title": "Pieni sohva",
    "url": "https://www.tori.fi/recommerce/forsale/item/50444835",
    "price": 30,
    "currency": "EUR",
    "location": "Kupittaa, Turku",
    "postedAt": "2026-11-26T09:17:59+00:00",
    "latitude": 60.44645,
    "longitude": 22.30893,
    "imageUrls": [
      "https://img.tori.net/dynamic/default/item/50444835/eb1a77e3-caee-4270-b356-e6105392e46a",
      "https://img.tori.net/dynamic/default/item/50444835/d3cb016a-2c54-41bf-8fb6-b5dfbb925a35"
    ],
    "isPrivate": true,
    "isRetailer": false,
    "shippingAvailable": false,
    "buyNow": false,
    "labels": [
      "Yksityinen"
    ],
    "brand": "Jysk",
    "organisationName": null,
    "tradeType": "Myydään",
    "matchedKeyword": "sohva",
    "site": "FI",
    "scrapedAt": "2026-11-26T09:31:43.231236+00:00"
  },
  {
    "id": "44861912",
    "title": "Sits 3-istuttava sohva rahilla sininen",
    "url": "https://www.tori.fi/recommerce/forsale/item/44861912",
    "price": 630,
    "currency": "EUR",
    "location": "Hämevaara, Vantaa",
    "postedAt": "2026-11-26T09:10:03+00:00",
    "latitude": 60.25902,
    "longitude": 24.81307,
    "imageUrls": [
      "https://img.tori.net/dynamic/default/item/44861912/78cb20cb-dfa8-4031-88c8-9906b7d435c7",
      "https://img.tori.net/dynamic/default/item/44861912/2de62489-d6ec-46f3-9de3-31825d088ff3",
      "https://img.tori.net/dynamic/default/item/44861912/925b8c96-89d5-4563-83ce-2ae83d0eb45c",
      "https://img.tori.net/dynamic/default/item/44861912/7379bdb2-f1a8-417a-9e3b-b9abdd67ccca",
      "https://img.tori.net/dynamic/default/item/44861912/7795d03e-2dad-4ef6-8b50-e7284d5677c7"
    ],
    "isPrivate": false,
    "isRetailer": true,
    "shippingAvailable": false,
    "buyNow": false,
    "labels": [
      "Yritys"
    ],
    "brand": "Sits",
    "organisationName": "Mjuk",
    "tradeType": "Myydään",
    "matchedKeyword": "sohva",
    "site": "FI",
    "scrapedAt": "2026-11-26T09:31:43.388647+00:00"
  }
]
Enter fullscreen mode Exit fullscreen mode

Understanding your results

Each row has the same 21 fields, and the dataset schema describes every one of them. The fields that matter most when you compare ads:

  • price is a number in euros, or null when the ad shows no price.
  • location gives the district and town. latitude and longitude are approximate, and null when the ad carries no position.
  • postedAt is the listing time as an ISO 8601 timestamp in UTC. Every posting time in the sample falls on 26 November 2026.
  • isPrivate and isRetailer are the site's own seller flags. labels holds the site's badges in Finnish: Yksityinen marks a private seller, and Yritys marks a company.
  • organisationName is filled only on company ads. brand is filled only where the ad's category has one.
  • tradeType is the ad type as the site words it. Myydään means for sale.
  • matchedKeyword is the search term that returned the ad. site is FI on every row, and scrapedAt is when the row was saved.

Pro tips

  • Start small. Use one search term, a small maxItems and maxPages at 1 until the rows look right.
  • Split by seller. sellers set to private returns individuals only, and company returns shops only.
  • Let the site filter prices. minPrice and maxPrice are inclusive, and the site applies them, so your script does not have to.
  • Narrow by place or category. A location region or a category keeps a broad term to one part of the market.
  • Key on id. Use the id field to match an ad you saved on an earlier run. The url field opens the same ad on tori.fi.
  • Read the run log. When a run ends without rows, its status message says why, so read it before you change the search.
  • Keep the empty values. A null price is data too. Filter it out in your own script if you do not want it.

Troubleshooting common issues

  • The run ends SUCCEEDED with no rows. A search that matches nothing ends with a status message and an empty dataset. Check the search term, then the filters. A narrow price range or a single region can leave nothing to save.
  • The run ends FAILED with a message about pages. No rows were saved and some result pages could not be read, so matches may have been missed. Run the same input again later.
  • The run ends FAILED with a message about the input. The message names the input problem and says to fix it before you run again.
  • A value is refused before the run starts. category, location, sellers and tradeType accept only their listed values, so a misspelt value is refused before the run starts.
  • Ads look unrelated. Keep requireKeywordMatch on. It drops ads whose title and brand do not contain every word of the search term.

Next steps

Save the rows to a file, or run the same search with sellers set to company and compare shops with private sellers. Run the script on whatever scheduler you already use, and keep id so you can match ads between runs.

Try the Tori.fi Scraper with a search term of your own, and see which ads come back.

For current pricing and details, see the Store page.

Top comments (0)