# Leboncoin Scraper — France Classifieds Data (`blackfalcondata/leboncoin-scraper`) Actor

Scrape Leboncoin.fr — France's largest online classifieds marketplace for real estate, vehicles, and goods. Extract structured listings with prices and locations, seller contact details, and incremental change tracking for new ads.

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

## Pricing

from $0.69 / 1,000 results

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

### What does Leboncoin Scraper do?

Leboncoin Scraper extracts structured listing data from [leboncoin.fr](https://leboncoin.fr), France's largest classifieds marketplace — across real estate, vehicles, and consumer goods. Each result carries the price, location, and seller details, with typed vehicle fields (make, model, year, mileage) and real-estate fields (surface, rooms). It supports keyword and location search, paste-mode URLs, seller watchlists, and incremental tracking that returns only new or changed ads.

**New to Apify?** [Sign up free](https://console.apify.com/sign-up?fpr=1h3gvi&fp_sid=ctaplain) and use the included $5 monthly platform credit to test this actor.

### Key features

<!-- KEY_FEATURES:START -->
- **🗂️ Every Leboncoin category, one actor** — one actor covers every Leboncoin vertical — real estate, vehicles and consumer goods. Set one `category` or leave it empty. Typed `realEstate`, `vehicle` and `generic` objects keep cross-vertical columns clean.
- **👁️ Seller watchlist** — pass seller IDs to `watchSellerIds` and each run returns only those sellers' current inventory — monitor a competitor dealership, agency or busy private seller. Pairs with incremental mode for change-only output.
- **🏢 Agency & professional-seller intelligence** — every listing identifies its seller — `sellerName`, `sellerType` (pro vs private), `storeName`, `activitySector`, French `sellerSiren`, and store `ratingScore`/`ratingCount`. Switch `mode` to `agencies` to scrape professional pages directly, or filter by `ownerType`.
- **📧 Email + phone extraction** — pull seller contacts into structured fields. `includePhone` adds `revealedPhone` (`hasPhone` flag); `extractContacts` mines `extractedPhones`, `extractedEmails` and `extractedUrls` from listing and seller profile — lead lists ready without a second pass.
- **♻️ Incremental mode** — daily runs emit only listings that are new or whose price/condition changed since last run. Perfect for inventory-diff dashboards and competitive pricing alerts. Saves 80–95% on recurring monitoring.
- **🔔 Notifications** — telegram / Slack / Discord / WhatsApp / webhook alerts on each run. Combine with incremental to ping only when prices or inventory actually move.
- **🔗 Paste-mode** — paste any leboncoin.fr URL — single-listing pages, search-results, or category SEO URLs. Build the filter you want in the browser, copy, paste; the actor parses every query param.
- **📋 Detail enrichment** — two-stage scraping — list first, then enrich each listing with the full detail-page payload. One input toggle controls the depth.
- **📦 Compact mode** — light payload with core fields only — comparable rows across listings without HTML or metadata overhead. Perfect for pricing dashboards.
<!-- KEY_FEATURES:END -->

### What data can you extract from Leboncoin?

Each result includes Core property fields (`vertical`, `listingId`, `url`, `title`, `price`, `priceCents`, `currency`, and `categoryId`, and more), detail fields when enrichment is enabled (`description`), and contact information (`extractedPhones`, `extractedEmails`, `hasPhone`, and `revealedPhone`). In standard mode, all fields are always present — unavailable data points are returned as `null`, never omitted. In compact mode, only core fields are returned.

Enable detail enrichment in the input to get richer fields such as full descriptions and contact information where the source provides them.

### Input

The main inputs are a search keyword and a result limit. Additional filters and options are available in the input schema.

Key parameters:

- **`query`** — Listing search keywords. Enter a single term or a JSON array for multi-query runs (e.g. ["vélo", "trottinette"]).
- **`category`** — Limit results to a specific Leboncoin category. Leave empty to search across all categories.
- **`mode`** — Switch between standard listings and professional seller/agency pages. (default: `"listings"`)
- **`sort`** — Order in which results are returned. (default: `"time"`)
- **`cityId`** — Internal city identifier. Overrides cityName and lat/lon when set. Most users should use cityName instead.
- **`cityName`** — City name (e.g. "Paris", "Lyon"). Resolved to the nearest known city. Ignored when cityId is set.
- **`lat`** — GPS latitude. Pair with lon. Ignored when cityId or cityName is set.
- **`lon`** — GPS longitude. Pair with lat.
- **`radiusKm`** — Search radius in kilometres around the resolved city.
- **`allowLowConfidence`** — When enabled, accepts a fuzzy or GPS-approximate city match instead of failing. Disable to prevent silent wrong-location results. (default: `false`)
- **`ownerType`** — Filter by seller type: private individuals, professional sellers, or both. (default: `"all"`)
- **`priceMin`** — Only return listings priced at or above this value.
- ...and 30 more parameters

### Input examples

**Basic search** — Keyword-driven search with a result cap.

→ Full payload per result — all standard fields populated where the source provides them.

```json
{
  "mode": "listings",
  "query": "vélo",
  "maxResults": 50
}
````

**Incremental tracking** — Only emit properties that changed since the previous run with this `stateKey`.

→ First run builds the baseline state. Subsequent runs emit only records that are new or whose tracked content changed. Set `emitUnchanged: true` to include unchanged records as well.

```json
{
  "query": "vélo",
  "maxResults": 200,
  "incrementalMode": true,
  "stateKey": "vélo-tracker"
}
```

**Compact filtered output** — Combine filters with compact mode for a lightweight AI-agent or MCP data source.

→ Core fields only — ideal for piping into LLMs or downstream tools without token overhead.

```json
{
  "query": "vélo",
  "category": "1",
  "maxResults": 50,
  "compact": true
}
```

### Output

Each run produces a dataset of structured property records. Results can be downloaded as JSON, CSV, or Excel from the Dataset tab in Apify Console.

### Example property record

```json
{
  "vertical": "generic",
  "listingId": "3128059187",
  "url": "https://www.leboncoin.fr/ad/telephones_objets_connectes/3128059187",
  "title": "IPhone 13 - Non reconditionné original 100%",
  "price": 190,
  "priceCents": 19000,
  "currency": "EUR",
  "categoryId": "17",
  "categoryName": "Téléphones & Objets connectés",
  "adType": "offer",
  "status": "active",
  "publishedAt": "2026-05-15 15:02:14",
  "indexDate": "2026-05-15 15:02:14",
  "contentHash": "84ae6748e9d37943696294fa83df3488e2f917b12a5551313e0409c6e71a4545",
  "city": "Paris",
  "zipcode": "75011",
  "department": "Paris",
  "region": "Ile-de-France",
  "lat": 48.86597,
  "lng": 2.36673,
  "sellerName": "FUTURX",
  "sellerType": "pro",
  "sellerId": "be2ed4b7-2448-409b-8747-953cb5ea1a25",
  "storeId": "81199770",
  "storeName": "FUTURX",
  "activitySector": "3",
  "noSalesmen": true,
  "sellerSiren": "983689290",
  "description": "Bonjour,\nNous sommes un magasin situé sur Paris 11 Eme.\nNos iPhone 13 sont à partir de 190€\nDisponible au 6 Rue voltaire 75011.\nLivraison dans toute la France 🇫🇷 \nFUTUR X. \nOuvert du lundi au samedi...",
  "favorites": 213,
  "imagesCount": 2,
  "imageUrls": [
    "https://img.leboncoin.fr/api/v1/lbcpb1/images/2e/7e/f2/2e7ef2685555445472a1f7781ee117bd48961e96.jpg?rule=ad-image",
    "https://img.leboncoin.fr/api/v1/lbcpb1/images/0c/9a/87/0c9a8766a043be0e62470b7c83d0e565ed3c9ca4.jpg?rule=ad-image"
  ],
  "thumbUrls": [
    "https://img.leboncoin.fr/api/v1/lbcpb1/images/2e/7e/f2/2e7ef2685555445472a1f7781ee117bd48961e96.jpg?rule=ad-thumb",
    "https://img.leboncoin.fr/api/v1/lbcpb1/images/0c/9a/87/0c9a8766a043be0e62470b7c83d0e565ed3c9ca4.jpg?rule=ad-thumb"
  ],
  "largeUrls": [
    "https://img.leboncoin.fr/api/v1/lbcpb1/images/2e/7e/f2/2e7ef2685555445472a1f7781ee117bd48961e96.jpg?rule=ad-large",
    "https://img.leboncoin.fr/api/v1/lbcpb1/images/0c/9a/87/0c9a8766a043be0e62470b7c83d0e565ed3c9ca4.jpg?rule=ad-large"
  ],
  "hasPhone": true,
  "attributes": {
    "activity_sector": "3",
    "rating_score": "0.97",
    "rating_count": "6",
    "stock_quantity": "1",
    "country_isocode3166": "FR",
    "condition": "tresbonetat",
    "phone_product": "smartphone",
    "phone_brand": "apple",
    "phone_model": "iphone13",
    "phone_color": "noir",
    "phone_memory": "128go",
    "shippable": "false",
    "is_import": "false",
    "spare_parts_availability": "1"
  }
}
```

### Incremental fields

When incremental mode is on, each record also carries:

- `changeType` — one of `NEW`, `UPDATED`, `UNCHANGED`, `REAPPEARED`, `EXPIRED`. Default output covers `NEW` / `UPDATED` / `REAPPEARED`; set `emitUnchanged: true` or `emitExpired: true` to opt into the others.
- `firstSeenAt`, `lastSeenAt` — ISO-8601 timestamps tracking the listing across runs.
- `isRepost`, `repostOfId`, `repostDetectedAt` — populated when a new listing matches the tracked content of a previously expired one. Set `skipReposts: true` to drop detected reposts from the output.

### How to scrape Leboncoin

1. Go to [Leboncoin Scraper](https://apify.com/blackfalcondata/leboncoin-scraper?fpr=1h3gvi) in Apify Console.
2. Enter a search keyword.
3. Set `maxResults` to control how many results you need.
4. Enable `includeDetails` if you need full descriptions, contact info.
5. Click **Start** and wait for the run to finish.
6. Export the dataset as JSON, CSV, or Excel.

### Use cases

- Extract property data from Leboncoin for market research and competitive analysis.
- Track pricing trends across regions and categories over time.
- Monitor new and changed properties on scheduled runs without processing the full dataset every time.
- Feed structured data into AI agents, MCP tools, and automated pipelines using compact mode.
- Export clean, structured data to dashboards, spreadsheets, or data warehouses.
- Benchmark seller / dealer reputation using rating fields.

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

Leboncoin Scraper uses [pay-per-event](https://docs.apify.com/platform/actors/paid-actors/pay-per-event) pricing. You pay a small fee when the run starts and then for each result that is actually produced.

- **Run start:** $0.005 per run
- **Per property (primary event):** $0.00069

You are billed only for the events your run actually triggers. Prices below are the Free plan tier.

| Event | Price (Free tier) | Charged when |
|---|---|---|
| Actor Start | $0.005 (one-time) | Charged when the Actor starts running. Number of events charged depends on Actor memory (one event per GB, minimum one event). |
| Result (primary) | $0.00069 | Single result in the default dataset. |
| Phone Number Revealed | $0.004 | Charged once each time a seller phone number is successfully revealed and returned in a result. |

Example costs (primary event only — other events above add cost when they fire):

- 10 results: **$0.012**
- 25 results: **$0.022**
- 100 results: **$0.074**
- 200 results: **$0.14**
- 500 results: **$0.35**

#### Example: recurring monitoring savings

These examples compare full re-scrapes with incremental runs at different churn rates. Churn is the share of properties that are new or whose tracked content changed since the previous run. Actual churn depends on your query breadth, source activity, and polling frequency — the scenarios below are examples, not predictions.

Example setup: 100 results per run, daily polling (30 runs/month). Event-pricing examples scale linearly with result count.

Numbers below are for the primary **Result** event. Other events (**Phone Number Revealed**) are billed separately when they fire.

| Churn rate | Full re-scrape run cost | Incremental run cost | Savings vs full re-scrape | Monthly cost after baseline |
|---|---:|---:|---:|---:|
| 5% — stable niche query | $0.07 | $0.00845 | $0.07 (89%) | $0.25 |
| 15% — moderate broad query | $0.07 | $0.02 | $0.06 (79%) | $0.46 |
| 30% — high-volume aggregator | $0.07 | $0.03 | $0.05 (65%) | $0.77 |

Full re-scrape monthly cost at daily polling: $2.22. First month with incremental costs $0.32 / $0.52 / $0.82 for the 5% / 15% / 30% scenarios because the first run builds baseline state at full cost before incremental savings apply.

Platform usage (compute and proxies) is billed separately by Apify based on actual consumption. Incremental runs consume less on result processing, though fixed per-run overhead stays the same.

### FAQ

#### How many results can I get from Leboncoin?

The number of results depends on the search query and available properties on Leboncoin. Use the `maxResults` parameter to control how many results are returned per run.

#### Does Leboncoin Scraper support recurring monitoring?

Yes. Enable incremental mode to only receive new or changed properties on subsequent runs. This is ideal for scheduled monitoring where you want to track changes over time without re-processing the full dataset.

#### Can I integrate Leboncoin Scraper with other apps?

Yes. Leboncoin Scraper works with Apify's [integrations](https://apify.com/integrations?fpr=1h3gvi) to connect with tools like Zapier, Make, Google Sheets, Slack, and more. You can also use webhooks to trigger actions when a run completes.

#### Can I use Leboncoin Scraper with the Apify API?

Yes. You can start runs, manage inputs, and retrieve results programmatically through the [Apify API](https://docs.apify.com/api/v2). Client libraries are available for JavaScript, Python, and other languages.

#### Can I use Leboncoin Scraper through an MCP Server?

Yes. Apify provides an [MCP Server](https://apify.com/apify/actors-mcp-server?fpr=1h3gvi) that lets AI assistants and agents call this actor directly. Use compact mode, `descriptionMaxLength`, a single `descriptionFormat`, and `excludeEmptyFields` to keep payloads manageable for LLM context windows.

#### Is it legal to scrape Leboncoin?

This actor extracts publicly available data from Leboncoin. Web scraping of public information is generally considered legal, but you should always review the target site's terms of service and ensure your use case complies with applicable laws and regulations, including GDPR where relevant.

#### Your feedback

If you have questions, need a feature, or found a bug, please [open an issue](https://apify.com/blackfalcondata/leboncoin-scraper/issues?fpr=1h3gvi) on the actor's page in Apify Console. Your feedback helps us improve.

### You might also like

- [Airbnb Realtime API — Live Listing, Reviews & Search Lookups](https://apify.com/blackfalcondata/airbnb-realtime?fpr=1h3gvi) — Real-time Airbnb lookups via a persistent standby server — fetch a single listing, its reviews.
- [Airbnb Scraper — Listings, Prices, Reviews & Host Data](https://apify.com/blackfalcondata/airbnb-scraper?fpr=1h3gvi) — Scrape Airbnb stays — listings with price, ratings, amenities, host info, photos, GPS and full.
- [Airbnb URL Scraper — Fast, Cheap Listing URL Discovery](https://apify.com/blackfalcondata/airbnb-url-scraper?fpr=1h3gvi) — Discover every Airbnb listing URL for a city, neighborhood or search — the cheapest way to.
- [Idealista Scraper — Listings, Phone & Agency Data](https://apify.com/blackfalcondata/idealista-scraper?fpr=1h3gvi) — Scrape Idealista listings across Spain, Portugal, and Italy with full pricing, photos, GPS, agent.
- [Immowelt Scraper — German Real Estate Listings](https://apify.com/blackfalcondata/immowelt-scraper?fpr=1h3gvi) — Scrape immowelt.de — one of Germany's largest residential property portals — and pull every active.
- [LeBonCoin Real Estate Scraper - Property Listings](https://apify.com/blackfalcondata/leboncoin-real-estate-scraper?fpr=1h3gvi) — Scrape LeBonCoin real estate listings with property type, surface, rooms, bedrooms, price, DPE.
- [Metrocuadrado Scraper — Colombia Real Estate Listings](https://apify.com/blackfalcondata/metrocuadrado-scraper?fpr=1h3gvi) — Scrape Metrocuadrado property listings across Colombia with full pricing, price-per-m², area,.
- [Realtor Scraper — US Real Estate Listings & Property Data](https://apify.com/blackfalcondata/realtor-scraper?fpr=1h3gvi) — Scrape US real estate from realtor.com — for-sale, for-rent & recently-sold listings with price &.

### Getting started with Apify

New to Apify? [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=1h3gvi\&fp_sid=ctaplain) — no credit card required.

1. Sign up — $5 platform credit included
2. Open this actor and configure your input
3. Click **Start** — export results as JSON, CSV, or Excel

Need more later? [See Apify pricing](https://apify.com/pricing?fpr=1h3gvi).

# Actor input Schema

## `query` (type: `string`):

Listing search keywords. Enter a single term or a JSON array for multi-query runs (e.g. \["vélo", "trottinette"]).

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

Limit results to a specific Leboncoin category. Leave empty to search across all categories.

## `mode` (type: `string`):

Switch between standard listings and professional seller/agency pages.

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

Order in which results are returned.

## `cityId` (type: `integer`):

Internal city identifier. Overrides cityName and lat/lon when set. Most users should use cityName instead.

## `cityName` (type: `string`):

City name (e.g. "Paris", "Lyon"). Resolved to the nearest known city. Ignored when cityId is set.

## `lat` (type: `number`):

GPS latitude. Pair with lon. Ignored when cityId or cityName is set.

## `lon` (type: `number`):

GPS longitude. Pair with lat.

## `radiusKm` (type: `integer`):

Search radius in kilometres around the resolved city.

## `allowLowConfidence` (type: `boolean`):

When enabled, accepts a fuzzy or GPS-approximate city match instead of failing. Disable to prevent silent wrong-location results.

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

Filter by seller type: private individuals, professional sellers, or both.

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

Only return listings priced at or above this value.

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

Only return listings priced at or below this value.

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

One or more Leboncoin search or listing detail URLs to process directly. When set, other search filters are ignored.

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

Maximum number of listings to return per run. Set to 0 for unlimited.

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

Maximum number of result pages to process per search.

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

Fetch the detail page for each listing to retrieve the full description, contact information, and structured attributes. Increases run time.

## `includePhone` (type: `boolean`):

Attempt to retrieve the seller's phone number for each listing. Only applies when includeDetails is enabled.

## `extractContacts` (type: `boolean`):

Mine phone numbers, email addresses, and external URLs from the listing description text.

## `watchSellerIds` (type: `array`):

Array of seller IDs to monitor. When set, only listings from these sellers are returned.

## `compact` (type: `boolean`):

Return only core fields. Reduces payload size for LLM pipelines and agent tools.

## `descriptionFormat` (type: `string`):

Choose which representation of the listing description to include. `all` keeps every variant; the others keep only the selected one.

## `descriptionMaxLength` (type: `integer`):

Truncate listing descriptions to this many characters. Set to 0 for no truncation.

## `excludeEmptyFields` (type: `boolean`):

Drop null, empty-string, and empty-array fields from each record before output. Reduces payload size.

## `incrementalMode` (type: `boolean`):

Compare results against the previous run and only emit new or changed listings. Tracks state across runs automatically.

## `stateKey` (type: `string`):

Optional stable identifier for the tracked search. Leave empty to auto-derive from your search inputs — different filter combinations get isolated state.

## `emitExpired` (type: `boolean`):

When incremental mode is on, also emit listings that were seen before but are no longer found.

## `emitUnchanged` (type: `boolean`):

When incremental mode is on, also emit listings whose content has not changed since the last run.

## `skipReposts` (type: `boolean`):

In incremental mode, skip listings that appear to be reposts of a previously-seen expired listing with matching details.

## `notifyOnlyChanges` (type: `boolean`):

When incremental mode is on, send notifications only for new or updated listings. Has no effect outside incremental mode.

## `telegramToken` (type: `string`):

Telegram bot token from @BotFather. Required for Telegram notifications. Pairs well with incremental mode.

## `telegramChatId` (type: `string`):

Chat ID (from @userinfobot) or channel ID (starts with -100). Required when telegramToken is set.

## `discordWebhookUrl` (type: `string`):

Discord channel webhook URL. Server Settings → Integrations → Webhooks → New Webhook.

## `slackWebhookUrl` (type: `string`):

Slack incoming webhook URL. Slack App → Incoming Webhooks → Add New Webhook.

## `whatsappAccessToken` (type: `string`):

WhatsApp Cloud API access token from Meta Business Manager. The recipient must have messaged your business number within the last 24 hours.

## `whatsappPhoneNumberId` (type: `string`):

WhatsApp Business phone number ID (numeric, from Meta dashboard). Required when whatsappAccessToken is set.

## `whatsappTo` (type: `string`):

Recipient phone number in E.164 format without + (e.g. "33612345678"). Recipient must have messaged your business number within the last 24 hours.

## `webhookUrl` (type: `string`):

Receives a JSON POST with {metadata, items} after each run. Compatible with n8n, Make, Zapier, and custom HTTP backends.

## `webhookHeaders` (type: `object`):

Optional JSON object of custom HTTP headers for the webhook POST (e.g. {"Authorization":"Bearer ..."}).

## `notificationLimit` (type: `integer`):

Maximum number of listings included in each notification message (1–20).

## `appConnector` (type: `string`):

Optional. Pick a connected app under Settings → API & Integrations to receive your results. Best-effort across MCP connectors as Apify expands its catalog.

## `mcpIssueTeam` (type: `string`):

Only when the connected app is an issue tracker: the team (name or ID) the summary issue is created under, if that app requires one.

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

Proxy settings. Defaults to Apify Residential proxies in France for best results.

## Actor input object example

```json
{
  "query": "vélo",
  "mode": "listings",
  "sort": "time",
  "allowLowConfidence": false,
  "ownerType": "all",
  "maxResults": 5,
  "maxPages": 5,
  "includeDetails": true,
  "includePhone": false,
  "extractContacts": true,
  "compact": false,
  "descriptionFormat": "all",
  "descriptionMaxLength": 0,
  "excludeEmptyFields": false,
  "incrementalMode": false,
  "emitExpired": false,
  "emitUnchanged": false,
  "skipReposts": false,
  "notifyOnlyChanges": false,
  "notificationLimit": 5,
  "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 = {
    "query": "vélo",
    "maxResults": 5,
    "includeDetails": false,
    "descriptionFormat": "all",
    "excludeEmptyFields": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("blackfalcondata/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 = {
    "query": "vélo",
    "maxResults": 5,
    "includeDetails": False,
    "descriptionFormat": "all",
    "excludeEmptyFields": False,
}

# Run the Actor and wait for it to finish
run = client.actor("blackfalcondata/leboncoin-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 '{
  "query": "vélo",
  "maxResults": 5,
  "includeDetails": false,
  "descriptionFormat": "all",
  "excludeEmptyFields": false
}' |
apify call blackfalcondata/leboncoin-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Leboncoin Scraper — France Classifieds Data",
        "description": "Scrape Leboncoin.fr — France's largest online classifieds marketplace for real estate, vehicles, and goods. Extract structured listings with prices and locations, seller contact details, and incremental change tracking for new ads.",
        "version": "0.1",
        "x-build-id": "k4NnLGHTNbwzIlomm"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/blackfalcondata~leboncoin-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-blackfalcondata-leboncoin-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/blackfalcondata~leboncoin-scraper/runs": {
            "post": {
                "operationId": "runs-sync-blackfalcondata-leboncoin-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/blackfalcondata~leboncoin-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-blackfalcondata-leboncoin-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": {
                    "query": {
                        "title": "🔍 Search Term(s)",
                        "type": "string",
                        "description": "Listing search keywords. Enter a single term or a JSON array for multi-query runs (e.g. [\"vélo\", \"trottinette\"])."
                    },
                    "category": {
                        "title": "📁 Category",
                        "enum": [
                            "1",
                            "2",
                            "3",
                            "4",
                            "5",
                            "6",
                            "7",
                            "8",
                            "9",
                            "10",
                            "11",
                            "13"
                        ],
                        "type": "string",
                        "description": "Limit results to a specific Leboncoin category. Leave empty to search across all categories."
                    },
                    "mode": {
                        "title": "🗂️ Listing Type",
                        "enum": [
                            "listings",
                            "agencies"
                        ],
                        "type": "string",
                        "description": "Switch between standard listings and professional seller/agency pages.",
                        "default": "listings"
                    },
                    "sort": {
                        "title": "🔀 Sort Order",
                        "enum": [
                            "time",
                            "price",
                            "price_desc"
                        ],
                        "type": "string",
                        "description": "Order in which results are returned.",
                        "default": "time"
                    },
                    "cityId": {
                        "title": "📍 City ID (advanced)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Internal city identifier. Overrides cityName and lat/lon when set. Most users should use cityName instead."
                    },
                    "cityName": {
                        "title": "🏙️ City Name",
                        "type": "string",
                        "description": "City name (e.g. \"Paris\", \"Lyon\"). Resolved to the nearest known city. Ignored when cityId is set."
                    },
                    "lat": {
                        "title": "🌐 Latitude",
                        "minimum": -90,
                        "maximum": 90,
                        "type": "number",
                        "description": "GPS latitude. Pair with lon. Ignored when cityId or cityName is set."
                    },
                    "lon": {
                        "title": "🌐 Longitude",
                        "minimum": -180,
                        "maximum": 180,
                        "type": "number",
                        "description": "GPS longitude. Pair with lat."
                    },
                    "radiusKm": {
                        "title": "📏 Search Radius (km)",
                        "minimum": 0,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Search radius in kilometres around the resolved city."
                    },
                    "allowLowConfidence": {
                        "title": "🔓 Allow Low-Confidence City Match",
                        "type": "boolean",
                        "description": "When enabled, accepts a fuzzy or GPS-approximate city match instead of failing. Disable to prevent silent wrong-location results.",
                        "default": false
                    },
                    "ownerType": {
                        "title": "👤 Seller Type",
                        "enum": [
                            "all",
                            "private",
                            "pro"
                        ],
                        "type": "string",
                        "description": "Filter by seller type: private individuals, professional sellers, or both.",
                        "default": "all"
                    },
                    "priceMin": {
                        "title": "💶 Min Price (EUR)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only return listings priced at or above this value."
                    },
                    "priceMax": {
                        "title": "💶 Max Price (EUR)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only return listings priced at or below this value."
                    },
                    "startUrls": {
                        "title": "🔗 Paste / Direct URLs",
                        "type": "array",
                        "description": "One or more Leboncoin search or listing detail URLs to process directly. When set, other search filters are ignored.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResults": {
                        "title": "💯 Max Results",
                        "minimum": 0,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of listings to return per run. Set to 0 for unlimited.",
                        "default": 25
                    },
                    "maxPages": {
                        "title": "📄 Max Pages",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of result pages to process per search.",
                        "default": 5
                    },
                    "includeDetails": {
                        "title": "📋 Include Full Listing Details",
                        "type": "boolean",
                        "description": "Fetch the detail page for each listing to retrieve the full description, contact information, and structured attributes. Increases run time.",
                        "default": true
                    },
                    "includePhone": {
                        "title": "📞 Reveal Phone Numbers",
                        "type": "boolean",
                        "description": "Attempt to retrieve the seller's phone number for each listing. Only applies when includeDetails is enabled.",
                        "default": false
                    },
                    "extractContacts": {
                        "title": "📇 Extract Contact Details",
                        "type": "boolean",
                        "description": "Mine phone numbers, email addresses, and external URLs from the listing description text.",
                        "default": true
                    },
                    "watchSellerIds": {
                        "title": "👁️ Watch Seller IDs",
                        "type": "array",
                        "description": "Array of seller IDs to monitor. When set, only listings from these sellers are returned.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "compact": {
                        "title": "📦 Compact Output (for AI / MCP)",
                        "type": "boolean",
                        "description": "Return only core fields. Reduces payload size for LLM pipelines and agent tools.",
                        "default": false
                    },
                    "descriptionFormat": {
                        "title": "📝 Description Format",
                        "enum": [
                            "all",
                            "text",
                            "html",
                            "markdown"
                        ],
                        "type": "string",
                        "description": "Choose which representation of the listing description to include. `all` keeps every variant; the others keep only the selected one.",
                        "default": "all"
                    },
                    "descriptionMaxLength": {
                        "title": "✂️ Description Max Length",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Truncate listing descriptions to this many characters. Set to 0 for no truncation.",
                        "default": 0
                    },
                    "excludeEmptyFields": {
                        "title": "🧹 Exclude Empty Fields",
                        "type": "boolean",
                        "description": "Drop null, empty-string, and empty-array fields from each record before output. Reduces payload size.",
                        "default": false
                    },
                    "incrementalMode": {
                        "title": "♻️ Incremental Mode",
                        "type": "boolean",
                        "description": "Compare results against the previous run and only emit new or changed listings. Tracks state across runs automatically.",
                        "default": false
                    },
                    "stateKey": {
                        "title": "🔑 State Key",
                        "type": "string",
                        "description": "Optional stable identifier for the tracked search. Leave empty to auto-derive from your search inputs — different filter combinations get isolated state."
                    },
                    "emitExpired": {
                        "title": "⚰️ Emit Expired Listings",
                        "type": "boolean",
                        "description": "When incremental mode is on, also emit listings that were seen before but are no longer found.",
                        "default": false
                    },
                    "emitUnchanged": {
                        "title": "🔄 Emit Unchanged Listings",
                        "type": "boolean",
                        "description": "When incremental mode is on, also emit listings whose content has not changed since the last run.",
                        "default": false
                    },
                    "skipReposts": {
                        "title": "🚫 Skip Reposts",
                        "type": "boolean",
                        "description": "In incremental mode, skip listings that appear to be reposts of a previously-seen expired listing with matching details.",
                        "default": false
                    },
                    "notifyOnlyChanges": {
                        "title": "🔔 Notify Only New / Updated",
                        "type": "boolean",
                        "description": "When incremental mode is on, send notifications only for new or updated listings. Has no effect outside incremental mode.",
                        "default": false
                    },
                    "telegramToken": {
                        "title": "🔑 Telegram Bot Token",
                        "type": "string",
                        "description": "Telegram bot token from @BotFather. Required for Telegram notifications. Pairs well with incremental mode."
                    },
                    "telegramChatId": {
                        "title": "💬 Telegram Chat / Channel ID",
                        "type": "string",
                        "description": "Chat ID (from @userinfobot) or channel ID (starts with -100). Required when telegramToken is set."
                    },
                    "discordWebhookUrl": {
                        "title": "🎮 Discord Webhook URL",
                        "type": "string",
                        "description": "Discord channel webhook URL. Server Settings → Integrations → Webhooks → New Webhook."
                    },
                    "slackWebhookUrl": {
                        "title": "💼 Slack Incoming Webhook URL",
                        "type": "string",
                        "description": "Slack incoming webhook URL. Slack App → Incoming Webhooks → Add New Webhook."
                    },
                    "whatsappAccessToken": {
                        "title": "📱 WhatsApp Access Token",
                        "type": "string",
                        "description": "WhatsApp Cloud API access token from Meta Business Manager. The recipient must have messaged your business number within the last 24 hours."
                    },
                    "whatsappPhoneNumberId": {
                        "title": "📞 WhatsApp Phone Number ID",
                        "type": "string",
                        "description": "WhatsApp Business phone number ID (numeric, from Meta dashboard). Required when whatsappAccessToken is set."
                    },
                    "whatsappTo": {
                        "title": "📲 WhatsApp Recipient",
                        "type": "string",
                        "description": "Recipient phone number in E.164 format without + (e.g. \"33612345678\"). Recipient must have messaged your business number within the last 24 hours."
                    },
                    "webhookUrl": {
                        "title": "🪝 Generic Webhook URL",
                        "type": "string",
                        "description": "Receives a JSON POST with {metadata, items} after each run. Compatible with n8n, Make, Zapier, and custom HTTP backends."
                    },
                    "webhookHeaders": {
                        "title": "📋 Webhook Headers",
                        "type": "object",
                        "description": "Optional JSON object of custom HTTP headers for the webhook POST (e.g. {\"Authorization\":\"Bearer ...\"})."
                    },
                    "notificationLimit": {
                        "title": "📊 Max Listings Per Notification",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Maximum number of listings included in each notification message (1–20).",
                        "default": 5
                    },
                    "appConnector": {
                        "title": "Send results to a connected app",
                        "type": "string",
                        "description": "Optional. Pick a connected app under Settings → API & Integrations to receive your results. Best-effort across MCP connectors as Apify expands its catalog."
                    },
                    "mcpIssueTeam": {
                        "title": "Issue tracker team",
                        "type": "string",
                        "description": "Only when the connected app is an issue tracker: the team (name or ID) the summary issue is created under, if that app requires one."
                    },
                    "proxyConfiguration": {
                        "title": "🌐 Proxy Configuration",
                        "type": "object",
                        "description": "Proxy settings. Defaults to Apify Residential proxies in France for best results.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ],
                            "apifyProxyCountry": "FR"
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
