# 2dehands / 2ememain Scraper (`automation-lab/2dehands-2ememain-scraper`) Actor

Scrape Belgian 2dehands and 2ememain marketplace listings with prices, sellers, locations, images, and attributes from public pages.

- **URL**: https://apify.com/automation-lab/2dehands-2ememain-scraper.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## 2dehands / 2ememain Scraper

Scrape public Belgian marketplace listings from 2dehands.be and 2ememain.be. Collect titles, prices, sellers, locations, images, listing attributes, and URLs from category or keyword search pages.

### What does 2dehands / 2ememain Scraper do?

This actor extracts structured listing data from public 2dehands and 2ememain marketplace pages.

It is designed for search and category monitoring.

You can provide category URLs such as car listings.

You can also provide keywords such as `iphone`, `fiets`, or `audi`.

The actor opens public listing result pages and reads the server-rendered data embedded in the page.

No account login is required for the MVP extraction path.

### Who is it for?

#### Marketplace analysts

Track inventory volumes, price ranges, and product availability in Belgium.

#### Car dealers and resellers

Monitor new vehicles, mileage, fuel type, seller names, and local asking prices.

#### Ecommerce teams

Watch second-hand prices for products that compete with your catalog.

#### Lead generation teams

Find sellers and listings in specific categories or regions.

#### Researchers

Build datasets for local commerce, used goods, vehicle pricing, or marketplace behavior.

### Why use this scraper?

- ✅ Extract public listing data without building your own crawler.
- ✅ Use either direct category URLs or keyword searches.
- ✅ Capture price, seller, location, images, and attributes in one dataset.
- ✅ Export results to JSON, CSV, Excel, Google Sheets, or your own API.
- ✅ Run the actor on demand or schedule it for monitoring.

### Supported websites

The actor supports the public Belgian marketplace brands:

- `https://www.2dehands.be`
- `https://www.2ememain.be`

The Dutch site is used by default.

The French mirror can be selected with the `language` input.

### Data you can extract

| Field | Description |
| --- | --- |
| `id` | Marketplace listing ID |
| `url` | Direct listing URL |
| `title` | Listing title |
| `description` | Listing text snippet |
| `price` | Numeric EUR price when available |
| `priceType` | Listing price type from the marketplace |
| `locationCity` | Seller/listing city |
| `sellerName` | Public seller name |
| `imageUrls` | Listing image URLs |
| `attributes` | Category-specific specs such as mileage or fuel |
| `sourceUrl` | Search/category page where the listing was found |
| `scrapedAt` | Timestamp of extraction |

### How much does it cost to scrape 2dehands listings?

This actor uses pay-per-event pricing.

You pay a small `$0.005` run-start event plus a tiered per-listing event.

The platform BRONZE listing price is `$0.0001` per extracted listing, with lower per-listing prices on higher Apify tiers.

Start with a low `maxResults` value for your first run.

Increase it after you confirm that the output matches your workflow.

### Quick start

1. Open the actor on Apify.
2. Add one or more 2dehands category URLs.
3. Optionally add keyword searches.
4. Set `maxResults`.
5. Run the actor.
6. Download the dataset or connect it to your workflow.

### Input configuration

#### startUrls

Use public category or search pages.

Example:

```json
[{ "url": "https://www.2dehands.be/l/auto-s/" }]
````

#### searchQueries

Use search terms when you do not already have a URL.

Example:

```json
["iphone", "audi"]
```

#### language

Use `nl` for 2dehands.be or `fr` for 2ememain.be keyword/default URLs.

#### maxResults

Controls how many listing rows are saved across all inputs.

#### maxRequestRetries

Controls retry attempts for failed HTTP requests.

### Example input

```json
{
  "startUrls": [{ "url": "https://www.2dehands.be/l/auto-s/" }],
  "searchQueries": ["iphone"],
  "language": "nl",
  "maxResults": 30,
  "maxRequestRetries": 3
}
```

### Example output

```json
{
  "id": "m2335649230",
  "url": "https://www.2dehands.be/v/auto-s/audi/m2335649230-audi-q7-tfsi-60-e-competition-3-0-l-v6-462-pk-quattro",
  "title": "Audi Q7 TFSI 60 E competition 3.0 l V6 (462 pk) quattro",
  "price": 69500,
  "currency": "EUR",
  "locationCity": "Geel",
  "sellerName": "seller name",
  "imageUrls": ["https://images.2dehands.com/..."]
}
```

### Tips for better results

- Use category URLs when you want broad inventory.
- Use search keywords when you monitor a specific product.
- Keep the first run small.
- Schedule recurring runs for price monitoring.
- Combine `sourceUrl` and `scrapedAt` to compare snapshots over time.

### Pagination behavior

The actor reads the first page for each URL or keyword.

When more results are needed, it follows the marketplace `/p/<page>/` pagination pattern.

It stops when `maxResults` is reached or the source has no more listings.

### Integrations

Use the dataset with:

- Google Sheets for price tracking.
- Airtable for lead review.
- Make or Zapier for alerts.
- Apify webhooks for notifications.
- Your data warehouse for trend analysis.

### API usage

#### Node.js

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/2dehands-2ememain-scraper').call({
  startUrls: [{ url: 'https://www.2dehands.be/l/auto-s/' }],
  maxResults: 30
});
console.log(run.defaultDatasetId);
```

#### Python

```python
from apify_client import ApifyClient
import os

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('automation-lab/2dehands-2ememain-scraper').call(run_input={
    'searchQueries': ['iphone'],
    'maxResults': 30,
})
print(run['defaultDatasetId'])
```

#### cURL

```bash
curl -X POST 'https://api.apify.com/v2/acts/automation-lab~2dehands-2ememain-scraper/runs?token=YOUR_APIFY_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"searchQueries":["iphone"],"maxResults":30}'
```

### MCP usage

Connect Apify MCP to Claude with this actor enabled:

`https://mcp.apify.com/?tools=automation-lab/2dehands-2ememain-scraper`

Claude Code setup:

```bash
claude mcp add apify-2dehands "https://mcp.apify.com/?tools=automation-lab/2dehands-2ememain-scraper"
```

Claude Desktop JSON configuration:

```json
{
  "mcpServers": {
    "apify-2dehands": {
      "url": "https://mcp.apify.com/?tools=automation-lab/2dehands-2ememain-scraper"
    }
  }
}
```

Example prompts:

- “Run the 2dehands scraper for iphone listings and summarize price ranges.”
- “Find 30 car listings from 2dehands and group them by city.”
- “Monitor this 2dehands category URL and alert me about new sellers.”

### Data quality notes

The actor reads fields exposed by the public result page.

Some listings may not include every field.

For example, private sellers may omit location details or the marketplace may omit price for some ad types.

The actor keeps optional fields empty rather than inventing data.

### FAQ

#### Can I scrape both 2dehands and 2ememain?

Yes. Use Dutch `2dehands.be` URLs directly, French `2ememain.be` URLs directly, or set `language` to choose the default site for keyword searches.

#### Do I need a marketplace account?

No. This actor extracts public search and category listing data that is available without login.

#### Can I monitor prices over time?

Yes. Schedule recurring runs and compare datasets by `id`, `price`, `sourceUrl`, and `scrapedAt`.

### Troubleshooting

#### I received fewer results than requested

The selected category or keyword may have fewer public listings, or the marketplace may cap pagination for that query.

Try a broader category URL or a lower `maxResults` value.

#### My keyword returns unrelated listings

2dehands controls search ranking and matching.

Use a more specific keyword or a category URL for tighter results.

### Legality and responsible use

This actor extracts publicly available marketplace data.

You are responsible for using the data in accordance with applicable laws, marketplace terms, and privacy rules.

Do not scrape personal data beyond what is necessary for your legitimate use case.

### Related scrapers

Other Apify actors from automation-lab may help with marketplace and ecommerce workflows:

- https://apify.com/automation-lab/facebook-marketplace-scraper
- https://apify.com/automation-lab/ecommerce-scraping-tool
- https://apify.com/automation-lab/google-maps-lead-finder

### Changelog

#### 0.1

Initial build for public 2dehands / 2ememain listing extraction.

### Support

If a page URL does not work, include the exact input and run ID when reporting the issue.

This helps reproduce the query and adjust parsing when the marketplace changes its layout.

# Actor input Schema

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

Public 2dehands.be or 2ememain.be category/search URLs, for example https://www.2dehands.be/l/auto-s/.

## `searchQueries` (type: `array`):

Keywords to search on 2dehands / 2ememain. Each keyword is converted to a public /q/ search page.

## `language` (type: `string`):

Use the Dutch 2dehands.be site or the French 2ememain.be mirror for keyword searches and default URLs.

## `maxResults` (type: `integer`):

Maximum number of marketplace listings to save across all URLs and keywords.

## `maxRequestRetries` (type: `integer`):

Number of retry attempts for failed page requests.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.2dehands.be/l/auto-s/"
    }
  ],
  "searchQueries": [
    "iphone"
  ],
  "language": "nl",
  "maxResults": 20,
  "maxRequestRetries": 3
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.2dehands.be/l/auto-s/"
        }
    ],
    "searchQueries": [
        "iphone"
    ],
    "language": "nl",
    "maxResults": 20,
    "maxRequestRetries": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/2dehands-2ememain-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.2dehands.be/l/auto-s/" }],
    "searchQueries": ["iphone"],
    "language": "nl",
    "maxResults": 20,
    "maxRequestRetries": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/2dehands-2ememain-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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.2dehands.be/l/auto-s/"
    }
  ],
  "searchQueries": [
    "iphone"
  ],
  "language": "nl",
  "maxResults": 20,
  "maxRequestRetries": 3
}' |
apify call automation-lab/2dehands-2ememain-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=automation-lab/2dehands-2ememain-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "2dehands / 2ememain Scraper",
        "description": "Scrape Belgian 2dehands and 2ememain marketplace listings with prices, sellers, locations, images, and attributes from public pages.",
        "version": "0.1",
        "x-build-id": "fgSOsBWAT1lda767C"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/automation-lab~2dehands-2ememain-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-automation-lab-2dehands-2ememain-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/automation-lab~2dehands-2ememain-scraper/runs": {
            "post": {
                "operationId": "runs-sync-automation-lab-2dehands-2ememain-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/automation-lab~2dehands-2ememain-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-automation-lab-2dehands-2ememain-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "startUrls": {
                        "title": "2dehands category or search URLs",
                        "type": "array",
                        "description": "Public 2dehands.be or 2ememain.be category/search URLs, for example https://www.2dehands.be/l/auto-s/.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "searchQueries": {
                        "title": "Search keywords",
                        "type": "array",
                        "description": "Keywords to search on 2dehands / 2ememain. Each keyword is converted to a public /q/ search page.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "language": {
                        "title": "Marketplace language",
                        "enum": [
                            "nl",
                            "fr"
                        ],
                        "type": "string",
                        "description": "Use the Dutch 2dehands.be site or the French 2ememain.be mirror for keyword searches and default URLs.",
                        "default": "nl"
                    },
                    "maxResults": {
                        "title": "Maximum listings",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of marketplace listings to save across all URLs and keywords.",
                        "default": 50
                    },
                    "maxRequestRetries": {
                        "title": "Max request retries",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Number of retry attempts for failed page requests.",
                        "default": 3
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
