# Leboncoin Scraper (`mina_safwat/leboncoin-scraper`) Actor

Scrapes Leboncoin classified ads — price, location, seller and full ad details — from any search on France's largest classifieds site.

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

## Pricing

$1.00 / 1,000 ads

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

### What does Leboncoin Scraper do?

**Leboncoin Scraper** collects classified ads from [Leboncoin](https://www.leboncoin.fr), **France's largest classifieds site**, straight from any search you run there. For every ad you get the **title, price, category, city, postcode, department and region, map position, seller name and type, posting date, photos and every detail the seller filled in**: mileage and year for cars, surface area for property, size for bikes, and so on.

Paste a search link, press Start, and download the results as JSON, CSV or Excel. Running on the Apify platform gives you API access, scheduling, integrations (Google Sheets, Make, Zapier, n8n, webhooks), French residential proxies and run monitoring.

### Why use Leboncoin Scraper?

- **Price tracking**: follow asking prices for cars, property, electronics or furniture in any part of France.
- **Market research**: see where supply is concentrated across departments and how private sellers compare with professionals.
- **Deal alerts**: run a search on a schedule, newest first, and act on new ads quickly.
- **Lead generation**: build lists of professional sellers (dealers, agencies, shops) in a category or region.
- **Data for analysis**: clean, structured rows with Leboncoin's own attributes, ready for a spreadsheet or a model.

### How to scrape Leboncoin

1. Open [leboncoin.fr](https://www.leboncoin.fr) and search for what you want.
2. Narrow it down with the site's filters: category, price range, location, condition, delivery, sort order.
3. Copy the address from your browser's address bar.
4. Paste it into **Leboncoin search links**, one link per line. Add as many searches as you like.
5. Click **Start**, then download the dataset when the run finishes.

Every filter in the link is used, because the Actor reads the same search you see in your browser. Leboncoin refuses automated requests that carry the property-type filter (house, apartment, land...), so the Actor applies that one to the results itself.

### Input

Set the input on the **Input** tab, or send it through the API:

| Field | What it does |
|---|---|
| `search_urls` | Leboncoin search links, one per line (`/recherche?...` or category pages under `/c/`). Links that are not Leboncoin searches are skipped and listed in the `FAILED_INPUTS` record. |
| `max_results_per_search` | Stops each link after this many ads. Default 200. Leboncoin shows 35 ads per page and at most 100 pages (3,500 ads) per search. |
| `proxy_country` | Two-letter country to browse from. Keep the default, `FR`. |

```json
{
    "search_urls": [
        "https://www.leboncoin.fr/recherche?text=velo",
        "https://www.leboncoin.fr/recherche?category=2&text=clio"
    ],
    "max_results_per_search": 100
}
```

### Output

Each ad is one row. A real example, shortened:

```json
{
    "id": "3180688378",
    "title": "Renault Clio 1.6 E-Tech 145ch full hybrid esprit Alpine - 25b",
    "price": 25600,
    "currency": "EUR",
    "url": "https://www.leboncoin.fr/ad/voitures/3180688378",
    "category": "Voitures",
    "city": "Salon-de-Provence",
    "zipcode": "13300",
    "department": "Bouches-du-Rhône",
    "region": "Provence-Alpes-Côte d'Azur",
    "latitude": 43.63863,
    "longitude": 5.09897,
    "seller_name": "RENAULT SALON-DE-PROVENCE",
    "seller_type": "pro",
    "is_professional": true,
    "is_urgent": false,
    "is_highlighted": true,
    "is_featured": false,
    "published_at": "2026-09-30 22:41:19",
    "updated_at": "2026-10-07 10:41:24",
    "attributes": {
        "brand": "Renault", "model": "Clio", "regdate": "2025", "mileage": "9000 km",
        "fuel": "Hybride", "gearbox": "Automatique", "vehicule_color": "Bleu"
    },
    "image_count": 30,
    "image": "https://img.leboncoin.fr/api/v1/lbcpb1/images/30/96/d8/....jpg?rule=ad-small",
    "position": 1,
    "search_url": "https://www.leboncoin.fr/recherche?category=2&text=clio"
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Data fields

| Field | Description |
|---|---|
| `id`, `url` | Leboncoin's ad number and the ad's page |
| `title` | The ad's title |
| `price`, `currency` | Asking price in euros, exact to the cent; empty when the ad shows no price |
| `category` | Leboncoin category, such as Voitures or Vélos |
| `condition`, `shipping` | The condition the seller stated, and the delivery option |
| `city`, `zipcode`, `department`, `region` | Where the ad is |
| `latitude`, `longitude` | The ad's map position as Leboncoin publishes it |
| `seller_name`, `seller_type`, `is_professional`, `store_id` | The public seller name, private or pro, and the seller's Leboncoin store id |
| `is_urgent`, `is_highlighted`, `is_featured` | Paid visibility options on the ad; `is_featured` marks "À la une" ads, shown at the top of every page |
| `published_at`, `updated_at` | When the ad was posted and last refreshed, French local time |
| `attributes` | Every detail the seller filled in, with Leboncoin's readable labels |
| `image`, `images`, `image_count` | The main photo, all photo links and how many there are |
| `position`, `search_url` | The ad's place in your search and the link it came from |

### How much does it cost to scrape Leboncoin?

The Actor uses **pay-per-event** pricing, so you pay only for results:

- **$1.00 per 1,000 ads** ($0.001 per ad saved to the dataset). There is no start fee.

For example, 1,000 car ads cost $1.00. Apify's free plan includes $5 of monthly credit, enough for about 5,000 ads. Searches that return nothing are never charged; they are listed in `FAILED_INPUTS` instead. If you set a maximum cost for a run, the Actor stops as soon as it is reached and keeps everything collected so far.

### Tips for better results

- **Filter on Leboncoin, not afterwards.** Every filter in the link is applied, so a narrow search costs less than a broad one cleaned up later.
- **Go past 3,500 ads** by splitting a search into price bands or departments, one link each.
- **Watch for new ads** by sorting the search by most recent on Leboncoin before copying the link, keeping **Max results per search** small, and scheduling the run.
- **Keep the French proxy.** Leboncoin is protected by DataDome; French residential addresses get through most reliably, and a refused address is replaced at once.

### FAQ, disclaimers and support

**Is it legal to scrape Leboncoin?** The Actor reads only public search pages that anyone can open without an account. Ads can contain personal data, such as a private seller's public name, so the GDPR applies to what you collect and how you use it. Only keep what you need, and check Leboncoin's terms and the law that applies to you. If in doubt, ask a lawyer.

**Why are some fields in French?** Categories, attributes and labels come through exactly as Leboncoin shows them.

**Why do I get fewer ads than Leboncoin's total?** Leboncoin serves at most 100 pages (3,500 ads) for a search, and promoted ads that repeat across pages are kept only once. Split a big search into smaller ones to reach more.

**What happens when Leboncoin refuses a page?** The Actor retries from new addresses. If a later page of a search keeps failing, it keeps the ads collected so far, and the status message says how many searches stopped early. A run fails only when every search was refused.

**What are featured ads?** Advertisers can pay for "À la une" placement, which lifts an ad into the top slots of the result pages it matches, whatever the sort order. Those ads are real results of your search, but they break a newest-first order, so `is_featured` marks them for you to sort or drop. A keyword search also matches words in ad descriptions, which is why a bike search can return a flat with a bike room.

**Do property-type and real-estate links work?** Yes. Leboncoin refuses automated requests filtered by property type, and its real-estate category pages, so the Actor asks for the same search without that filter and keeps only the houses, flats, land or parking you chose. Ads of other types are skipped and not billed. Rare types such as land or parking can be far apart in a broad search, so the Actor stops after 10 pages in a row without one; narrow the search by location or price to reach them.

**Something missing or broken?** Open an issue on the **Issues** tab and it will be looked at quickly. Need a custom feed, such as phone numbers, seller pages or another classifieds site? Get in touch for a custom solution.

# Actor input Schema

## `search_urls` (type: `array`):

Search links, one per line. Search on Leboncoin with whatever filters you want — category, price range, location, condition, delivery — then copy the address bar. Every filter in the link is honoured. Links that are not Leboncoin searches are skipped and listed in the FAILED_INPUTS record.

## `max_results_per_search` (type: `integer`):

Stops after this many ads for each link. Leboncoin shows 35 per page and at most 100 pages (3,500 ads) for one search.

## `proxy_country` (type: `string`):

A 2-letter country code to browse from. France suits Leboncoin best.

## Actor input object example

```json
{
  "search_urls": [
    "https://www.leboncoin.fr/recherche?text=velo",
    "https://www.leboncoin.fr/recherche?category=9&locations=Paris"
  ],
  "max_results_per_search": 20,
  "proxy_country": "FR"
}
```

# Actor output Schema

## `dataset` (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 = {
    "search_urls": [
        "https://www.leboncoin.fr/recherche?text=velo",
        "https://www.leboncoin.fr/recherche?category=9&locations=Paris"
    ],
    "max_results_per_search": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("mina_safwat/leboncoin-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 = {
    "search_urls": [
        "https://www.leboncoin.fr/recherche?text=velo",
        "https://www.leboncoin.fr/recherche?category=9&locations=Paris",
    ],
    "max_results_per_search": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("mina_safwat/leboncoin-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 '{
  "search_urls": [
    "https://www.leboncoin.fr/recherche?text=velo",
    "https://www.leboncoin.fr/recherche?category=9&locations=Paris"
  ],
  "max_results_per_search": 20
}' |
apify call mina_safwat/leboncoin-scraper --silent --output-dataset

```

## MCP server setup

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