Skip to content

Leboncoin Scraper API: From Ad URL to Usable Data

Leboncoin ad pages are rendered with JavaScript and protected by bot detection, which makes a plain HTTP fetch unreliable.

OUTPUT FORMATSHTMLJSONMarkdown

A managed scraping API puts the proxy rotation, headless browser, and rendering work behind one call, so your code sends a URL and receives either the rendered page or a structured JSON payload. This guide explains what the API returns, how to choose between HTML and JSON, and how request options affect credit use.

What the API handles for you

The service sits between your application and the target page. You supply a Leboncoin URL and your API key; the platform renders the page, works around bot checks, and returns the result. You do not run your own headless Chrome fleet or rotate proxies yourself.

Typical jobs fall into three groups: collecting asking prices for market comparison, watching listings for price drops and re-postings, and gathering product descriptions for competitive analysis. Each of these can be served by the same request pattern, with the output shaped by the extraction options you choose.

Ad fields you can expect

A Leboncoin ad page exposes a consistent set of attributes. The table below maps the fields the API can return, so you can decide which ones belong in your schema before you write extraction rules.

Choosing between HTML and JSON output

The API can return the rendered HTML or a parsed JSON object. Use HTML when you need to inspect the page structure or when your own parser already handles the markup. Use JSON when you want field names mapped directly to values and no HTML parsing on your side.

To get JSON, pass extract_rules with CSS selectors mapped to field names, or use ai_extract_rules with a natural-language description of the fields you want. The response then arrives as parsed JSON.

Request options and what they change

The base request needs only a URL and an API key. Advanced parameters change how the page is fetched and what comes back:

  • render_js enables JavaScript rendering for pages that need it.
  • stealth_proxy adds a stealth proxy layer for pages with CAPTCHA or stronger bot checks.
  • country_code sets geotargeting so requests appear from a chosen country.
  • ai_extract_rules lets you describe the data you want in natural language instead of writing selectors.

These options are not free: each one changes the credit cost of a successful request. The pricing table below lists the per-request credit costs for the main combinations.

How credits are consumed

Credits are consumed per successful request, and the amount depends on the options enabled. Requests start at 1 credit each, and enabling JavaScript rendering or premium proxies raises that cost. The table below shows the per-request costs for the main combinations. Use it to estimate how far a monthly credit allowance will stretch before you commit to a plan.

A short planning checklist

Before you send your first production request, work through these points:

  1. Confirm the page is public-facing and that your use complies with the target site's terms.
  2. Decide whether you need HTML or JSON; if JSON, draft your selector map or natural-language spec first.
  3. Estimate the credit cost per request from the options you need, then multiply by your expected monthly volume.
  4. Test the request in the dashboard request builder before moving the snippet into your codebase.
  5. Pick the SDK that matches your stack; Python, Node.js, Go, PHP, Ruby, Java, and plain cURL are all supported.

Two different failure modes

When a request does not return the data you expect, the cause is usually one of two things. A bot-blocking failure means the page did not load at all or returned a challenge page; adding stealth_proxy or adjusting render_js is the usual remedy. A selector failure means the page loaded but your extract_rules did not match the elements you targeted; inspect the rendered HTML and update the selectors. Separating these two cases early saves time, because the fixes are different.

Leboncoin ad fields returned by the API
FieldWhat it contains
TitleThe ad headline
Asking priceThe price shown on the listing
LocationThe geographic area of the ad
Posting dateWhen the ad was published
ConditionThe stated condition of the item
CategoryThe listing category
Seller nameThe name displayed for the seller
Contact detailsContact information shown on the public page
Image galleryThe set of images attached to the ad

Fields listed reflect the public ad page surface described in the supplied material; actual availability depends on the page and the extraction rules you supply.

Per-request credit costs by option
Option combinationCredits per successful request
JavaScript rendering enabled5
Premium proxy without JS rendering10
Premium proxy with JS rendering25
Stealth proxy75

Credit costs are taken from the supplied pricing material and may change; confirm current rates before budgeting. Requests start at 1 credit each, and the rows above show the higher costs when these options are enabled.

Frequently asked questions

Do I need a Leboncoin account to use the scraper?

No. You need an API key from the scraping service, which comes with 1,000 free credits and no card requirement. Send the Leboncoin URL and the platform handles the rest.

Is scraping Leboncoin allowed?

Public-facing pages are generally the ones you can collect, but you should review the target site's terms of service before deploying and avoid any content behind a login.

What can I extract from a Leboncoin ad page?

Anything that appears on the public page. Use extract_rules with CSS selectors, or ai_extract_rules for a natural-language description, to receive structured JSON.

How do I get JSON instead of HTML?

Pass extract_rules mapping CSS selectors to field names, or supply ai_extract_rules with a natural-language spec. The response is returned as parsed JSON.

Which languages can I use?

The service publishes SDKs for Python, Node.js, Go, PHP, Ruby, and Java, and plain cURL also works. Choose whichever your stack already uses.

What does it cost to scrape Leboncoin?

New accounts receive 1,000 free credits without a card. Paid plans begin at $19 per month for higher volume and concurrency. Per-request credit costs depend on options: 5 credits for JavaScript rendering, 25 for a premium proxy with JavaScript rendering, and 75 for a stealth proxy.