LeBonCoin.fr Scraper — Classifieds Ads & Price Data
Pricing
from $1.00 / 1,000 results
LeBonCoin.fr Scraper — Classifieds Ads & Price Data
Configuration for scraping LeBonCoin.fr classifieds ads. ⚠️ REQUIRES RESIDENTIAL PROXY to bypass anti-bot protection.
Pricing
from $1.00 / 1,000 results
Rating
0.0
(0)
Developer
Julien ApiKiy
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
15 hours ago
Last modified
Categories
Share
LeBonCoin.fr Scraper — Extract French Classifieds Ads
🇫🇷 Scrape LeBonCoin.fr — France's #1 classifieds platform — with Playwright. Extract ads from all categories including real estate, vehicles, jobs, electronics, and more.
🚀 Features
- All 15 categories: Real estate (sales & rentals), vehicles, jobs, electronics, home & garden, fashion, services, animals, and more
- Smart SPA handling: PlaywrightCrawler with Chromium to render LeBonCoin's React frontend
- Anti-detection: User-Agent rotation, random delays, session pool management, proxy support
- Rich data extraction: Title, price, location, description, seller, date, images, and custom attributes (surface, rooms, brand, etc.)
- Geographic filtering: Search by city or department across all of France
- Price range filtering: Set minimum and maximum price thresholds
- Pagination: Automatically follows "Next page" to scrape all results
- Proxy support: Built-in Apify proxy integration with residential proxies
- Configurable concurrency: Control browser instances (1–10) for speed vs. stealth
📋 Use Cases
| Use Case | Description |
|---|---|
| Real estate market analysis | Track prices, inventory, and trends across French cities |
| Vehicle price monitoring | Compare car/motorcycle prices across listings |
| Job market intelligence | Monitor job postings, salaries, and employer demand |
| Competitor pricing | Track competitor product prices on LeBonCoin |
| Lead generation | Collect seller contact information for B2B outreach |
| Market research | Analyze supply and demand across French regions |
📊 Output Format
Each scraped ad is pushed as a JSON object to the Apify dataset:
{"id": "1234567890","title": "Appartement T2 - Paris 11ème, rénové","price": 250000,"location": "Paris 11ème (75011)","url": "https://www.leboncoin.fr/ad/paris/1234567890/","description": "Bel appartement T2 entièrement rénové, lumineux, proche métro Voltaire.","seller": "Agence ABC Immo","date": "2025-03-15","images": ["https://img.leboncoin.fr/img1.jpg","https://img.leboncoin.fr/img2.jpg"],"attributes": [{ "key": "Surface", "value": "55 m²" },{ "key": "Pièces", "value": "3" },{ "key": "Étage", "value": "4ème" }],"category": "immobilier","scrapedAt": "2025-03-15T10:30:00.000Z"}
💰 Pricing
Pay-per-use, no monthly fees:
| Price | |
|---|---|
| Actor start | $0.01 |
| Per result | $0.001 |
💡 Example: A run returning 500 results costs $0.51 total ($0.01 start + 500 × $0.001).
🛠 Usage
Option 1: Apify Console (Recommended)
- Go to apify.com → Actors → Find "LeBonCoin.fr Scraper"
- Click "Run" → Fill in the input parameters
- View results in the "Output" tab
Option 2: Node.js
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });const run = await client.actor('your-username/leboncoin-scraper').call({searchTerms: ['appartement'],categories: [10], // Immobilier (ventes)locations: ['Paris'],minPrice: 200000,maxPrice: 500000,maxPages: 3,sortBy: 'time',useProxy: true,});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(`Scraped ${items.length} ads`);items.forEach((ad) => {console.log(`${ad.title} — ${ad.price} € — ${ad.location}`);});
Option 3: Python
from apify_client import ApifyClientclient = ApifyClient("YOUR_API_TOKEN")run = client.actor("your-username/leboncoin-scraper").call(run_input={"searchTerms": ["voiture"],"categories": [2], # Véhicules"locations": ["Lyon"],"maxPages": 5,"useProxy": True,})for item in client.dataset(run["defaultDatasetId"]).list_items()["items"]:print(f"{item['title']} — {item['price']} € — {item['location']}")
Option 4: cURL (API)
curl -X POST "https://api.apify.com/v2/acts/your-username~leboncoin-scraper/runs?token=YOUR_API_TOKEN" \-H "Content-Type: application/json" \-d '{"searchTerms": ["vélo"],"categories": [15],"locations": ["Marseille"],"maxPages": 2,"useProxy": false}'# Get resultscurl "https://api.apify.com/v2/datasets/YOUR_DATASET_ID/items?token=YOUR_API_TOKEN&format=json"
⚙️ Input Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
searchTerms | string[] | [] | Keywords to search (e.g. ["appartement", "T2"]) |
categories | number[] | [] | Category IDs (empty = all 15 categories) |
locations | string[] | [] | City or department names (e.g. ["Paris", "Bouches-du-Rhône"]) |
minPrice | number | null | Minimum price in euros |
maxPrice | number | null | Maximum price in euros |
maxPages | number | 5 | Max pages to scrape per query (1–200) |
sortBy | string | "time" | Sort: time, price, or relevance |
minDatePublished | string | null | ISO date filter — only ads published after this date |
maxConcurrentBrowsers | number | 3 | Parallel browser instances (1–10) |
useProxy | boolean | false | Enable Apify proxy (recommended for bulk scraping) |
maxRetries | number | 3 | Retries for failed requests (0–10) |
requestDelaySeconds | number | 2 | Delay between requests (0–60s) |
Category IDs
| ID | Category |
|---|---|
| 10 | Immobilier (ventes) |
| 9 | Immobilier (locations) |
| 2 | Véhicules |
| 1 | Offres d'emploi |
| 15 | Ventes diverses |
| 16 | Électroménager |
| 17 | Informatique |
| 6 | Multimédia |
| 26 | Maison |
| 7 | Loisirs |
| 20 | Habillement |
| 19 | Services |
| 13 | Animaux |
| 8 | Événements |
| 27 | Matériaux de construction |
⚠️ Error Handling
| Error | Cause | Solution |
|---|---|---|
Blocked by anti-bot | LeBonCoin detected automated access | Enable proxy (useProxy: true), increase requestDelaySeconds |
Ad containers not found | Page didn't load in time or selectors changed | Increase maxRetries, check for site updates |
Navigation timeout | Slow page load | Increase maxConcurrentBrowsers timeout, reduce concurrency |
Empty results | Search has no matches | Try different keywords or broader category |
Session retired | Too many requests from one session | Automatic — crawler rotates sessions automatically |
Anti-Detection Tips
- Always use residential proxies for large-scale scraping (100+ pages)
- Set request delay to 3-5 seconds minimum
- Keep concurrent browsers ≤ 3 for stealth
- Run during off-peak hours (2am-6am CET) for best results
- Rotate search terms — don't scrape the same query repeatedly
🏗 Technical Architecture
PlaywrightCrawler (Chromium)├── Session Pool (100 sessions, 30min max age)├── Request Queue (all search URLs)├── Per-Request Handler│ ├── page.goto() with waitUntil: domcontentloaded│ ├── page.waitForSelector() for SPA content│ ├── page.evaluate(extractAdsFromPage) — DOM extraction│ ├── normalizeAd() — clean and structure data│ └── Actor.pushData() — save to dataset└── Proxy Configuration (optional residential)
📦 Dependencies
- Crawlee — Web scraping framework with PlaywrightCrawler
- Apify SDK — Actor runtime, storage, and proxy
- Playwright — Browser automation for SPA rendering
📄 License
ISC
🤝 Contributing
Contributions welcome! Please open an issue or PR on GitHub.