# Leboncoin Scraper - Listings, Prices & Sellers (`khadinakbar/leboncoin-scraper`) Actor

Scrape public Leboncoin listings from search URLs or keywords for French marketplace research, price tracking, and lead discovery. Returns price, location, seller, images, attributes, source URL, and scrapedAt. Charged $0.002/listing plus platform usage.

- **URL**: https://apify.com/khadinakbar/leboncoin-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** E-commerce, Automation, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 leboncoin listing returneds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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

## Leboncoin Scraper - Listings, Prices & Sellers

**Leboncoin Scraper** extracts public classified listings from leboncoin.fr search pages, ad URLs, or simple keyword searches. Use it for French marketplace research, price tracking, seller discovery, regional inventory monitoring, and structured exports for AI agents or BI workflows.

Use this actor when you need one clean dataset row per public listing with title, price, category, location, seller, images, attributes, source URL, and extraction timestamp. Do not use it for buyer inbox automation, sending seller messages, login-only account data, or private user data.

### What Data Can I Extract?

| Field | Description |
|---|---|
| `listingId`, `listingUrl`, `title` | Stable listing identity and public ad URL |
| `priceEur`, `currency` | Advertised price in EUR when shown |
| `categoryId`, `categoryName` | Leboncoin category metadata |
| `city`, `postalCode`, `department`, `region` | Public location fields from the page payload |
| `sellerName`, `sellerType`, `sellerId` | Public seller metadata when available |
| `attributes` | Category-specific public fields such as condition, rooms, surface, mileage, shipping, or energy class |
| `imageUrls`, `firstImageUrl` | Public listing image URLs |
| `description` | Public ad body when `includeDetails` and `responseFormat=detailed` are enabled |
| `sourceSearchUrl`, `scrapedAt`, `parseWarnings` | Provenance, freshness, and non-fatal diagnostics |

### How Much Will It Cost?

This actor uses Pay per event pricing plus Apify platform usage pass-through.

| Run size | Event charge |
|---|---:|
| 10 listings | about $0.020 |
| 50 listings | about $0.100 |
| 500 listings | about $1.000 |

Pricing events:

- `apify-actor-start`: $0.00005 per GB of configured memory at run start.
- `leboncoin-listing`: $0.002 per validated listing written to the dataset.

Compute and proxy usage are charged separately by Apify under Pay per event + usage. The actor logs the maximum event-charge cap at the start of every run.

### How To Use It

#### Scrape by Leboncoin URL

Paste the exact Leboncoin search URL after applying filters in the browser. This is best for city, radius, price, seller, or category filters that Leboncoin encodes in the URL.

```json
{
  "startUrls": [
    {
      "url": "https://www.leboncoin.fr/recherche?text=iphone&category=17"
    }
  ],
  "maxItems": 50,
  "maxPages": 5,
  "includeDetails": false,
  "responseFormat": "concise"
}
```

#### Scrape by keyword

```json
{
  "searchQueries": ["velo electrique"],
  "categoryId": "2",
  "priceMin": 500,
  "priceMax": 2500,
  "ownerType": "all",
  "maxItems": 100
}
```

#### Fetch Detail Fields

Set `includeDetails` to `true` and `responseFormat` to `detailed` when you need public ad descriptions and richer attributes. This visits each ad page, so it uses more browser/proxy time.

### Output Example

```json
{
  "listingId": "3055076563",
  "listingUrl": "https://www.leboncoin.fr/ad/arts_de_la_table/3055076563",
  "title": "Boite coffre",
  "categoryId": "45",
  "categoryName": "Arts de la table",
  "priceEur": 4,
  "currency": "EUR",
  "city": "Toulouse",
  "postalCode": "31000",
  "sellerName": "eva2019",
  "sellerType": "private",
  "firstImageUrl": "https://img.leboncoin.fr/api/v1/lbcpb1/images/example.jpg?rule=ad-large",
  "detailFetched": false,
  "sourceSearchUrl": "https://www.leboncoin.fr/recherche?text=iphone&category=17",
  "scrapedAt": "2026-07-15T12:00:00.000Z"
}
```

### API Example

```bash
curl -X POST "https://api.apify.com/v2/acts/khadinakbar~leboncoin-scraper/runs" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "searchQueries": ["iphone"],
    "categoryId": "17",
    "maxItems": 25
  }'
```

### MCP And AI Agents

Through the Apify MCP Server, an agent can call this actor when the user asks for current Leboncoin listings, French marketplace prices, seller metadata, or public listing attributes. The actor is read-only: it does not send messages, log in, alter listings, or contact sellers.

Good agent requests:

- "Find 20 Leboncoin iPhone listings under EUR 500 and return seller type and city."
- "Monitor Leboncoin vehicle listings from this search URL and export prices."
- "Get detailed public fields for these Leboncoin ad URLs."

Avoid using this actor for private account inboxes, buyer automation, seller outreach, or scraping data behind authentication.

### Reliability Notes

Leboncoin uses DataDome anti-bot protection. This actor runs a Camoufox browser through Apify Residential proxies, extracts the Next.js page JSON, and retries sources through fresh sessions. If all configured routes are blocked and no useful listings are returned, the run ends as `UPSTREAM_FAILED` with a clear `OUTPUT` and `RUN_SUMMARY`.

### Related Actors

- Use [Vinted Scraper](https://apify.com/khadinakbar/vinted-scraper) when the user is researching secondhand fashion listings instead of general Leboncoin classifieds.
- Use [Facebook Marketplace Scraper](https://apify.com/khadinakbar/facebook-marketplace-scraper) when the target inventory is on Facebook Marketplace rather than Leboncoin.
- Use [Idealista Scraper](https://apify.com/khadinakbar/idealista-scraper) when the workflow is specifically Iberian real estate instead of French classifieds.

### FAQ

#### Can I scrape city or radius filters?

Yes. Apply those filters on leboncoin.fr, copy the resulting search URL, and paste it into `startUrls`. Leboncoin location parameters are more reliable when copied from the website than reconstructed manually.

#### Does this extract phone numbers?

No phone-number extraction is promised. The actor may return `hasPhone` when Leboncoin exposes that flag, but it is designed for public listing data rather than contact reveal flows.

#### Can I use this with the Apify API?

Yes. Run `khadinakbar/leboncoin-scraper` with `startUrls` or `searchQueries`, then read the default dataset as JSON, CSV, Excel, or through the Apify client libraries.

#### Can I use this through an MCP server?

Yes. The dataset schema, output schema, and compact records are designed for Apify MCP clients and AI agents that need structured marketplace data.

#### Is it legal to scrape Leboncoin?

This actor is intended for publicly available listing data and moderate, respectful collection. You are responsible for complying with applicable laws, Leboncoin terms, privacy rules, and GDPR obligations for your use case.

### Your Feedback

Open an issue on the actor page with the input URL, run ID, and the field you expected if a listing shape changes or a result looks incomplete.

# Actor input Schema

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

Use this when you already have a Leboncoin search URL with exact filters or one or more direct ad URLs. Pass URL objects such as {"url":"https://www.leboncoin.fr/recherche?text=iphone\&category=17"}. The actor accepts /recherche pages, /ad/... pages, and legacy ad URLs. This is not a place for URLs from other marketplaces.

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

Use this when you want the actor to build Leboncoin search URLs from keywords. Enter one query per line, for example iphone or velo electrique. It defaults to an empty list because pasted start URLs preserve exact filters better. This is not a location filter; use a full start URL for complex Leboncoin locations.

## `categoryId` (type: `string`):

Use this with search queries to choose a Leboncoin category. Select one supported category such as Electronics (17) or Vehicles (2). It defaults to All categories and does not change pasted start URLs. This is not a free-text category name.

## `priceMin` (type: `integer`):

Use this with search queries to add a minimum price filter in euros. Enter an integer such as 100. Leave it blank for no minimum price. This does not override prices already encoded in a pasted Leboncoin start URL.

## `priceMax` (type: `integer`):

Use this with search queries to add a maximum price filter in euros. Enter an integer such as 500. Leave it blank for no maximum price. This does not override prices already encoded in a pasted Leboncoin start URL.

## `ownerType` (type: `string`):

Use this with search queries to filter private or professional sellers. Choose all, private, or pro, for example private. It defaults to all sellers. This does not change a pasted start URL that already contains seller filters.

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

Use this with search queries to choose the Leboncoin sort mode. Choose time for newest listings or price for price sorting. It defaults to time with descending order. This is not applied to pasted start URLs because those URLs already carry their filters.

## `order` (type: `string`):

Use this with search queries to choose ascending or descending order. Choose desc for newest/highest first or asc for oldest/lowest first. It defaults to desc. This is not a pagination setting.

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

Use this to cap the number of listing records written to the dataset. Enter an integer such as 50. It defaults to 50 and accepts 1 through 1000. This is also the main pay-per-event cap, not a page count.

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

Use this to cap how many Leboncoin result pages are visited for each search URL or query. Enter an integer such as 5. It defaults to 5 and accepts 1 through 100. This is not the result limit; maxItems still controls saved and charged listings.

## `includeDetails` (type: `boolean`):

Use this when you need full public descriptions and richer ad attributes beyond search-result data. Set true or false, for example false. It defaults to false to keep runs faster and cheaper on proxy usage. This is not required for title, price, location, seller, category, and image fields from search results.

## `responseFormat` (type: `string`):

Use this to choose compact or richer records for AI agents and exports. Choose concise or detailed, for example concise. It defaults to concise and limits descriptions, attributes, and image arrays. This does not change the core listing ID, URL, title, price, location, seller, and timestamp fields.

## `proxyCountry` (type: `string`):

Use this to select the country for the actor-managed residential browser session. Choose a supported ISO code such as FR. It defaults to France because Leboncoin is geo-targeted and DataDome protected. This is not a Leboncoin location filter; use a full search URL for city or radius filters.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.leboncoin.fr/recherche?text=iphone&category=17"
    }
  ],
  "searchQueries": [
    "iphone",
    "velo electrique"
  ],
  "categoryId": "17",
  "priceMin": 100,
  "priceMax": 500,
  "ownerType": "all",
  "sort": "time",
  "order": "desc",
  "maxItems": 50,
  "maxPages": 5,
  "includeDetails": false,
  "responseFormat": "concise",
  "proxyCountry": "FR"
}
```

# Actor output Schema

## `listings` (type: `string`):

Normalized public Leboncoin listing records returned by this run.

## `output` (type: `string`):

Compact outcome, counts, warnings, and charged event totals.

## `runSummary` (type: `string`):

Detailed diagnostics, source coverage, and billing information for this run.

# 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.leboncoin.fr/recherche?text=iphone&category=17"
        }
    ],
    "searchQueries": [
        "iphone"
    ],
    "categoryId": "17",
    "ownerType": "all",
    "sort": "time",
    "order": "desc",
    "maxItems": 50,
    "maxPages": 5,
    "includeDetails": false,
    "responseFormat": "concise",
    "proxyCountry": "FR"
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/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 = {
    "startUrls": [{ "url": "https://www.leboncoin.fr/recherche?text=iphone&category=17" }],
    "searchQueries": ["iphone"],
    "categoryId": "17",
    "ownerType": "all",
    "sort": "time",
    "order": "desc",
    "maxItems": 50,
    "maxPages": 5,
    "includeDetails": False,
    "responseFormat": "concise",
    "proxyCountry": "FR",
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/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 '{
  "startUrls": [
    {
      "url": "https://www.leboncoin.fr/recherche?text=iphone&category=17"
    }
  ],
  "searchQueries": [
    "iphone"
  ],
  "categoryId": "17",
  "ownerType": "all",
  "sort": "time",
  "order": "desc",
  "maxItems": 50,
  "maxPages": 5,
  "includeDetails": false,
  "responseFormat": "concise",
  "proxyCountry": "FR"
}' |
apify call khadinakbar/leboncoin-scraper --silent --output-dataset

```

## MCP server setup

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