# Nettiauto Scraper - Used Cars, Vans & Dealers in Finland (`recordsdata/nettiauto-scraper`) Actor

Scrape nettiauto.com, Finland's used-car marketplace: cars, vans, light trucks and minibuses with EUR price, make, model, year, mileage, fuel, power, equipment, VIN, photos, dealer and sold archive, plus the dealer directory. No login. Export JSON, CSV, Excel or XML.

- **URL**: https://apify.com/recordsdata/nettiauto-scraper.md
- **Developed by:** [RecordsData](https://apify.com/recordsdata) (community)
- **Categories:** E-commerce, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $22.00 / 1,000 vehicle listings

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## JavaScript Crawlee & CheerioCrawler Actor Template

This template example was built with [Crawlee](https://crawlee.dev/) to scrape data from a website using [Cheerio](https://cheerio.js.org/) wrapped into [CheerioCrawler](https://crawlee.dev/api/cheerio-crawler/class/CheerioCrawler).

### Quick Start

Once you've installed the dependencies, start the Actor:

```bash
apify run
```

Once your Actor is ready, you can push it to the Apify Console:

```bash
apify login # first, you need to log in if you haven't already done so

apify push
```

### Project Structure

```text
.actor/
├── actor.json # Actor config: name, version, env vars, runtime settings
├── dataset_schema.json # Structure and representation of data produced by an Actor
├── input_schema.json # Input validation & Console form definition
└── output_schema.json # Specifies where an Actor stores its output
src/
└── main.js # Actor entry point and orchestrator
storage/ # Local storage (mirrors Cloud during development)
├── datasets/ # Output items (JSON objects)
├── key_value_stores/ # Files, config, INPUT
└── request_queues/ # Pending crawl requests
Dockerfile # Container image definition
```

For more information, see the [Actor definition](https://docs.apify.com/platform/actors/development/actor-definition) documentation.

### How it works

This code is a JavaScript script that uses Cheerio to scrape data from a website. It then stores the website titles in a dataset.

- The crawler starts with URLs provided from the input `startUrls` field defined by the input schema. Number of scraped pages is limited by `maxPagesPerCrawl` field from the input schema.
- The crawler uses `requestHandler` for each URL to extract the data from the page with the Cheerio library and to save the title and URL of each page to the dataset. It also logs out each result that is being saved.

### What's included

- **[Apify SDK](https://docs.apify.com/sdk/js)** - toolkit for building [Actors](https://apify.com/actors)
- **[Crawlee](https://crawlee.dev/)** - web scraping and browser automation library
- **[Input schema](https://docs.apify.com/platform/actors/development/input-schema)** - define and easily validate a schema for your Actor's input
- **[Dataset](https://docs.apify.com/sdk/python/docs/concepts/storages#working-with-datasets)** - store structured data where each object stored has the same attributes
- **[Cheerio](https://cheerio.js.org/)** - a fast, flexible & elegant library for parsing and manipulating HTML and XML
- **[Proxy configuration](https://docs.apify.com/platform/proxy)** - rotate IP addresses to prevent blocking

### Resources

- [Quick Start](https://docs.apify.com/platform/actors/development/quick-start) guide for building your first Actor
- [Video tutorial](https://www.youtube.com/watch?v=yTRHomGg9uQ) on building a scraper using CheerioCrawler
- [Written tutorial](https://docs.apify.com/academy/web-scraping-for-beginners/challenge) on building a scraper using CheerioCrawler
- [Web scraping with Cheerio in 2023](https://blog.apify.com/web-scraping-with-cheerio/)
- How to [scrape a dynamic page](https://blog.apify.com/what-is-a-dynamic-page/) using Cheerio
- [Integration with Zapier](https://apify.com/integrations), Make, Google Drive and others
- [Video guide on getting data using Apify API](https://www.youtube.com/watch?v=ViYYDHSBAKM)

### Creating Actors with templates

[How to create Apify Actors with web scraping code templates](https://www.youtube.com/watch?v=u-i-Korzf8w)

### Getting started

For complete information [see this article](https://docs.apify.com/platform/actors/development#build-actor-locally). To run the Actor use the following command:

```bash
apify run
```

### Deploy to Apify

#### Connect Git repository to Apify

If you've created a Git repository for the project, you can easily connect to Apify:

1. Go to [Actor creation page](https://console.apify.com/actors/new)
2. Click on **Link Git Repository** button

#### Push project on your local machine to Apify

You can also deploy the project on your local machine to Apify without the need for the Git repository.

1. Log in to Apify. You will need to provide your [Apify API Token](https://console.apify.com/account/integrations) to complete this action.

   ```bash
   apify login
   ```

2. Deploy your Actor. This command will deploy and build the Actor on the Apify Platform. You can find your newly created Actor under [Actors -> My Actors](https://console.apify.com/actors?tab=my).

   ```bash
   apify push
   ```

### Documentation reference

To learn more about Apify and Actors, take a look at the following resources:

- [Apify SDK for JavaScript documentation](https://docs.apify.com/sdk/js)
- [Apify SDK for Python documentation](https://docs.apify.com/sdk/python)
- [Apify Platform documentation](https://docs.apify.com/platform)
- [Join our developer community on Discord](https://discord.com/invite/jyEM2PRvMU)

# Actor input Schema

## `mode` (type: `string`):

search = used-vehicle listings for the filters below (one row per ad). urls = ad, dealer-inventory, saved-search or newest-ads addresses (or ad numbers) you provide, always with full detail. dealers = the car-dealer directory (one row per company).

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

Stops after this many rows (all record types together). Free plans are limited to 10 items per run.

## `vehicleTypes` (type: `array`):

Which kinds of vehicle to read. Empty means passenger cars.

## `listingStatus` (type: `string`):

for-sale = ads that are live now. sold = ads the seller marked as sold (kept on the site for a while, price shown as the last asking price).

## `makes` (type: `array`):

Optional. One or more makes exactly as nettiauto.com writes them, for example BMW, Volvo, Mercedes-Benz, Skoda. Empty means every make. Several makes cannot be combined with models.

## `models` (type: `array`):

Optional. Models of the single make above, for example 320 or XC60. Needs exactly one make. Empty means every model of the make.

## `regions` (type: `array`):

Optional. Regions (maakunta) of Finland to search in. Empty means all of Finland. In dealer mode it narrows the dealer directory.

## `towns` (type: `array`):

Optional. Towns inside the single region chosen above, for example Espoo or Tampere. Needs exactly one region in search mode.

## `bodyTypes` (type: `array`):

Optional. Keep only these body types (car bodies and van bodies). Empty means any.

## `fuelTypes` (type: `array`):

Optional. Keep only these fuels. "Hybrid" matches every hybrid sub-type; pick a sub-type to narrow it. Empty means any.

## `transmission` (type: `string`):

Optional. Automatic or manual gearbox. any means both.

## `driveTypes` (type: `array`):

Optional. Keep only these drive layouts. Empty means any.

## `colors` (type: `array`):

Optional. Keep only these exterior colors. Empty means any.

## `minPrice` (type: `integer`):

Optional. Lowest advertised price in euros. 0 means no limit.

## `maxPrice` (type: `integer`):

Optional. Highest advertised price in euros. 0 means no limit.

## `minYear` (type: `integer`):

Optional. Oldest model year. 0 means no limit.

## `maxYear` (type: `integer`):

Optional. Newest model year. 0 means no limit.

## `minMileage` (type: `integer`):

Optional. Lowest odometer reading in kilometres. 0 means no limit.

## `maxMileage` (type: `integer`):

Optional. Highest odometer reading in kilometres. 0 means no limit.

## `minPowerHp` (type: `integer`):

Optional. Lowest engine power in horsepower. 0 means no limit.

## `maxPowerHp` (type: `integer`):

Optional. Highest engine power in horsepower. 0 means no limit.

## `minEngineSize` (type: `integer`):

Optional. Smallest engine displacement in cubic centimetres, for example 1600. 0 means no limit.

## `maxEngineSize` (type: `integer`):

Optional. Largest engine displacement in cubic centimetres, for example 2000. 0 means no limit.

## `minSeats` (type: `integer`):

Optional. Fewest seats. 0 means no limit.

## `maxSeats` (type: `integer`):

Optional. Most seats. 0 means no limit.

## `minDoors` (type: `integer`):

Optional. Fewest doors. 0 means no limit.

## `maxDoors` (type: `integer`):

Optional. Most doors. 0 means no limit.

## `sellerType` (type: `string`):

Optional. dealer = car dealers only. private = private persons only (flagged with isPrivateSeller, never named, no contact details). any means both.

## `roadWorthy` (type: `string`):

Optional. yes = vehicles that can be driven on the road. no = vehicles the seller marks as not roadworthy (project cars, parts cars). any means both.

## `maxAgeDays` (type: `string`):

Optional. Keep only ads created or changed within this many days.

## `sortBy` (type: `string`):

Order of the results. Newest first is the default and the best choice for monitoring.

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

Ad addresses (https://www.nettiauto.com/bmw/3-sarja/12345678), dealer pages (https://www.nettiauto.com/yritys/1234), saved-search results (https://www.nettiauto.com/hakutulokset?haku=...) or the newest ads (https://www.nettiauto.com/uusimmat).

## `listingIds` (type: `array`):

Ad numbers (the number at the end of an ad address), for example 16064350.

## `dealerIds` (type: `array`):

Dealer numbers (the number in a dealer page address, https://www.nettiauto.com/yritys/1234). Empty means walk the directory with the regions and towns above.

## `dealerQuery` (type: `string`):

Optional. Keep only dealers whose name contains these words, for example "Kiesi".

## `fetchDetails` (type: `boolean`):

On (default): every ad page is read for the full record (description, equipment, VIN, seller, exact dates) and billed as a detail record. Off: only the list card is read (title, price, year, mileage, fuel, transmission, city, first photo), billed as a standard record. For dealers: on adds the profile (website, logo, description).

## `includeContactDetails` (type: `boolean`):

Off (default): phone numbers and e-mail addresses written into dealer texts are replaced by a marker and no phone is read. On: dealer texts are kept as written and ad rows of dealers get sellerPhone, the business line behind the call button of the ad (one extra request per dealer ad, needs ad pages on). Private persons never get contact data, whatever this says.

## `includeRaw` (type: `boolean`):

Adds a "raw" column with the unprocessed data blocks of the site (list card and ad page analytics data).

## `onlyNew` (type: `boolean`):

Schedule the Actor and receive only ads you have not been given before. The first run returns everything and builds the memory. Use together with sort "Newest first".

## `stateKey` (type: `string`):

Optional name of the monitor memory. Same label plus same filters = same memory. Empty derives the label from the filters.

## `resetSeen` (type: `boolean`):

Forget everything seen before and start the memory again. Use after changing what you want to track.

## `maxConcurrency` (type: `integer`):

Ad pages read at the same time. The site answers slowly; 2 is the polite default.

## `maxScanSeconds` (type: `integer`):

Stops reading after this many seconds and delivers what was collected.

## Actor input object example

```json
{
  "mode": "search",
  "maxItems": 3,
  "vehicleTypes": [
    "car"
  ],
  "listingStatus": "for-sale",
  "makes": [],
  "models": [],
  "regions": [],
  "towns": [],
  "bodyTypes": [],
  "fuelTypes": [],
  "transmission": "any",
  "driveTypes": [],
  "colors": [],
  "sellerType": "any",
  "roadWorthy": "any",
  "maxAgeDays": "any",
  "sortBy": "newest",
  "startUrls": [],
  "listingIds": [],
  "dealerIds": [],
  "dealerQuery": "",
  "fetchDetails": true,
  "includeContactDetails": false,
  "includeRaw": false,
  "onlyNew": false,
  "stateKey": "",
  "resetSeen": false,
  "maxConcurrency": 2,
  "maxScanSeconds": 3000
}
```

# Actor output Schema

## `overview` (type: `string`):

Key fields per row

## `fullData` (type: `string`):

Complete dataset with all fields

# 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 = {
    "maxItems": 3,
    "vehicleTypes": [
        "car"
    ],
    "makes": [],
    "models": [],
    "regions": [],
    "towns": [],
    "bodyTypes": [],
    "fuelTypes": [],
    "driveTypes": [],
    "colors": [],
    "minPrice": 0,
    "maxPrice": 0,
    "minYear": 0,
    "maxYear": 0,
    "minMileage": 0,
    "maxMileage": 0,
    "minPowerHp": 0,
    "maxPowerHp": 0,
    "minEngineSize": 0,
    "maxEngineSize": 0,
    "minSeats": 0,
    "maxSeats": 0,
    "minDoors": 0,
    "maxDoors": 0,
    "startUrls": [],
    "listingIds": [],
    "dealerIds": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("recordsdata/nettiauto-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 = {
    "maxItems": 3,
    "vehicleTypes": ["car"],
    "makes": [],
    "models": [],
    "regions": [],
    "towns": [],
    "bodyTypes": [],
    "fuelTypes": [],
    "driveTypes": [],
    "colors": [],
    "minPrice": 0,
    "maxPrice": 0,
    "minYear": 0,
    "maxYear": 0,
    "minMileage": 0,
    "maxMileage": 0,
    "minPowerHp": 0,
    "maxPowerHp": 0,
    "minEngineSize": 0,
    "maxEngineSize": 0,
    "minSeats": 0,
    "maxSeats": 0,
    "minDoors": 0,
    "maxDoors": 0,
    "startUrls": [],
    "listingIds": [],
    "dealerIds": [],
}

# Run the Actor and wait for it to finish
run = client.actor("recordsdata/nettiauto-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 '{
  "maxItems": 3,
  "vehicleTypes": [
    "car"
  ],
  "makes": [],
  "models": [],
  "regions": [],
  "towns": [],
  "bodyTypes": [],
  "fuelTypes": [],
  "driveTypes": [],
  "colors": [],
  "minPrice": 0,
  "maxPrice": 0,
  "minYear": 0,
  "maxYear": 0,
  "minMileage": 0,
  "maxMileage": 0,
  "minPowerHp": 0,
  "maxPowerHp": 0,
  "minEngineSize": 0,
  "maxEngineSize": 0,
  "minSeats": 0,
  "maxSeats": 0,
  "minDoors": 0,
  "maxDoors": 0,
  "startUrls": [],
  "listingIds": [],
  "dealerIds": []
}' |
apify call recordsdata/nettiauto-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,recordsdata/nettiauto-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/DWiUZCYN4MgnNFKLF/builds/ZMi1TGxmabygTKWFa/openapi.json
