# Leboncoin Voiture Scraper — French Used Cars (`noahadler/leboncoin-voiture`) Actor

Scrape Leboncoin.fr Voitures: brand, model, year, km, fuel, gearbox, price EUR and ad URL. FR RESIDENTIAL proxy recommended — Leboncoin blocks datacenter IPs. Keyword or full search URL; clean car rows for comps and leads.

- **URL**: https://apify.com/noahadler/leboncoin-voiture.md
- **Developed by:** [Noah Adler](https://apify.com/noahadler) (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 $2.00 / 1,000 car 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

## Leboncoin Voiture / Cars Scraper 🇫🇷

**Leboncoin.fr Voitures** scraper for **French used cars** (category=2): brand, model, year, mileage, fuel, gearbox, Crit'Air, seller type, city, and price — one clean Dataset row per listing.

Built for **auto dealers**, **pricing intel**, **lead gen (FR)**, and PPE-friendly exports. No browser automation — HTTP + Chrome TLS fingerprint + parse of embedded `__NEXT_DATA__` from search HTML.

> Leboncoin search pages ship ad payloads inside Next.js `__NEXT_DATA__`. This Actor GETs `/recherche?category=2&…`, extracts `props.pageProps.searchData.ads` (~35 per page), and paginates until `maxItems`. **France residential proxy is recommended** (bot protection is strong; default input enables Apify RESIDENTIAL + country FR).

**Why this Actor:** Cars-only vertical · Rich vehicle fields · No Playwright · FR SEO (voiture / occasion) · Cheaper focus than generalist Leboncoin scrapers · CSV / API / webhooks ready

**Store icon:** set the Actor icon in Apify Console (PNG not shipped in this repo).

***

### Table of contents

1. [What this Actor does](#what-this-actor-does)
2. [What you get](#what-you-get)
3. [Features](#features)
4. [Input](#input)
5. [Output example](#output-example)
6. [Output fields](#output-fields)
7. [Quick start (API)](#quick-start-api)
8. [Use cases](#use-cases)
9. [Limitations](#limitations)
10. [FAQ](#faq)
11. [Keywords](#keywords)

***

### What this Actor does

| Step | Action |
|------|--------|
| 1 | Accept `keyword` and/or Voitures `searchUrl`, plus price / sort / `maxItems` |
| 2 | Build `https://www.leboncoin.fr/recherche?category=2&text=…&page=n` |
| 3 | `GET` with `curl_cffi` (`chrome124`) + `Accept-Language: fr-FR` |
| 4 | Parse `__NEXT_DATA__` → `searchData.ads` |
| 5 | Map brand / model / year / km / fuel / gearbox / Crit'Air / seller / geo |
| 6 | Paginate until `maxItems` or empty page |

**Input:** keyword or search URL, max items, optional EUR price band, sort, proxy.\
**Output:** one Dataset row per car ad.

***

### What you get

**Vehicle**

- `brand`, `model`, `year`, `mileageKm`, `fuel`, `gearbox`, `horsePower`, `doors`, `seats`, `color`, `criticalAir`

**Listing / price**

- `listingId`, `title`, `url`, `price`, `priceCents`, `categoryId`, `categoryName`

**Seller / location**

- `sellerType` (`pro` / `private`), `sellerName`, `city`, `zipcode`, `department`, `region`, `latitude`, `longitude`

**Media / dates / raw**

- `thumbUrl`, `imageCount`, `firstPublicationDate`, `indexDate`, `attributes`

**Meta**

- `keyword`, `scrapedAt`, `error`, `errorMessage`

***

### Features

| Capability | Detail |
|------------|--------|
| **Voitures only** | Forced `category=2` — not a general Leboncoin dump |
| **No browser** | `curl_cffi` impersonate `chrome124` (+ optional `browserforge` headers) |
| **Live `__NEXT_DATA__`** | Same payload the public search UI embeds |
| **Keyword or URL** | Free text (`peugeot`, `golf`) or full `searchUrl` override |
| **Price band** | `minPrice` / `maxPrice` → `price=min-max` |
| **Sort** | `relevance` (default), `time`, `price` |
| **Proxy-aware** | Default Apify **RESIDENTIAL** + **FR** (Leboncoin bot protection) |

***

### Input

| Field | Required | Description |
|-------|----------|-------------|
| `keyword` | Cond. | Search text (e.g. `peugeot`, `clio`). Required if `searchUrl` is empty |
| `searchUrl` | Cond. | Full Leboncoin search URL; must be Voitures (`category=2`) |
| `maxItems` | No | Cap (default 50, max 300) |
| `minPrice` / `maxPrice` | No | EUR filters |
| `sort` | No | `relevance` | `time` | `price` |
| `proxyConfiguration` | No | **Default on:** RESIDENTIAL, country FR |

#### Example

```json
{
  "keyword": "peugeot",
  "maxItems": 50,
  "minPrice": 5000,
  "maxPrice": 20000,
  "sort": "time",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "FR"
  }
}
```

#### Example with search URL

```json
{
  "searchUrl": "https://www.leboncoin.fr/recherche?category=2&text=golf&price=3000-15000",
  "maxItems": 30
}
```

***

### Output example

```json
{
  "listingId": "3202619127",
  "title": "Peugeot 2008 PureTech 100 S&S BVM6 - Style",
  "url": "https://www.leboncoin.fr/ad/voitures/3202619127",
  "price": 15790,
  "priceCents": 1579000,
  "categoryId": 2,
  "categoryName": "Voitures",
  "brand": "Peugeot",
  "model": "2008",
  "year": 2023,
  "mileageKm": 24452,
  "fuel": "Essence",
  "gearbox": "Manuelle",
  "horsePower": "100",
  "doors": "5",
  "seats": "5",
  "color": "Noir",
  "criticalAir": "1",
  "sellerType": "pro",
  "sellerName": "Example Auto",
  "city": "Périgueux",
  "zipcode": "24750",
  "department": "Dordogne",
  "region": "Aquitaine",
  "latitude": 45.195,
  "longitude": 0.78,
  "thumbUrl": "https://img.leboncoin.fr/...",
  "imageCount": 20,
  "firstPublicationDate": "2026-09-10 13:38:14",
  "indexDate": "2026-09-20 19:43:19",
  "attributes": {
    "brand": "Peugeot",
    "model": "2008",
    "regdate": "2023",
    "mileage": "24452",
    "fuel": "1",
    "gearbox": "1",
    "critair": "1"
  },
  "keyword": "peugeot",
  "scrapedAt": "2026-09-21T00:00:00Z",
  "error": false,
  "errorMessage": null
}
```

***

### Output fields

| Field | Notes |
|-------|--------|
| `listingId`, `title`, `url` | From `list_id` / `subject` / `url` |
| `price`, `priceCents` | `price[0]` EUR + `price_cents` |
| `brand`, `model`, `year`, `mileageKm` | Attributes `brand`/`model`/`regdate`/`mileage` (flexible aliases) |
| `fuel`, `gearbox`, `color`, `criticalAir` | Prefer Leboncoin `value_label` when present |
| `sellerType` | Normalized `pro` / `private` from `owner.type` |
| `attributes` | Full key→value map from the attributes array |
| `keyword`, `scrapedAt`, `error`, `errorMessage` | Run metadata |

***

### Quick start (API)

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_TOKEN>")
run = client.actor("YOUR_USERNAME/leboncoin-voiture").call(
    run_input={
        "keyword": "peugeot",
        "maxItems": 20,
        "proxyConfiguration": {
            "useApifyProxy": True,
            "apifyProxyGroups": ["RESIDENTIAL"],
            "apifyProxyCountry": "FR",
        },
    }
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item.get("brand"), item.get("model"), item.get("year"), item.get("price"))
```

***

### Use cases

- Suivi des **annonces auto** / **voitures d'occasion** sur Leboncoin
- Benchmark prix par marque / modèle / km / année
- Lead lists for dealers (pro vs particulier)
- Market monitoring for FR used-car verticals
- Niche SEO: **leboncoin voiture** vs generalist marketplace scrapers

***

### Limitations

- **Voitures only:** other Leboncoin categories are out of scope.
- **Search cards:** phone / full detail page enrichment is out of v0.1.
- **Blocking:** Leboncoin bot protection is aggressive — keep **FR RESIDENTIAL** on for production runs. Local smoke may work without proxy.
- **Pagination:** capped by `maxItems` (300) and an internal page safety limit.
- Respect Leboncoin Terms of Service and applicable laws when scraping.

***

### FAQ

**Keyword or URL?**\
Either. `searchUrl` must target Voitures (`category=2`). Keyword alone builds the search URL.

**Why FR residential proxy by default?**\
Leboncoin often challenges datacenter IPs. Residential France maximizes success rate.

**Does this use Playwright?**\
No. HTTP only (`curl_cffi` + optional `browserforge`).

**Fuel / gearbox as codes?**\
Top-level fields prefer human `value_label` (e.g. Hybride, Automatique). Raw codes stay in `attributes`.

**Icon missing?**\
Configure the Actor icon in Apify Console when you publish.

***

### Keywords

leboncoin voiture, leboncoin occasion, leboncoin annonces auto, scraper leboncoin voiture, leboncoin cars scraper, voitures occasion france export, leboncoin catégorie voitures api, scrape leboncoin peugeot golf clio, occasion auto dataset, leboncoin Crit'Air km carburant, PPE leboncoin voiture, france used car lead gen, leboncoin.fr recherche category=2

# Actor input Schema

## `keyword` (type: `string`):

Brand / model / free text as on Leboncoin (e.g. peugeot, golf, clio). Optional if searchUrl is set.

## `searchUrl` (type: `string`):

Optional full www.leboncoin.fr search URL override. Must be Voitures (category=2). When set, keyword/price/sort from the URL are used; input keyword still stored as metadata if provided.

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

Maximum car ads to collect (1–300). ~35 ads per page.

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

Optional minimum price in euros (maps to price=min-max query param).

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

Optional maximum price in euros.

## `sort` (type: `string`):

Leboncoin sort: relevance (site default), time (newest), price.

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

Leboncoin often blocks datacenter IPs. Default: Apify RESIDENTIAL, country France (FR). Disable only for local smoke tests.

## Actor input object example

```json
{
  "keyword": "peugeot",
  "maxItems": 50,
  "sort": "relevance",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "FR"
  }
}
```

# Actor output Schema

## `listings` (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 = {
    "keyword": "peugeot"
};

// Run the Actor and wait for it to finish
const run = await client.actor("noahadler/leboncoin-voiture").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 = { "keyword": "peugeot" }

# Run the Actor and wait for it to finish
run = client.actor("noahadler/leboncoin-voiture").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 '{
  "keyword": "peugeot"
}' |
apify call noahadler/leboncoin-voiture --silent --output-dataset

```

## MCP server setup

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

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/8izRvTDxa4Mbk8gCB/builds/a5Vbcn81WrFuYj3mJ/openapi.json
