# Tori.fi Listings Scraper (Finland classifieds) (`stone_jadex/tori-scraper`) Actor

Public Tori.fi classified listings: title, price in EUR, location, images, category, condition, ToriDiili shipping, and detail-page description. $0.001 per listing ($1.00 per 1,000).

- **URL**: https://apify.com/stone_jadex/tori-scraper.md
- **Developed by:** [Stone Jade](https://apify.com/stone_jadex) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.85 / 1,000 listings

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

## Tori.fi Listings Scraper (Finland Classifieds)

Extract structured public classified listings from **Tori.fi** (Finland's largest second-hand marketplace) across search pages, category-filtered URLs, keyword queries, and individual item URLs.

In default list mode, the Actor parses search result cards for titles, EUR asking prices, municipality/area locations, image URLs, condition, brand, ToriDiili shipping indicators, and seller labels. Enable `scrapeDetails` to open each public listing page and enrich every record with full descriptions, postal codes, public coordinates (`lat`/`lon`), full category breadcrumbs, structured item attributes, business shop registration (`Y-tunnus`), and ToriDiili shipping text — at the exact same per-listing price (`listing-detail` replaces `listing`, never added on top).

***

### Key Features & Use Cases

- **Resale & Second-Hand Price Benchmarking**: Monitor EUR asking prices, item conditions (`Uusi`, `Uudenveroinen`, `Hyvä`, `Kohtalainen`), and brand specifications across consumer electronics, smartphones, bicycles, cameras, and home goods.
- **Regional & Municipal Market Analysis**: Group listings by Finnish municipality, district (`area`), region (`Uusimaa`, `Pirkanmaa`, `Varsinais-Suomi`, etc.), postal code, and public coordinates to map regional supply and pricing spreads.
- **ToriDiili & Business Shop Intelligence**: Track `toriDiili` eligibility, `shippingAvailable`, `buyNow`, `freeShipping`, `shippingPriceText`, and verified business seller metadata (`businessName`, Finnish `Y-tunnus` / `businessId`, public shop address, and service highlights).
- **Flexible Discovery Modes**: Start from filtered Tori.fi category/search URLs, plain Finnish or English search keywords (`queries`), or direct `/recommerce/{vertical}/item/{id}` URLs.
- **Deduplicated Output, 4 Dataset Views & Audit Summary**: Deduplicates items by `itemId` within a run, stops automatically after 3 consecutive pages with no new listings, presents 4 tailored Apify Console table views (**Overview**, **Details (detail tier)**, **Seller & shipping**, **All fields**), and writes a full run summary to `OUTPUT` in the default key-value store.
- **Scope-Bounded & Polite Crawling**: Live `robots.txt` is read (Crawl-delay honoured; Disallow hits are logged and counted in `robotsDisallowedHits`), and map, messages, profile, contact, report, account and `sort=` URLs are refused in code.

***

### Input Parameters

Configure the Actor in the Apify Console or send a JSON payload via API/SDK. If both `startUrls` and `queries` are empty, the Actor defaults to `https://www.tori.fi/recommerce/forsale/search?q=iphone`.

| Parameter | Type | Default | Constraints / Notes | Description |
| :--- | :--- | :--- | :--- | :--- |
| `startUrls` | `array` | `[{"url": "https://www.tori.fi/recommerce/forsale/search?q=iphone"}]` (prefill) | Public `/recommerce/{vertical}/search` or `/recommerce/{vertical}/item/{id}` URLs on `www.tori.fi` | Direct search, category-filtered search, or item detail URLs. Category and filter query parameters are preserved; URLs containing `sort=`, `/map`, `/messages`, `/profile`, `/contact`, `/report`, account paths, or internal APIs are rejected. |
| `queries` | `array<string>` | `[]` | Converted to `/recommerce/{vertical}/search?q=...` | Optional search keywords (e.g., `"iphone"`, `"sohva"`, `"polkupyörä"`). No `sort=` parameter is added. |
| `vertical` | `string` | `"forsale"` (prefill: `"forsale"`) | Lowercase slug `[a-z0-9-]+` | Recommerce path segment used with `queries`. `"forsale"` is Tori.fi's public classifieds search vertical. |
| `maxItems` | `integer` | `50` (prefill: `50`) | `1` – `5,000` | Maximum number of unique listings to collect across all start URLs and keyword queries before stopping cleanly. |
| `maxPages` | `integer \| null` | `null` (unlimited) | `1` – `500` when set | Optional per-seed page cap using `page=`. Tori typically exposes up to 50 pages per search; the Actor also stops a seed early after 3 consecutive pages with no new items. |
| `scrapeDetails` | `boolean` | `false` | Same unit price (`listing-detail` replaces `listing`) | Opens each public listing page to add full `description`, `postalCode`, `region`, `lat`/`lon`, `categoryPath`, `attributes`, `updatedAt`, `sellerType`, `businessInfo`, and ToriDiili shipping text. |
| `requestDelayMs` | `integer` | `1500` | `1,500` – `60,000` ms | Minimum pause between HTTP requests (values below `1500` are automatically raised to `1500`; raised further if `robots.txt` sets a longer `Crawl-delay`). |
| `maxRunSeconds` | `integer` | `3600` | `30` – `86,400` s | Maximum run duration. The Actor stops cleanly, saves `OUTPUT`, and emits one uncharged `run-notice` row before exceeding this limit. |
| `proxyConfiguration` | `object` | `{"useApifyProxy": false}` | Standard Apify proxy object | Direct HTTP connection is used by default. Enable Apify Proxy only if needed for your run environment. |
| `useProxyFallback` | `boolean` | `false` | Requires `proxyConfiguration.useApifyProxy: true` | Keeps requests direct until repeated HTTP 403/429 responses occur, then falls back to the configured proxy. |

***

### Input Examples

#### Example 1: Keyword Search with Detail-Page Enrichment

Search two Finnish classifieds keywords in `forsale`, cap at 100 unique listings (up to 5 pages per keyword), and open every listing page for full descriptions, postal codes, coordinates, structured attributes, and shipping text:

```json
{
  "startUrls": [],
  "queries": [
    "sohva",
    "polkupyörä"
  ],
  "vertical": "forsale",
  "maxItems": 100,
  "maxPages": 5,
  "scrapeDetails": true,
  "requestDelayMs": 1500,
  "maxRunSeconds": 1800,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

#### Example 2: Filtered Search URL & Direct Item URLs (Fast List Mode)

Combine a category-filtered Tori.fi search URL with a direct listing URL in fast list mode (direct item seeds always fetch their detail page and charge `listing-detail` at the same price):

```json
{
  "startUrls": [
    {
      "url": "https://www.tori.fi/recommerce/forsale/search?q=iphone"
    },
    {
      "url": "https://www.tori.fi/recommerce/forsale/item/49053126"
    }
  ],
  "maxItems": 250,
  "scrapeDetails": false,
  "requestDelayMs": 1500,
  "maxRunSeconds": 3600,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "useProxyFallback": false
}
```

***

### Output & Dataset Schema

Listings are saved to the **default dataset** with four Apify Console views (**Overview**, **Details (detail tier)**, **Seller & shipping**, and **All fields**), and a complete run audit is written to key `OUTPUT` in the **default key-value store**.

#### Illustrative JSON Output Example

> **Illustrative only:** The JSON objects below use invented example values matching `.actor/dataset_schema.json` to show the exact data shape; they are not captured live listings. Fields absent on a given listing (or detail-only fields when `scrapeDetails` is `false`) appear as `null`.

```json
{
  "itemId": "12345678",
  "url": "https://www.tori.fi/recommerce/forsale/item/12345678",
  "title": "Example used smartphone 64 GB",
  "price": 120,
  "currency": "EUR",
  "priceRaw": "120 €",
  "location": "Helsinki, Example District, Uusimaa",
  "postalCode": "00100",
  "municipality": "Helsinki",
  "area": "Example District",
  "region": "Uusimaa",
  "country": "FI",
  "lat": 60.123456,
  "lon": 24.123456,
  "locationAccuracy": 5,
  "images": [
    "https://img.tori.net/dynamic/default/item/12345678/example-image"
  ],
  "imageCount": 1,
  "thumbnail": "https://img.tori.net/dynamic/default/item/12345678/example-image",
  "category": "Matkapuhelimet",
  "categoryPath": "Elektroniikka ja kodinkoneet > Puhelimet ja tarvikkeet > Matkapuhelimet",
  "categoryId": 39,
  "categoryIds": [2, 93, 3217, 39],
  "condition": "used",
  "conditionLabel": "Hyvä",
  "tradeType": "Myydään",
  "brand": "Example Brand",
  "listSpecs": ["64 GB", "Musta"],
  "attributes": [
    {
      "id": "condition",
      "label": "Kunto",
      "value": "Hyvä"
    }
  ],
  "postedAt": null,
  "updatedAt": "2026-11-20T12:00:00.000Z",
  "postedLabel": "2 t",
  "description": "Example public description of the item in good working condition.",
  "sellerType": "business",
  "sellerName": "Example Shop Oy",
  "businessName": "Example Shop Oy",
  "businessInfo": {
    "name": "Example Shop Oy",
    "businessId": "0123456-7",
    "phoneNumber": "0401234567",
    "address": {
      "address": "Example Street 1",
      "city": "Helsinki",
      "zip": "00100"
    }
  },
  "toriDiili": true,
  "shippingAvailable": true,
  "freeShipping": false,
  "shippingPriceText": "Toimitus alkaen 3,00 €",
  "buyNow": true,
  "sellerPaysShipping": false,
  "isPromoted": false,
  "badges": ["ToriDiili"],
  "disposed": false,
  "vertical": "forsale",
  "page": 1,
  "position": 1,
  "listUrl": "https://www.tori.fi/recommerce/forsale/search?q=example",
  "tier": "detail",
  "scrapedAt": "2026-11-21T09:00:00.000Z"
}
```

When a run truncates early (`maxItems`, `max-charge-reached`, `run-time-limit`, `proxy-budget`, `cloudflare-challenge`, `empty-page`, or `errors`), the Actor appends one final **uncharged** `run-notice` row:

```json
{
  "recordType": "run-notice",
  "truncatedAfter": 50,
  "reason": "maxItems",
  "charged": false
}
```

***

#### Full Dataset Field Reference

All 56 fields declared in `.actor/dataset_schema.json`:

| Field | Type | Tier | Description |
| :--- | :--- | :--- | :--- |
| `itemId` | `string \| null` | List & Detail | Numeric Tori.fi ad ID extracted from the public item URL. |
| `url` | `string \| null` | List & Detail | Canonical public Tori.fi listing URL. |
| `title` | `string \| null` | List & Detail | Listing title as published (ends trimmed, internal whitespace preserved). |
| `price` | `number \| null` | List & Detail | Numeric asking price in EUR (`null` for free `Annetaan` or unpriced listings). |
| `currency` | `string \| null` | List & Detail | Currency code (`"EUR"` when a price is published). |
| `priceRaw` | `string \| null` | List & Detail | Raw price text as printed on the page (e.g., `"120 €"`). |
| `location` | `string \| null` | List & Detail | Full place string from the search card or item page. |
| `postalCode` | `string \| null` | Detail | Finnish 5-digit postal code published on the item page. |
| `municipality` | `string \| null` | List & Detail | Municipality or city parsed from the published location string. |
| `area` | `string \| null` | List & Detail | District or neighbourhood parsed from the location string. |
| `region` | `string \| null` | Detail | Finnish region (maakunta) parsed from the item location. |
| `country` | `string \| null` | Detail | Country code from the item page (defaults to `"FI"`). |
| `lat` | `number \| null` | Detail | Public latitude from item page hydration data (no `/map` request made). |
| `lon` | `number \| null` | Detail | Public longitude from item page hydration data. |
| `locationAccuracy` | `number \| null` | Detail | Coordinate accuracy indicator published with `lat`/`lon`. |
| `images` | `array<string> \| null` | List & Detail | Public listing image URLs from the search card or item gallery. |
| `imageCount` | `integer \| null` | List & Detail | Count of URLs in `images`. |
| `thumbnail` | `string \| null` | List & Detail | First image URL from `images`, when available. |
| `category` | `string \| null` | Detail | Leaf category name (e.g., `"Matkapuhelimet"`). |
| `categoryPath` | `string \| null` | Detail | Full breadcrumb from root category to leaf category. |
| `categoryId` | `integer \| null` | Detail | Numeric leaf category ID. |
| `categoryIds` | `array<integer \| string> \| null` | Detail | Ordered list of category IDs from root to leaf. |
| `condition` | `string \| null` | List & Detail | Schema.org condition slug (`"used"`, `"new"`, `"refurbished"`, `"damaged"`). |
| `conditionLabel` | `string \| null` | List & Detail | Finnish condition label as written on the listing (`Kunto`, e.g., `"Hyvä"`). |
| `tradeType` | `string \| null` | List & Detail | Listing trade type (`"Myydään"`, `"Annetaan"`, `"Ostetaan"`, etc.). |
| `brand` | `string \| null` | List & Detail | Item brand (`Merkki`) or first brand-like specification. |
| `listSpecs` | `array<string> \| null` | List | Short specification chips shown on the search card. |
| `attributes` | `array<object> \| null` | Detail | Structured item attributes (`{ id, label, value }`) from the detail page. |
| `postedAt` | `string \| null` | — | First-published timestamp; normally `null` because the public item payload exposes `updatedAt` only. |
| `updatedAt` | `string \| null` | Detail | Last-edited ISO timestamp from the item page. |
| `postedLabel` | `string \| null` | List | Relative age text shown on the search card (e.g., `"2 t"`, `"3 pv"`). |
| `description` | `string \| null` | Detail (or JSON-LD) | Plain-text item description. |
| `sellerType` | `string \| null` | Detail (or List) | `"private"` or `"business"` as identified by public item HTML. |
| `sellerName` | `string \| null` | List & Detail | Public display name printed on the search card, or the business shop name. |
| `businessName` | `string \| null` | Detail | Business name from the public shop block (`null` for private sellers). |
| `businessInfo` | `object \| null` | Detail | Public business shop metadata (`name`, `businessId`/Y-tunnus, `phoneNumber`, `address`, `websiteUrl`, `usps`, etc.); `null` for private sellers. Disallowed `/contact/...` URLs and internal IDs are omitted. |
| `toriDiili` | `boolean \| null` | List & Detail | Whether ToriDiili escrow shipping and payment are enabled. |
| `shippingAvailable` | `boolean \| null` | Detail | Whether the item is eligible for shipping. |
| `freeShipping` | `boolean \| null` | List & Detail | Whether a free-shipping badge is displayed. |
| `shippingPriceText` | `string \| null` | Detail | Published ToriDiili shipping price text (e.g., `"Toimitus alkaen 3,00 €"`). |
| `buyNow` | `boolean \| null` | Detail | Whether instant Buy Now is enabled on the listing. |
| `sellerPaysShipping` | `boolean \| null` | Detail | Whether the seller covers shipping fees. |
| `isPromoted` | `boolean \| null` | List & Detail | Whether the ad is promoted (`Paalupaikka`). |
| `badges` | `array<string> \| null` | List | Badge labels rendered on the search card (e.g., `["ToriDiili"]`). |
| `disposed` | `boolean \| null` | Detail | Whether the listing is marked sold or removed. |
| `vertical` | `string \| null` | List & Detail | Recommerce vertical slug parsed from the URL (e.g., `"forsale"`). |
| `page` | `integer \| null` | List | Search result page number where the item was found. |
| `position` | `integer \| null` | List | 1-based card position on that search page. |
| `listUrl` | `string \| null` | List | Search page URL where the item was discovered (`null` for direct item seeds). |
| `tier` | `string \| null` | List & Detail | `"list"` for search-card rows, or `"detail"` for item-page-enriched rows. |
| `detailError` | `string \| null` | Detail fallback | Error message if the optional detail page failed; the row keeps its list-tier fields and charges `listing`. |
| `scrapedAt` | `string \| null` | List & Detail | ISO 8601 timestamp when the record was parsed. |
| `recordType` | `string \| null` | Run notice | Set to `"run-notice"` on the final uncharged truncation row; absent on normal listing rows. |
| `truncatedAfter` | `integer \| null` | Run notice | Count of charged listing rows delivered before truncation. |
| `reason` | `string \| null` | Run notice | Stop reason (`"maxItems"`, `"max-charge-reached"`, `"run-time-limit"`, `"proxy-budget"`, `"cloudflare-challenge"`, `"empty-page"`, `"errors"`). |
| `charged` | `boolean \| null` | Run notice | Always `false` on `run-notice` rows (never billed). |

#### Key-Value Store `OUTPUT` Run Summary

Every run writes a structured JSON summary under key `OUTPUT` in the default key-value store with normalized `input`, `seeds`, `pricing`, `pushed` (`listing` and `listing-detail` counts), `duplicatesSkipped`, `pagesFetched`, `robots`, `robotsDisallowedHits`, `http` stats, `errors`, `stopReason`, `truncated`, and `unavailableFields` explanations.

***

### Pricing (Pay-Per-Event)

This Actor uses transparent **Apify Pay-Per-Event (PPE)** billing in **USD** at **$0.001 per listing** (**$1.00 per 1,000** listings on the Free tier) with **no Actor start fee** and **no separate dataset-item charge**. Uncharged `run-notice` rows are never billed.

- **`listing`**: One Tori.fi listing parsed from a public search or category page (no detail-page visit).
- **`listing-detail`**: One Tori.fi listing enriched from its public detail page. **Charged instead of `listing`, never in addition — at the exact same unit rate.**

#### Live Tiered Pricing & Apify Store Subscription Discounts

Paid Apify Store subscription plans receive automatic discounts of 5% to 15% off the Free-tier base price. Always review the live **Pricing** tab on the Actor page before running large jobs.

| Apify Subscription Tier | Discount | `listing` (per event) | `listing-detail` (per event) | Effective Cost per 1,000 Listings |
| :--- | ---: | ---: | ---: | ---: |
| **Free** | — | `$0.00100` | `$0.00100` | **$1.00** |
| **Bronze** | 5% off | `$0.00095` | `$0.00095` | **$0.95** |
| **Silver** | 10% off | `$0.00090` | `$0.00090` | **$0.90** |
| **Gold** | 15% off | `$0.00085` | `$0.00085` | **$0.85** |
| **Platinum** | 15% off | `$0.00085` | `$0.00085` | **$0.85** |
| **Diamond** | 15% off | `$0.00085` | `$0.00085` | **$0.85** |

#### Public Apify Store Pricing Reference

| Actor | Scope | Event / Result Rate (Free Tier) | Start Fee | Per 1,000 Results |
| :--- | :--- | ---: | ---: | ---: |
| **Stone_JadeX/tori-scraper** (this Actor) | Public Tori.fi classifieds search & item pages (list + optional detail at one price) | `$0.001 per listing` | `$0.00` | `$1.00 per 1,000` |
| `devilscrapes/tori-finland-cars` | Cars vertical | `$0.002` / result | `$0.20` | `$2.00` (+ `$0.20` start) |
| Other Tori Store Actors | Varies | Pricing `not shown on the public page` | — | — |

*Source: Apify Store public pricing, checked 2026-10-26. This calculation covers Actor event charges; review the Pricing tab for any separately listed platform usage or Apify storage rates.*

***

### Quickstart: API & SDK Integration

#### JavaScript / Node.js (`apify-client`)

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });

const run = await client.actor('Stone_JadeX/tori-scraper').call({
    queries: ['iphone', 'macbook'],
    vertical: 'forsale',
    maxItems: 50,
    maxPages: 3,
    scrapeDetails: true,
    requestDelayMs: 1500,
});

// Fetch listings and filter out any uncharged run-notice row
const { items } = await client.dataset(run.defaultDatasetId).listItems();
const listings = items.filter((row) => row.recordType !== 'run-notice');
console.log(`Collected ${listings.length} Tori.fi listings`);
console.log(listings[0]);

// Optional: read the OUTPUT run summary
const summary = await client.keyValueStore(run.defaultKeyValueStoreId).getRecord('OUTPUT');
console.log('Stop reason:', summary?.value?.stopReason);
```

#### Python (`apify-client`)

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])

run = client.actor("Stone_JadeX/tori-scraper").call(
    run_input={
        "queries": ["iphone", "macbook"],
        "vertical": "forsale",
        "maxItems": 50,
        "maxPages": 3,
        "scrapeDetails": True,
        "requestDelayMs": 1500,
    }
)

items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
listings = [row for row in items if row.get("recordType") != "run-notice"]
print(f"Collected {len(listings)} Tori.fi listings")
if listings:
    print(listings[0]["title"], listings[0].get("price"), listings[0].get("municipality"))

summary = client.key_value_store(run["defaultKeyValueStoreId"]).get_record("OUTPUT")
print("Stop reason:", summary["value"]["stopReason"] if summary else None)
```

***

### Is it legal to scrape Tori?

This Actor accesses only publicly visible Tori.fi search and listing pages without logging in, bypassing paywalls, or solving CAPTCHAs. Live `robots.txt` is read (Crawl-delay honoured; Disallow hits are logged and counted in `robotsDisallowedHits`), and map, messages, profile, contact, report, account and `sort=` URLs are refused in code.

Private seller phone numbers, email addresses, internal `ownerId` values, and private `/contact/...` or `/profile/...` pages are never requested or collected. For verified business shops, only the public commercial details published in the shop block (`businessName`, Finnish `Y-tunnus` / `businessId`, public shop address, and public shop phone) are retained, while internal `organisationId` and `/contact/...` paths are stripped.

This Actor is an independent tool and is **not affiliated with, endorsed by, or sponsored by Tori.fi or Vend / Schibsted**. Scraping publicly available data is generally permitted when done responsibly, but you are solely responsible for ensuring your data collection and downstream processing comply with applicable laws (including EU GDPR and Finnish data-protection regulations) and site terms of service.

***

### FAQ & Limitations

**Why are URLs with `sort=` rejected?**
`www.tori.fi/robots.txt` explicitly disallows `/*?sort=` and `/*&sort=`, so the Actor refuses any start URL containing a `sort=` parameter and uses Tori's default search ordering with `page=` pagination only.

**Why are `postalCode`, `lat`, `lon`, `categoryPath`, and `attributes` `null` in default mode?**
Search result cards only display basic summary fields (title, price, place name, thumbnail, condition, badges). Enable `scrapeDetails: true` (at the same `$0.001 per listing` Free-tier rate) to open each listing page and populate all detail-tier fields.

**Why is `postedAt` usually `null` while `updatedAt` and `postedLabel` are populated?**
Search cards print a relative age string (`postedLabel`, e.g., `"2 t"`, `"3 pv"`), while the public item page exposes the last-edited timestamp (`updatedAt`) without a separate first-published timestamp.

**Why do some listings have `price: null`?**
Free giveaways (`Annetaan`), wanted ads (`Ostetaan`), or listings without a published EUR figure legitimately have no numeric price (`price: null`).

**What happens when a run stops early?**
Whenever a run stops due to `maxItems`, `max-charge-reached`, `run-time-limit`, or another stop condition, the Actor writes a complete audit record to `OUTPUT` in the default key-value store and appends one uncharged `run-notice` item (`recordType: "run-notice"`, `charged: false`). Exclude `recordType === "run-notice"` in downstream consumers.

**Is this a live feed or alert service?**
No. Each run captures a point-in-time snapshot of public listings available at run time. Use Apify Schedules and your own comparison workflow for recurring price tracking or new-listing alerts.

***

### Changelog

#### 2026-11-21

- Added Console UI `sectionCaption` groupings (`Search targets & keywords`, `Limits & detail enrichment`, `Pacing & proxy settings`) and explicit `prefill` values (`maxItems`, `vertical`) in `.actor/input_schema.json`.
- Upgraded documentation with full input parameter table, two JSON input examples, illustrative detail-tier JSON output record, complete 56-field dataset reference, tiered PPE pricing table (Free through Diamond subscription discounts), JavaScript & Python `ApifyClient` SDK quickstarts, and expanded FAQ/limitations.

#### 2026-10-26

- Initial release (`0.1.0`): public Tori.fi classifieds search and item scraper at `$0.001 per listing` (`$1.00 per 1,000`) for both `listing` and `listing-detail`, 56-field dataset schema with 4 views, live `robots.txt` check with `robotsDisallowedHits` reporting, and hard-refused out-of-scope URLs.

# Changelog

This Actor's version history is a separate document: https://apify.com/stone_jadex/tori-scraper/changelog.md

# Actor input Schema

## `startUrls` (type: `array`):

Public Tori search or item pages, e.g. https://www.tori.fi/recommerce/forsale/search?q=iphone or https://www.tori.fi/recommerce/forsale/item/49053126. Category filters on the search URL are fine. URLs with sort=, /map, /messages, /profile, /contact, /report, account paths and internal APIs are rejected. Empty uses the default iPhone search.

## `queries` (type: `array`):

Optional keywords. Each one becomes https://www.tori.fi/recommerce/{vertical}/search?q=… (no sort parameter).

## `vertical` (type: `string`):

Path segment used with queries. forsale is the public classifieds search. Another /recommerce/{vertical}/search URL is accepted only when robots.txt allows it.

## `maxItems` (type: `integer`):

Stop after this many listings (across all URLs).

## `maxPages` (type: `integer`):

Optional. Search pages use page= (Tori shows up to the pages= value on the pagination control, often 50).

## `scrapeDetails` (type: `boolean`):

Adds full description, postal code, coordinates, attributes, seller type and ToriDiili shipping text. Same price per listing (charged as listing-detail instead of listing).

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

Polite pacing, at least 1.5 s (values below 1500 are raised to 1500).

## `maxRunSeconds` (type: `integer`):

Stops cleanly and writes OUTPUT before this limit.

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

Direct connection by default.

## `useProxyFallback` (type: `boolean`):

Stay direct until repeated 403/429, then switch to the configured proxy.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.tori.fi/recommerce/forsale/search?q=iphone"
    }
  ],
  "vertical": "forsale",
  "maxItems": 50,
  "scrapeDetails": false,
  "requestDelayMs": 1500,
  "maxRunSeconds": 3600,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "useProxyFallback": false
}
```

# Actor output Schema

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

Public listing rows saved in the default dataset. When a run stops early, the same dataset also contains one final recordType "run-notice" row describing the truncation.

## `summary` (type: `string`):

JSON run summary with input (normalized when valid, raw on an early input failure), seeds, pricing, dataset counts, HTTP and robots statistics, errors, stop reason and unavailable-field notes.

# 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 = {
    "startUrls": [
        {
            "url": "https://www.tori.fi/recommerce/forsale/search?q=iphone"
        }
    ],
    "vertical": "forsale",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("stone_jadex/tori-scraper").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 = {
    "startUrls": [{ "url": "https://www.tori.fi/recommerce/forsale/search?q=iphone" }],
    "vertical": "forsale",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("stone_jadex/tori-scraper").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 '{
  "startUrls": [
    {
      "url": "https://www.tori.fi/recommerce/forsale/search?q=iphone"
    }
  ],
  "vertical": "forsale",
  "maxItems": 50
}' |
apify call stone_jadex/tori-scraper --silent --output-dataset

```

## MCP server setup

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

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/yafc4NCSUXSt9kFJ9/builds/BcqRZUAXcFtAepAoB/openapi.json
