# Marktplaats Scraper (`daddyapi/marktplaats-scraper`) Actor

Specialized scraper for Marktplaats.nl. Extract detailed listings including prices, locations, descriptions, and photos from the Netherlands' largest marketplace.

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

## Pricing

from $1.00 / 1,000 results

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Marktplaats Scraper 🇳🇱

> **The only Marktplaats scraper that searches by KEYWORD or extracts DIRECT URLs.** No need to manually filter URLs. Enter a term (e.g., "iPhone 15", "Bakfiets") or a specific ad link and get detailed results instantly.

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-blue?style=for-the-badge\&logo=apify)](https://apify.com/daddyapi/marktplaats-scraper)
[![Node.js](https://img.shields.io/badge/Node.js-v22-green?style=for-the-badge\&logo=node.js)](https://nodejs.org/)

### 🚀 Why this scraper?

Most scrapers require you to manually visit the website, apply filters, copy the URL, and paste it into the scraper. **That's slow and unscalable.**

**Marktplaats Scraper** acts like a real user with **Dual Mode**:

1. **Search Mode:** You provide a **Search Query** (e.g., "MacBook Pro"). The actor navigates, searches, handles pagination, and extracts clean data.
2. **Direct Mode:** You provide specific **Listing URLs**. The actor visits each page and extracts deep details (all 20+ photos, full description).

**Perfect for:**

- 📉 **Price Monitoring:** Track competitors or market trends.
- 🏠 **Real Estate:** Find new apartment listings instantly.
- 🚗 **Automotive:** Monitor car prices across the Netherlands.
- 📦 **Arbitrage:** Spot undervalued items before anyone else.

***

### 🌍 Supported Countries

We focus specifically on the Netherlands:

| Domain | Country | Language | Currency |
|--------|---------|----------|----------|
| **marktplaats.nl** | 🇳🇱 Netherlands | Dutch | EUR |

***

### 📖 How to Use

#### Option 1: Apify Console (No Coding)

**Mode A: Search Scraping (Fast)**

1. Go to the **Input** tab.
2. Enter your **Search Keyword** (e.g., `Sony PlayStation 5`).
3. (Optional) Set **Sort By** to `Newest` to get the latest ads.
4. **Proxy Selection:** Select "Apify Proxy" (**Residential recommended**) OR select your own custom proxy groups.
5. Click **Start**.

**Mode B: Direct URL Scraping (Deep)**

1. Go to the **Input** tab.
2. Paste listing URLs into **Direct Listing URLs** (e.g., `https://www.marktplaats.nl/v/fietsen/m123456...`).
3. Click **Start**.

#### Option 2: API (Developers)

You can trigger this actor programmatically via REST API, Python, or Node.js.

##### Input Payload (JSON)

```json
{
    // MODE 1: Search
    "searchQuery": "iPhone 15 Pro",
    "sortBy": "newest",
    "maxPages": 1,

    // MODE 2: Direct URLs (Optional - Overrides Search)
    "startUrls": [
        { "url": "https://www.marktplaats.nl/v/audio-tv-en-foto/m2343840838" }
    ],

    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": ["RESIDENTIAL"]
    }
}
```

##### 🐍 Python Example (Simple & Clean)

This script runs the scraper and saves the results to a local file.

```python
import json
from apify_client import ApifyClient

## 1. Configuration
APIFY_TOKEN = 'YOUR_APIFY_TOKEN'
ACTOR_ID = 'daddyapi/marktplaats-scraper'

client = ApifyClient(APIFY_TOKEN)

## 2. Define Input
run_input = {
    "searchQuery": "Bakfiets", 
    "sortBy": "newest",
    "maxPages": 1,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"]
    }
}

print(f"🚀 Starting scraper for: {run_input['searchQuery']}...")

## 3. Run Actor
run = client.actor(ACTOR_ID).call(run_input=run_input)

if not run:
    print("❌ Failed to start run.")
    exit(1)

print(f"✅ Run finished! Status: {run['status']}")

## 4. Fetch & Save Results
dataset_client = client.dataset(run["defaultDatasetId"])
items = dataset_client.list_items().items

filename = "results.json"
with open(filename, "w", encoding="utf-8") as f:
    json.dump(items, f, indent=2, ensure_ascii=False)

print(f"💾 Saved {len(items)} listings to {filename}")
```

***

### 🔒 Proxy Configuration (Bring Your Own Proxies)

This actor is fully compatible with **Apify Proxy** (Datacenter & Residential) and **Custom Proxies**.

#### 1. Datacenter Proxies (Cost-Effective)

Great for high-volume users, but **Marktplaats blocks them often**. Use at your own risk.

```json
{
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": ["BUYPROXIES94952"]
    }
}
```

#### 2. Residential Proxies (Best Reliability)

**Recommended.** Residential proxies are harder to block and provide the highest success rate (near 100%).

```json
{
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": ["RESIDENTIAL"]
    }
}
```

***

### 📊 Data Output

The scraper returns highly detailed, structured data for every listing:

```json
{
  "id": 2343840838,
  "title": "Focusrite ISA 220",
  "url": "https://www.marktplaats.nl/v/audio-tv-en-foto/m2343840838",
  "description": "Aangeboden deze focusrite isa 220 session pack...",
  "price": {
    "amount": 840,
    "currency": "EUR",
    "display": "Bieden vanaf € 840"
  },
  "location": {
    "city": "Harderwijk",
    "region": "NL"
  },
  "postedAt": "2025-01-08T14:30:00Z",
  "isBusiness": false,
  "photos": [
    "https://images.marktplaats.com/api/v1/listing-mp-p/images/0d/large.jpg",
    "https://images.marktplaats.com/api/v1/listing-mp-p/images/52/large.jpg"
  ],
  "seller": {
    "id": 6169033,
    "name": "Welkom",
    "activeYears": "7 jaar"
  }
}
```

***

### ⚙️ Configuration Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `searchQuery` | String | ❌ | - | Keyword to search for (e.g., "iPhone"). |
| `startUrls` | Array | ❌ | \[] | List of specific ad URLs to scrape deeply. |
| `olxDomain` | Enum | ✅ | marktplaats.nl | Target domain (Fixed). |
| `sortBy` | Enum | ❌ | `newest` | `newest`, `cheapest`, `expensive`, or `relevance`. |
| `maxPages` | Integer | ❌ | `1` | Depth of scrape. 1 page ≈ 30 ads. |
| `proxyConfiguration` | Object | ❌ | Auto | Configure Residential or Custom Proxies. |

*Note: You must provide either `searchQuery` OR `startUrls`.*

***

### 🛡️ Troubleshooting

- **Empty Results?** Check if the item exists. Try a broader Dutch keyword.
- **Blocked/403?** Your proxy is detected. **Switch to Residential Proxies**.
- **Missing Images?** Ensure you are using `startUrls` for deep scraping if search results don't provide enough detail.

***

#### ⚖️ Legal & Ethics

This scraper is for educational and analytical purposes. Please respect Marktplaats's Terms of Service and `robots.txt`. Do not use this tool to spam sellers or overload their servers. Use responsible rate limits.

***

### 🌟 More Scrapers from DaddyAPI

Check out our other specialized tools for scraping data:

| Scraper | Description | Price |
|---------|-------------|-------|
| **[Leboncoin Scraper (France)](https://apify.com/daddyapi/leboncoin-scraper)** | Dedicated scraper for **leboncoin.fr**. Optimized for France. | Pay per result |
| **[OLX Search Scraper (Global)](https://apify.com/daddyapi/olx-search-scraper)** | Supports **Ukraine, Poland, Romania, Portugal**, and more. | Pay per result |
| **[OLX Brazil Scraper](https://apify.com/daddyapi/olx-brazil-scraper)** | Dedicated scraper for **olx.com.br**. Optimized for Brazil. | Pay per result |
| **[OLX India Scraper](https://apify.com/daddyapi/olx-india-scraper)** | Dedicated scraper for **olx.in**. Optimized for India. | Pay per result |
| **[Generic Html Scraper](https://apify.com/daddyapi/generic-html-scraper)** | **\[Participating in the $1M Challenge]**<br>Fetch raw HTML from any URL. | **$1.00** / 1k results |

# Actor input Schema

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

List of specific ad URLs to scrape directly. If provided, the scraper will extract data from these pages. Ideal for scraping single items.

## `searchQuery` (type: `string`):

What item are you looking for? (e.g., 'Fiets', 'iPhone 13', 'Bank')

## `olxDomain` (type: `string`):

Target Domain (Netherlands).

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

Order in which ads are scraped.

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

How many pages of results to traverse. 1 page ≈ 30 ads.

## `maxRequestsPerCrawl` (type: `integer`):

Hard limit on total requests to prevent runaway costs.

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

⚠️ RESIDENTIAL PROXIES (NL) STRONGLY RECOMMENDED.

## Actor input object example

```json
{
  "searchQuery": "Fiets",
  "olxDomain": "marktplaats.nl",
  "sortBy": "newest",
  "maxPages": 1,
  "maxRequestsPerCrawl": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("daddyapi/marktplaats-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("daddyapi/marktplaats-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 '{}' |
apify call daddyapi/marktplaats-scraper --silent --output-dataset

```

## MCP server setup

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