# Leboncoin Voitures Scraper API - Prix, Km & Concessions (`scrapifier/leboncoin-voitures-scraper`) Actor

⚡ Scrape unlimited Leboncoin vehicle listings — no URL needed! Choose cars, motorbikes or vans, add your filters (brand, fuel, gearbox, mileage, year, price…) and instantly get rich, structured data for market analysis, deal sourcing, price monitoring or lead generation.

- **URL**: https://apify.com/scrapifier/leboncoin-voitures-scraper.md
- **Developed by:** [Scrapifier](https://apify.com/scrapifier) (community)
- **Categories:** E-commerce
- **Stats:** 22 total users, 9 monthly users, 99.4% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 Voitures Scraper API - Prix, Km & Concessions

Scrape vehicle listings from Leboncoin (cars, motorbikes, vans, caravanning, trucks, boats) by category and filters, with no search URL to build, and export them as JSON, CSV or Excel, or pull them from the API.

⚡ For every listing you get the **title, price and full description**, the typed vehicle attributes (**brand, model, fuel, gearbox, mileage, registration year**, power, Crit'Air...), the image URLs, publication and update dates, the seller's phone-number flag and the **full geolocation** (city, postcode, department, region, latitude and longitude). **No URL to build**: pick a category, type a city or postcode, set your criteria. **Server-side filters**, **locations by name** with automatic geocoding, **automatic price splitting** for large result sets, and the Actor itself is **free**.

[![Apify Actor](https://apify.com/actor-badge?actor=scrapifier/leboncoin-voitures-scraper)](https://apify.com/scrapifier/leboncoin-voitures-scraper)

### 🎯 Why scrape Leboncoin vehicles?

- **Deal sourcing**: pull every diesel Renault under 25,000 € near Lyon with less than 150,000 km, sorted by price, and spot under-priced cars first.
- **Price monitoring**: run the same search every day and track how asking prices for a model, a fuel type or a body type move over time.
- **Market research**: measure the supply of electric or hybrid cars per region, the share of automatic gearboxes, or the age and mileage of used vans.
- **Lead generation**: list private sellers or dealers in a department, with the listing URL and whether a phone number is published, to feed a CRM.
- **Dealer inventory watch**: filter on `pro` sellers and a brand to follow what competing dealerships put online and at what price.
- **Data science**: build clean datasets of listings with typed attributes and coordinates for pricing models or depreciation studies.

### 📊 What data does Leboncoin Vehicles Scraper extract?

| Field | Description |
|---|---|
| `id` | Unique Leboncoin listing id |
| `url` | Direct link to the listing |
| `subject` | Listing title |
| `body` | Full description text |
| `price` | Price in euros |
| `first_publication_date`, `index_date`, `expiration_date` | First publication, last update and expiration dates (`YYYY-MM-DD HH:MM:SS`) |
| `status` | Listing status (e.g. `active`) |
| `category_id`, `category_name` | Leboncoin category id and name |
| `ad_type` | `offer` or `demand` (the Actor searches offers) |
| `brand` | Source brand (`leboncoin`) |
| `images[]` | Image URLs |
| `attributes[]` | Typed vehicle attributes: `key`, `key_label`, `value`, `value_label`, `values[]`, `values_label[]`, `generic`. Keys include brand, model, fuel, gearbox, mileage, `regdate` (year), power, Crit'Air |
| `location.*` | `city`, `city_label`, `zipcode`, `department_id`, `department_name`, `region_id`, `region_name`, `country_id`, `lat`, `lng`, `source`, `provider`, `is_shape` |
| `has_phone` | Whether the seller published a phone number |
| `scraped_at` | Extraction timestamp |
| `search_category`, `search_location`, `search_url` | The category, location and Leboncoin search URL the listing came from |

The dataset's **Overview** view flattens `location` and shows id, title, price, category, city, postcode, update date and URL as a table.

### 🚀 How to scrape Leboncoin vehicles

1. Open the Actor and choose the **Vehicle type**: Cars (`2`), Motorbikes (`3`), Vans & utility (`5`), Caravanning (`4`), Trucks (`300`) or Boats (`7`).
2. Add one or more **Location(s)** by name: a city (`Lyon`), an arrondissement (`Paris 11`) or a postal code (`75011`). Leave the list empty to search all of France.
3. Set your **vehicle filters**: brand and model, fuel, gearbox, year, mileage, price, seller type and sort order. Car filters (body type, colour, doors, seats, power, Crit'Air, Euro standard, licence, condition) apply to cars and vans; engine size, type, style and licence apply to motorbikes. Anything else goes in **Advanced filters**.
4. Set **Max results** (default `100`, `0` collects everything available), keep the residential FR proxy, and click **Start**.
5. Open the **Storage** tab to preview the listings and export them as JSON, CSV, Excel or XML, or read them from the dataset API.

The same run can be started from the Apify API, the Python or JavaScript client, or put on a schedule for daily price monitoring.

### 📥 Input parameters

| Field | Key | Type | Default | Description |
|---|---|---|---|---|
| Vehicle type | `category` | select | `2` | `2` Cars, `3` Motorbikes, `5` Vans & utility, `4` Caravanning, `300` Trucks, `7` Boats. |
| Keywords | `text` | string | none | Optional free-text keywords, e.g. a model or trim. |
| Location(s) | `locations` | array of strings | `["Lyon"]` | City, arrondissement or postal code (`Paris 11`, `Lyon`, `75011`). Empty = all of France. |
| Brand | `vehicle_brand` | string | `RENAULT` | Brand in UPPERCASE (`RENAULT`, `PEUGEOT`, `BMW`, `YAMAHA`, `HONDA`). |
| Model | `vehicle_model` | string | none | Model as `BRAND_Model` (`RENAULT_Clio`, `PEUGEOT_208`, `BMW_Serie 3`). |
| Fuel | `fuel` | array of strings | `["2"]` | `1` Petrol, `2` Diesel, `4` Electric, `6` Hybrid, `8` Plug-in hybrid. |
| Gearbox | `gearbox` | array of strings | none | `1` Manual, `2` Automatic. |
| Min year | `year_min` | integer | `2018` | Minimum registration year. |
| Max year | `year_max` | integer | none | Maximum registration year. |
| Min mileage (km) | `mileage_min` | integer | none | Minimum mileage. |
| Max mileage (km) | `mileage_max` | integer | `150000` | Maximum mileage. |
| Min price (€) | `price_min` | integer | none | Minimum price. |
| Max price (€) | `price_max` | integer | `25000` | Maximum price. |
| Seller type | `owner_type` | select | `all` | `all`, `private` or `pro` (dealers). |
| Sort by | `sort` | select | `relevance` | `relevance`, `newest`, `price_asc`, `price_desc`. |
| Body type (cars) | `vehicle_type` | array of strings | none | `citadine`, `berline`, `break`, `coupe`, `cabriolet`, `monospace`, `4x4`, `autre`. |
| Colour | `vehicle_color` | array of strings | none | `blanc`, `noir`, `gris`, `bleu`, `rouge`, `vert`, `marron`, `beige`, `argent`, `orange`, `bordeaux`, `jaune`, `violet`, `autre`. |
| Min doors | `doors_min` | integer | none | Minimum number of doors. |
| Min seats | `seats_min` | integer | none | Minimum number of seats. |
| Min power (hp / ch DIN) | `power_min` | integer | none | Minimum DIN horsepower. |
| Max Crit'Air | `critair_max` | integer | none | Maximum Crit'Air rating, `0` (cleanest) to `5`. |
| Euro emission standard | `euro_standard` | array of strings | none | `euro2`, `euro3`, `euro4`, `euro5`, `euro5plus`, `euro6`. |
| Licence (cars) | `vsp` | array of strings | none | `avecpermis` (licence required), `sanspermis` (no licence, VSP). |
| Condition | `vehicle_condition` | array of strings | none | `excellent_condition`, `good_overall_condition`, `minor_repairs_needed`, `major_repairs_needed`, `undamaged`, `normal_wear_and_tear`. |
| Min engine (cm³) | `cc_min` | integer | none | Minimum engine displacement (motorbikes). |
| Max engine (cm³) | `cc_max` | integer | none | Maximum engine displacement (motorbikes). |
| Type | `cycle_type` | array of strings | none | `moto`, `scooter`, `moped&motorbike`. |
| Style | `motorcycle_type` | array of strings | none | `sportive`, `motocross`, `supermotard`, `trail`, `roadster`, `touring`, `enduro`. |
| Licence | `cycle_licence` | array of strings | none | `permisam`, `permisa2`, `permisa`, `permisal`, `sanspermis`. |
| Advanced filters | `filters` | object | `{}` | Any other Leboncoin filter: `key: [codes]` for an enum, `key: {"min": .., "max": ..}` for a range. Overrides any dedicated input above. |
| Max results | `max_results` | integer | `100` | How many listings to collect (`0` = as many as available). |
| Proxy | `proxyConfiguration` | object | Apify residential, country `FR` | Residential FR proxies are recommended for reliable runs. |

Example input (the Actor's pre-filled input, used diesel cars near Lyon):

```json
{
  "category": "2",
  "locations": ["Lyon"],
  "vehicle_brand": "RENAULT",
  "fuel": ["2"],
  "year_min": 2018,
  "mileage_max": 150000,
  "price_max": 25000,
  "max_results": 100,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"], "apifyProxyCountry": "FR" }
}
```

Brands are uppercased for you, models must keep the `BRAND_Model` form. To find any other key or code, build the search on [leboncoin.fr](https://www.leboncoin.fr) and read the URL: `mileage=0-100000` becomes `{"mileage": {"max": 100000}}` in `filters`.

#### Filters reference

Each dedicated input maps to one Leboncoin key (codes verified live against the Leboncoin API in July 2026). Use the key in `filters` for a full range where the form only offers a minimum, or for a filter without a dedicated field.

| Dedicated input | Leboncoin key |
|---|---|
| `vehicle_brand`, `vehicle_model` | `u_car_brand`, `u_car_model` (`u_moto_brand`, `u_moto_model` for motorbikes, picked automatically) |
| `fuel`, `gearbox`, `vehicle_type`, `cycle_type`, `motorcycle_type`, `cycle_licence` | same key name |
| `vehicle_color` | `vehicule_color` |
| `year_min` / `year_max` | `regdate` (range) |
| `mileage_min` / `mileage_max` | `mileage` (range) |
| `power_min` | `horse_power_din` (range) |
| `doors_min`, `seats_min`, `critair_max` | `doors`, `seats`, `critair` (ranges) |
| `euro_standard` | `vehicle_euro_emissions_standard` |
| `vsp` | `vehicle_vsp` |
| `vehicle_condition` | `vehicle_damage` |
| `cc_min` / `cc_max` | `cubic_capacity` (range) |

Caravanning (`4`) and boats (`7`) share the universal filters (price, year, seller, keywords); their specific keys (berths, boat length...) go in `filters`.

### 📤 Output example

Each listing is one dataset item, exportable as JSON, CSV, Excel or via the API. The item follows this shape (field name and type from the dataset schema; `attributes[]` and `location` are nested):

```json
{
  "id": "integer, unique Leboncoin listing ID",
  "first_publication_date": "string, YYYY-MM-DD HH:MM:SS",
  "index_date": "string, last update",
  "status": "string, e.g. active",
  "category_name": "string",
  "subject": "string, listing title",
  "body": "string, full description",
  "url": "string, direct link",
  "price": "number, euros",
  "images": ["string, image URL"],
  "attributes": [{ "key": "string, e.g. fuel", "key_label": "string", "value": "string, raw code", "value_label": "string, readable value" }],
  "location": { "city": "string", "zipcode": "string", "department_name": "string", "region_name": "string", "lat": "number", "lng": "number" },
  "has_phone": "boolean",
  "scraped_at": "string, extraction timestamp",
  "search_url": "string, the Leboncoin search URL"
}
```

The run's OUTPUT record (key-value store) also holds the run statistics (`total_ads`, `unique_ads`, `duplicates`, `pages_processed`, `errors`), `total_ads_available` as reported by Leboncoin for the search, and a summary of the input.

### 💡 Ready-to-run examples

**Used diesel Renaults near Lyon, 2018 or newer (the pre-filled input)**

```json
{ "category": "2", "locations": ["Lyon"], "vehicle_brand": "RENAULT", "fuel": ["2"], "year_min": 2018, "mileage_max": 150000, "price_max": 25000, "max_results": 100, "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"], "apifyProxyCountry": "FR" } }
```

**Yamaha roadsters of 500 cm³ and more in Paris, under 8,000 €**

```json
{ "category": "3", "locations": ["Paris"], "vehicle_brand": "YAMAHA", "cc_min": 500, "cycle_type": ["moto"], "motorcycle_type": ["roadster"], "price_max": 8000, "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"], "apifyProxyCountry": "FR" } }
```

**Newest electric automatics from dealers, all of France**

```json
{ "category": "2", "locations": [], "fuel": ["4"], "gearbox": ["2"], "owner_type": "pro", "sort": "newest", "max_results": 100, "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"], "apifyProxyCountry": "FR" } }
```

**Advanced filters: one model, fiscal power range, two colours**

```json
{ "category": "2", "locations": ["Lyon"], "filters": { "u_car_model": ["RENAULT_Clio"], "horsepower": { "min": 4, "max": 7 }, "vehicule_color": ["noir", "gris"] }, "max_results": 100, "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"], "apifyProxyCountry": "FR" } }
```

### 💰 Pricing: how much does it cost to scrape Leboncoin vehicles?

The Actor itself is **free**: you only pay Apify platform usage (compute and proxy) of your own account. You pay only for the results you receive, there is no subscription and no start fee. New Apify accounts get free monthly platform credits to try it.

Platform usage grows with the pages fetched and the residential proxy traffic: cap each run with `max_results` (default `100`) and narrow the search with brand, fuel, price and location filters. The default run options are 1,024 MB of memory and a 3,600 second timeout.

### ⚙️ Performance, proxies and limits

- **Proxy**: Apify residential proxies with country `FR` are recommended and pre-filled. A blocked page is logged and the search stops there.
- **Pagination**: listings are fetched 35 per page and pushed in batches, so partial results appear during the run.
- **Price splitting**: a price range wider than 10,000 € is split into 10,000 € intervals, one search each, to cover large result sets.
- **Locations**: each name is geocoded (Leboncoin first, OpenStreetMap as fallback). An unresolved name is skipped; if none resolve, the run fails with an explicit message.
- **Offers only**: the Actor searches offers, not wanted ads.
- **Deduplication**: listings are deduplicated by `id` within a run, across price intervals; duplicates are counted in the OUTPUT statistics.
- **Volume**: `max_results` `0` collects everything; the cap is a running total across price intervals.

### 🔌 Integrations and API

Run Leboncoin Vehicles Scraper from the [Apify API](https://docs.apify.com/api/v2), the [Python](https://docs.apify.com/api/client/python) or [JavaScript](https://docs.apify.com/api/client/js) client, or on a [schedule](https://docs.apify.com/platform/schedules). Connect it to Make, Zapier, n8n, Google Sheets, Slack or any webhook through [Apify integrations](https://apify.com/integrations). Every run's dataset is available as JSON, CSV, Excel or XML from the dataset API.

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapifier~leboncoin-voitures-scraper/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{ "category": "2", "locations": ["Lyon"], "vehicle_brand": "RENAULT", "fuel": ["2"], "year_min": 2018, "price_max": 25000, "max_results": 100, "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"], "apifyProxyCountry": "FR" } }'
```

### ❓ FAQ

**Is it legal to scrape Leboncoin vehicles?**

The Actor only reads listings Leboncoin publishes to anyone without logging in. Listings can contain personal data, so process them in line with GDPR, respect Leboncoin's terms, and stay responsible for how you use the data. This is not legal advice.

**Do I need a Leboncoin account, login or cookies?**

No. Nothing to log in to, no cookies. Keep the pre-filled residential FR proxy for reliable runs.

**Can I export Leboncoin listings to Excel or Google Sheets?**

Yes. Every run's dataset downloads as CSV, XLSX, JSON or XML, and the Google Sheets integration can push new listings to a sheet.

**How many vehicle listings can I scrape?**

As many as Leboncoin returns: set `max_results` to `0`. Most users keep a cap and sort by `newest` to fetch only recent listings.

**Which vehicle categories are supported?**

Cars, motorbikes, vans and utility vehicles, caravanning, trucks and boats. Caravanning or boat-specific criteria go through `filters`.

**How do I find a filter code that is not in the form?**

Build the search on leboncoin.fr and read the URL: every query parameter is a key and value you can pass in `filters`. The reference above lists the key behind each dedicated input.

**Why does my run return few or no listings?**

Check the log: an ungeocodable location is skipped and a block stops the search. Widen the filters, check the `BRAND_Model` spelling, and keep the residential FR proxy on.

**How fresh is the data?**

Every run scrapes Leboncoin live. Schedule the Actor daily to keep a rolling price history, and use `index_date` to see when a listing was last updated.

### 🔗 Related scrapers

- [Leboncoin Real Estate Scraper](https://apify.com/scrapifier/leboncoin-immobilier-scraper): rentals, sales and flatshares on Leboncoin by filters, no URL needed.
- [Leboncoin Scraper](https://apify.com/scrapifier/leboncoin-scraper): any Leboncoin category from a pasted search URL.
- [SeLoger Scraper](https://apify.com/scrapifier/seloger-scraper): real-estate listings from SeLoger.
- [PAP Scraper](https://apify.com/scrapifier/pap-immobilier-scraper): private-seller real estate from pap.fr.
- [Bien'ici Scraper](https://apify.com/scrapifier/bienici-scraper): real-estate listings from Bien'ici.
- [Vinted Scraper](https://apify.com/scrapifier/vinted-scraper): second-hand fashion listings from any Vinted country.

### 🇫🇷 En français

Ce scraper Leboncoin extrait les annonces de véhicules (voitures, motos, utilitaires, caravaning, camions, bateaux) à partir de simples filtres, sans construire d'URL de recherche. Choisissez une catégorie, une ou plusieurs villes ou codes postaux (géocodés automatiquement, vide = toute la France), puis vos critères : marque, modèle, carburant, boîte, année, kilométrage, prix, type de vendeur, carrosserie, couleur, puissance, Crit'Air, norme Euro, et pour les motos la cylindrée, le type et le permis. Tout autre filtre Leboncoin passe par l'objet `filters` avec les clés de l'URL leboncoin.fr. Chaque annonce est exportée avec son titre, son prix, sa description, ses attributs typés, ses photos et sa géolocalisation complète, en JSON, CSV ou Excel, ou via l'API Apify. Les proxies résidentiels français sont recommandés et pré-remplis. L'Actor est gratuit : vous ne payez que la consommation de la plateforme Apify sur votre propre compte, et `max_results` plafonne chaque run.

### 💬 Support

Questions, bugs or a feature request? Open an issue in the **Issues** tab of this Actor, I answer quickly. If Leboncoin Vehicles Scraper saves you time, a rating on the Store helps others find it.

# Actor input Schema

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

Which vehicle category to search. Car filters apply to cars/vans; motorbike filters (engine cc, type, licence) apply to motorbikes.

## `text` (type: `string`):

Optional free-text keywords, e.g. a model or trim.

## `locations` (type: `array`):

City, arrondissement or postal code, e.g. "Paris 11", "Lyon", "75011". Add several, or leave empty to search all of France.

## `vehicle_brand` (type: `string`):

Brand in UPPERCASE, e.g. RENAULT, PEUGEOT, BMW, YAMAHA, HONDA.

## `vehicle_model` (type: `string`):

Model as BRAND_Model, e.g. RENAULT_Clio, PEUGEOT_208, BMW_Serie 3.

## `fuel` (type: `array`):

One or more fuel types.

## `gearbox` (type: `array`):

Manual and/or automatic.

## `year_min` (type: `integer`):

Minimum registration year.

## `year_max` (type: `integer`):

Maximum registration year.

## `mileage_min` (type: `integer`):

Minimum mileage.

## `mileage_max` (type: `integer`):

Maximum mileage.

## `price_min` (type: `integer`):

Minimum price.

## `price_max` (type: `integer`):

Maximum price.

## `owner_type` (type: `string`):

Filter by seller.

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

Result ordering.

## `vehicle_type` (type: `array`):

Car body type.

## `vehicle_color` (type: `array`):

Vehicle colour.

## `doors_min` (type: `integer`):

Minimum number of doors.

## `seats_min` (type: `integer`):

Minimum number of seats.

## `power_min` (type: `integer`):

Minimum DIN horsepower.

## `critair_max` (type: `integer`):

Maximum Crit'Air rating (0 = cleanest, e.g. electric).

## `euro_standard` (type: `array`):

Emission standard.

## `vsp` (type: `array`):

With or without driving licence.

## `vehicle_condition` (type: `array`):

Vehicle condition.

## `cc_min` (type: `integer`):

Minimum engine displacement (motorbikes).

## `cc_max` (type: `integer`):

Maximum engine displacement (motorbikes).

## `cycle_type` (type: `array`):

Two-wheeler type.

## `motorcycle_type` (type: `array`):

Motorcycle style.

## `cycle_licence` (type: `array`):

Required licence (motorbikes).

## `filters` (type: `object`):

Any other Leboncoin vehicle filter — each entry is a key with either a list of codes (enum) or a {"min":.., "max":..} range. Example: {"u_car_model": \["RENAULT_Clio"], "horsepower": {"min": 4, "max": 7}, "vehicule_color": \["noir", "gris"]}. The full key/code tables are in the README (Filters reference section). Tip: build your search on leboncoin.fr and copy the URL query parameters — every key and value from the URL works here (e.g. fuel=2\&gearbox=2\&mileage=0-100000 → {"fuel": \["2"], "gearbox": \["2"], "mileage": {"max": 100000}}). Also lets you override any dedicated input above.

## `max_results` (type: `integer`):

How many listings to collect (0 = as many as available).

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

Residential FR proxies are recommended for reliable runs.

## Actor input object example

```json
{
  "category": "2",
  "locations": [
    "Lyon"
  ],
  "vehicle_brand": "RENAULT",
  "fuel": [
    "2"
  ],
  "year_min": 2018,
  "mileage_max": 150000,
  "price_max": 25000,
  "owner_type": "all",
  "sort": "relevance",
  "filters": {},
  "max_results": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "FR"
  }
}
```

# Actor output Schema

## `listings` (type: `string`):

All Leboncoin vehicle listings extracted by this run.

# 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 = {
    "locations": [
        "Lyon"
    ],
    "vehicle_brand": "RENAULT",
    "fuel": [
        "2"
    ],
    "year_min": 2018,
    "mileage_max": 150000,
    "price_max": 25000,
    "filters": {},
    "max_results": 100,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "FR"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapifier/leboncoin-voitures-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 = {
    "locations": ["Lyon"],
    "vehicle_brand": "RENAULT",
    "fuel": ["2"],
    "year_min": 2018,
    "mileage_max": 150000,
    "price_max": 25000,
    "filters": {},
    "max_results": 100,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "FR",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapifier/leboncoin-voitures-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 '{
  "locations": [
    "Lyon"
  ],
  "vehicle_brand": "RENAULT",
  "fuel": [
    "2"
  ],
  "year_min": 2018,
  "mileage_max": 150000,
  "price_max": 25000,
  "filters": {},
  "max_results": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "FR"
  }
}' |
apify call scrapifier/leboncoin-voitures-scraper --silent --output-dataset

```

## MCP server setup

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