# Changelog of Leboncoin Scraper \[$1/1K💰] | French Real Estate · Prices & DPE (`ahmed_jasarevic/leboncoin-scraper`) Actor

- **URL**: https://apify.com/ahmed_jasarevic/leboncoin-scraper/changelog.md
- **Full Actor documentation**: https://apify.com/ahmed_jasarevic/leboncoin-scraper.md

## Changelog

### 1.1.0

#### Added

- **All leboncoin categories**: the input `category` field now exposes the full 98-entry category
  tree (`0` = all, real estate, vehicles, jobs, electronics, home, fashion, leisure, animals,
  professional material, services…), with French labels.
- `categoryId` — raw category id override.
- `searchUrl` — paste a full `/recherche` URL; its category, price, location, keyword and sort
  filters are applied and merged with the other input fields.
- `adDetailUrls` — scrape individual ads directly through the detail endpoint, bypassing search.
- `searchQuery`, `excludeKeywords`, `searchInTitleOnly` — keyword search with client-side
  include/exclude and title-only matching.
- `sellerType` (`all`/`pro`/`private`), `urgent`, `donation`, `shippable`, `radius`.
- `includeSeller` — optional seller-profile enrichment (seniority, ad count, rating, reply time,
  badges), read from the seller's public `/profil/{userId}` page (validated in a cloud smoke test).
- `sort` (`time`/`price`/`relevance`) with an automatic retry on the default key when the API
  returns 0 results for the requested one.
- Detail enrichment chain: `finder/classified/{id}` → public ad page `__NEXT_DATA__` → `og:` meta
  tags, merged over the search payload.
- New listing fields: `priceCents`, `pricePerSquareMeter`, `categoryId`, `categoryName`,
  `condition`, `brand`, `model`, `isShippable`, `isUrgent`, `hasPhone`, `photoCount`,
  `searchQuery`, `dataSource`, `scrapedAt`, `sellerProfile`.
- Key-value result cache (`cacheResults`, `cacheTtlMinutes`) to replay identical searches.
- Dataset views: **Leboncoin Listings** and **Pricing & Location** (dot-notation on `location` and
  `seller`).
- 34 unit tests covering payload builders, `searchUrl` parsing, listing mapping, filters and sort
  mapping.

#### Changed

- Run logs no longer expose how the scraper works: internal endpoint URLs, TLS/impersonation
  fingerprints, anti-bot cookie and challenge wording, response-body previews and the ad-owner
  debug dump are gone, and every logged error message is masked (`[url]` / `[host]` / `[token]`)
  and capped at 160 characters.
- Pay-per-event billing: every result is billed through the Actor's primary
  `apify-default-dataset-item` event (the custom `scraped-ad` name that was never registered is
  gone), while the two opt-in add-ons are charged explicitly with `Actor.charge()` —
  `scraped-ad-detail` only when the detail payload was actually merged, `seller-profile` only when
  a profile is attached to the result. Both add-ons must be declared in
  Console → Publishing → Monetization → Actor pricing; until then they are logged as
  unconfigured and skipped while the result itself stays billed.
- Actor definition: memory bounds (512–2048 MB), README and CHANGELOG pointers, version `1.1`.
- Input schema rewritten in French with all categories and new fields.
- Anti-bot hardening: the detail and seller-profile layers reuse the warm search session, throttle
  between requests and rotate the IP with up to 3 retries per ad before giving up.
- `cookieBootstrap` browser fallback now gets a realistic 45s page-load budget and always closes
  the Chromium process.

#### Fixed

- `REGION_IDS_BY_NAME` keys are lowercased so region names actually resolve.
- Direct-URL mode (`adDetailUrls`) no longer fetches every ad's detail payload a second time from
  `pushListing`, which roughly halves the residential proxy traffic in that mode.
- `dataSource` now reports `search+detail` whenever the detail payload was merged, not only when a
  seller profile was found.
- DataDome detection no longer misreads leboncoin's own pages as blocked: only real challenge
  markers (`captcha-delivery.com`, `<title>DataDome`, `geo.captcha`) and 401/403/429 statuses
  count, so a clean HTTP 200 warm-up is now accepted instead of rotating every IP.
- `api_key` request header, `set-cookie` header lookup, `datadome` cookie handling, `--proxy` CLI
  flag, `--no-sandbox`, `locale: fr-FR` and `VITEST` guard restored to their correct casing.
