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

Scrape leboncoin.fr classifieds: real estate, cars, jobs and more. Get price, surface, rooms, GPS, images, seller type and all attributes as structured JSON, ready for Sheets or your CRM. Filters by location, price, rooms and seller. Uses the app's JSON API, no browser. Pay per result.

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

## Pricing

from $1.00 / 1,000 dataset items

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/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 Scraper

Extract structured classified listings from **leboncoin.fr**, the French
classifieds marketplace, at scale. The actor calls the same JSON API the leboncoin
mobile app uses, so there is no browser automation and no HTML parsing. It works
across **all categories** (real estate, cars, jobs and more) with filters for
location, price, surface, rooms and seller type, and returns the full ad data.

### Who it's for

- **Real-estate investors & analysts** — monitor prices and inventory, build yield
  and market-trend datasets.
- **Agencies & lead-gen teams** — pull seller lists (private vs professional) with
  location and category coverage.
- **PropTech / SaaS developers** — a dependable listings feed to power apps,
  dashboards, and alerts.
- **Researchers & data teams** — GPS-mapped, structured market data.

### Output fields

| Field                                | Type    | Description                                 |
| ------------------------------------ | ------- | ------------------------------------------- |
| `list_id`                            | integer | Unique listing id                           |
| `url`                                | string  | Listing URL                                 |
| `subject` / `body`                   | string  | Title and description                       |
| `category_id` / `category_name`      | string  | Leboncoin category                          |
| `price` / `price_cents`              | integer | Price in euros / cents                      |
| `owner_name` / `owner_type`          | string  | Seller name and type (`private`/`pro`)      |
| `owner_store_id` / `owner_siren`     | string  | Professional seller identifiers             |
| `city` / `zipcode` / `district`      | string  | Localisation                                |
| `department_id` / `region_id`        | string  | Administrative area ids                     |
| `lat` / `lng`                        | number  | GPS coordinates                             |
| `real_estate_type`                   | string  | House, apartment, land…                     |
| `square` / `rooms` / `bedrooms`      | string  | Surface (m²) and rooms                      |
| `energy_rate` / `ges`                | string  | DPE / GES energy ratings                    |
| `nb_images` / `images` / `thumbnail` | array   | Photo URLs                                  |
| `has_phone`                          | boolean | Whether the seller exposes a phone          |
| `attributes` / `attribute_labels`    | object  | Every raw attribute (key→value / key→label) |

### High-value use cases

- **Investment screening** — pull all apartments for sale in a department under a
  price ceiling, with m², rooms and DPE, straight into a spreadsheet.
- **Lead generation** — collect professional sellers in a region for outreach.
- **Price intelligence** — schedule daily runs to track price changes and new
  inventory in a market.
- **Geo analysis** — map inventory with per-ad GPS coordinates.
- **Vehicle market data** — switch `category` to cars (`2`) or motorbikes; the vehicle
  specs (brand, model, mileage, fuel, gearbox, year) come in the `attributes` object.

### Input parameters

| Field                     | Type    | Default         | Description                                  |
| ------------------------- | ------- | --------------- | -------------------------------------------- |
| `category`                | string  | `9`             | Category id (9 sales, 10 rentals, 2 cars…)   |
| `keywords`                | string  | —               | Free-text query                              |
| `departmentIds`           | array   | —               | e.g. `["75","92"]`                           |
| `regionIds`               | array   | —               | e.g. `["12"]`                                |
| `geo`                     | object  | —               | `{ "lat":48.85, "lng":2.35, "radiusKm":10 }` |
| `realEstateTypes`         | array   | —               | house / apartment / land / parking / other   |
| `priceMin` / `priceMax`   | integer | —               | Price range (€)                              |
| `squareMin` / `squareMax` | integer | —               | Surface range (m²)                           |
| `roomsMin` / `roomsMax`   | integer | —               | Rooms range                                  |
| `ownerType`               | string  | `all`           | `all` / `private` / `pro`                    |
| `sortBy` / `sortOrder`    | string  | `time` / `desc` | Sorting                                      |
| `fetchDetails`            | boolean | `false`         | Enrich each ad with its full detail payload  |
| `maxItems`                | integer | `100`           | Result cap                                   |
| `proxyConfiguration`      | object  | Apify RESIDENTIAL, FR | Proxy used for the requests            |

### Example input

```json
{
    "category": "9",
    "departmentIds": ["75"],
    "priceMax": 600000,
    "roomsMin": 2,
    "sortBy": "time",
    "maxItems": 100
}
```

### Example output (one row)

```json
{
    "list_id": 3215089029,
    "url": "https://www.leboncoin.fr/ad/ventes_immobilieres/3215089029",
    "subject": "Appartement 5 pièces 140 m²",
    "price": 1855000,
    "city": "Paris",
    "zipcode": "75116",
    "department_name": "Paris",
    "lat": 48.87617,
    "lng": 2.271965,
    "real_estate_type": "Appartement",
    "square": "140",
    "rooms": "5",
    "owner_type": "pro",
    "nb_images": 10,
    "has_phone": true
}
```

### Scheduling & integrations

Schedule runs (hourly/daily) from the Apify Console, or trigger via API/webhook.
Export to **Google Sheets, Make, Zapier, Amazon S3**, or pull results through the
Apify API/SDK. Every field lands as clean JSON.

### AI assistants (MCP)

Prefer to query leboncoin from **Claude, Cursor, or a custom agent**? Use the
companion **Leboncoin MCP** actor, which exposes live search / detail / seller
tools over the Model Context Protocol.

### FAQ

**How many results can I get?** As many as the search returns; the actor follows
leboncoin's cursor until the result set ends or `maxItems` is reached. Use narrower
filters (department, price band) to slice very large markets.

**How fresh is the data?** Live. Every run queries leboncoin in real time.

**Do I need proxies?** Leboncoin sits behind DataDome, and the actor is tuned for the
default setting: Apify RESIDENTIAL proxies with country France. Requests from
datacenter or non-French exits are challenged much more often. When a request is
challenged, the actor automatically switches to a new exit IP and a new session and
carries on, so a run may log one or two rotations. If it still cannot get through
after several rotations it stops and reports the problem instead of returning empty
data.

**Why are some fields empty?** Fields that do not apply to a category are `null`
(for example `rooms` on a car ad, or `furnished` on a sale). Vehicle and other
category-specific attributes are always available in `attributes` / `attribute_labels`.

**Do sponsored ads appear?** No. Sponsored ads leboncoin injects into result lists are
switched off, so sorting by price or date is clean.

**Can I get seller phone numbers?** The dataset includes a `has_phone` flag; actual
phone numbers require an authenticated leboncoin account and are out of scope.

**Is scraping legal?** You are responsible for complying with leboncoin's terms and
applicable law. Scrape only public data and respect rate limits and privacy rules.

# Actor input Schema

## `category` (type: `string`):

Leboncoin category id to search. Real estate: 9 = sales, 10 = rentals, 11 = flat-shares, 13 = offices/shops, 12 = seasonal. Others: 2 = cars, 3 = motorbikes, 1 = vehicles, 8 = real estate (all).

## `keywords` (type: `string`):

Optional free-text query (e.g. 'appartement terrasse').

## `departmentIds` (type: `array`):

Filter by French department numbers, e.g. \["75", "92"] for Paris & Hauts-de-Seine.

## `regionIds` (type: `array`):

Filter by region ids, e.g. \["12"] for Île-de-France.

## `geo` (type: `object`):

Radius search around a point: { "lat": 48.8566, "lng": 2.3522, "radiusKm": 10 }.

## `realEstateTypes` (type: `array`):

Property types (real-estate categories only).

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

Minimum price in euros.

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

Maximum price in euros.

## `squareMin` (type: `integer`):

Minimum living surface in m².

## `squareMax` (type: `integer`):

Maximum living surface in m².

## `roomsMin` (type: `integer`):

Minimum number of rooms.

## `roomsMax` (type: `integer`):

Maximum number of rooms.

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

Filter by seller type.

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

Field to sort results by.

## `sortOrder` (type: `string`):

Ascending or descending order.

## `fetchDetails` (type: `boolean`):

Also fetch each ad's full detail payload (slower, more API calls).

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

Stop after this many listings.

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

Leboncoin blocks datacenter IPs. Default is Apify RESIDENTIAL from France; each DataDome challenge rotates to a new exit automatically (proxy traffic is billed to your plan).

## Actor input object example

```json
{
  "category": "9",
  "departmentIds": [
    "75"
  ],
  "ownerType": "all",
  "sortBy": "time",
  "sortOrder": "desc",
  "fetchDetails": false,
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "FR"
  }
}
```

# Actor output Schema

## `results` (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 = {
    "departmentIds": [
        "75"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "FR"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("axlymxp/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 = {
    "departmentIds": ["75"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "FR",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("axlymxp/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 '{
  "departmentIds": [
    "75"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "FR"
  }
}' |
apify call axlymxp/leboncoin-scraper --silent --output-dataset

```

## MCP server setup

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