# Leboncoin Deal Score : prix médian, marge, revendeurs (`bonpleincapital/leboncoin-deal-score`) Actor

Cette annonce Leboncoin est-elle une bonne affaire ? Prix médian, score 0-100 et marge de revente par annonce, pour revendeurs. Créé avec l'aide d'une IA.

Licence : usage personnel uniquement ; revente et redistribution interdites.
Créé avec l'aide de l'intelligence artificielle.

- **URL**: https://apify.com/bonpleincapital/leboncoin-deal-score.md
- **Developed by:** [Bon Plein Capital](https://apify.com/bonpleincapital) (community)
- **Categories:** E-commerce, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 88.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 annonce scorées

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 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 Deal Score : prix médian, marge, bonnes affaires pour revendeurs

**Cette annonce est-elle une vraie bonne affaire ?** Leboncoin Deal Score lit les annonces publiques d'une recherche Leboncoin, calcule le **prix médian** et donne à chaque annonce un **score d'affaire** de 0 à 100, avec la **marge potentielle** en euros. Pensé pour les **revendeurs** et les chineurs : repérez en quelques secondes les annonces nettement sous le prix du marché, sans comparer des dizaines de fiches à la main. Export JSON, CSV ou Excel, ou appel par l'API.

### Un résultat concret

Recherche « iPhone 13 » à Lyon. Médiane : **380 €**. Une annonce à **270 €** donne :

| Médiane | Annonce | Score | Verdict | Marge si revendu à la médiane |
|---|---|---|---|---|
| 380 € | 270 € | 71 / 100 (≈ 7/10) | good | 110 € |

Ces chiffres illustrent la formule, ce ne sont pas des prix en direct.

### Aide-mémoire en 3 étapes

1. **Chercher** : lancez une requête précise (marque + modèle), éventuellement avec une ville.
2. **Comparer** : lisez `median_price_category`, `score_affaire` et `potential_margin_eur`, triés du meilleur au moins bon.
3. **Acheter** : ouvrez l'`url` des scores 60 et plus, vérifiez l'état de l'objet, achetez, revendez près de la médiane.

### Que fait cet Actor ?

- Cherche un mot-clé sur Leboncoin (par exemple « vélo électrique ») avec une ville facultative.
- Calcule la médiane des annonces avec prix, sans les prix symboliques (moins de 5 €) ni les valeurs aberrantes.
- Note chaque annonce : 50 = prix médian, 100 = moitié du prix médian ou moins, 0 = 1,5 fois la médiane ou plus.
- Trie les résultats : meilleures affaires d'abord, avec l'écart à la médiane en %, la ville et le lien.

### Mode d'emploi

1. Cliquez sur **Try for free** puis ouvrez l'onglet **Entrée**.
2. Saisissez la recherche et, si besoin, une ville.
3. Réglez le nombre maximum d'annonces, puis cliquez sur **Start**.
4. Téléchargez le jeu de données, ou branchez-le sur Make, Zapier ou n8n pour des alertes.

### Entrée

```json
{
  "query": "vélo électrique",
  "location": "Lyon",
  "maxItems": 20,
  "minScore": 60,
  "maxPrice": 1000
}
```

Filtres facultatifs : `minPrice`, `maxPrice` (EUR) et `minScore` (0-100). La médiane est toujours calculée sur toutes les annonces lues, avant filtrage.

#### Autres exemples

- Prix du marché : `{"query": "PS5 console", "maxItems": 30}`, puis lisez `median_price_category`.
- Bonnes affaires près de chez vous : `{"query": "MacBook Air M1", "location": "Paris", "minScore": 65}`.
- Petit budget : `{"query": "vélo de route", "minPrice": 50, "maxPrice": 300, "minScore": 60}`.

#### Trois exemples de score

Score = 50 + (1 − prix / médiane) × 100, borné entre 0 et 100.

| Recherche (médiane) | Prix | Score | Verdict | Marge |
|---|---|---|---|---|
| « PS5 console » (400 €) | 280 € | 80 | excellent | 120 € |
| « vélo de route » (350 €) | 260 € | 76 | excellent | 90 € |
| « MacBook Air M1 » (600 €) | 540 € | 60 | good | 60 € |

#### Lire le score

| Score | Verdict | Sens |
|---|---|---|
| 75-100 | excellent | 25 % sous la médiane : vérifiez d'abord dégâts ou arnaque |
| 60-74 | good | vraie marge de revente |
| 45-59 | fair | autour du prix du marché |
| 0-44 | overpriced | au-dessus du marché |

#### Check-list revendeur

- \[ ] Requête = marque + modèle : `median_sample_size` de 10 ou plus.
- \[ ] Score 60+ et marge supérieure à vos frais (commission, envoi, réparation).
- \[ ] Score au-dessus de 80 ? Méfiance : photos, état, arnaque ; ne payez jamais d'avance.
- \[ ] Relancez chaque jour avec `minScore: 65` et envoyez le résultat vers vos alertes.

### Sortie

```json
{
  "title": "Vélo électrique pliable",
  "price": 450,
  "score_affaire": 72,
  "verdict": "good",
  "potential_margin_eur": 170,
  "median_price_category": 620,
  "median_sample_size": 18,
  "price_vs_median_pct": -27.4,
  "city": "Lyon",
  "url": "https://www.leboncoin.fr/ad/velos/123",
  "published": "2026-11-15 10:00:00"
}
```

Si Leboncoin refuse la requête ou si la recherche est vide, l'Actor se termine proprement avec une seule ligne `status` (non facturée) qui explique la situation.

### Combien ça coûte ?

Tarification **à l'événement** : un événement `result` par annonce renvoyée, soit environ 1 $ les 1 000 résultats (voir l'onglet **Pricing**). Rien n'est facturé pour les annonces non renvoyées ni pour la ligne de statut.

### FAQ

#### Est-ce légal ?

L'Actor lit seulement des pages de recherche publiques, jamais de compte privé, et ne contourne aucun captcha. Vous restez responsable de l'usage des données, dont le RGPD si vous stockez des données personnelles. Sans lien avec Leboncoin.

#### Pourquoi aucun résultat ?

La recherche est peut-être vide, ou la protection anti-bot (DataDome) a refusé la requête. L'Actor réessaie avec une nouvelle IP française, sans jamais contourner de captcha. Précisez la requête ou réessayez plus tard.

#### Le score est-il un conseil financier ?

Non, c'est une simple comparaison au prix médian des résultats.

#### Puis-je l'utiliser par l'API ?

Oui, via l'API Apify et ses clients Python et JavaScript.

***

Created with the help of artificial intelligence. (Créé avec l'aide d'une intelligence artificielle.)

# Changelog

This Actor's version history is a separate document: https://apify.com/bonpleincapital/leboncoin-deal-score/changelog.md

# Actor input Schema

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

Ce que vous cherchez sur Leboncoin, par exemple « vélo électrique ». Soyez précis (marque + modèle).

## `location` (type: `string`):

Ville ou code postal facultatif, par exemple « Lyon ». Vide : toute la France.

## `minPrice` (type: `integer`):

Facultatif : masque les annonces moins chères (la médiane utilise toutes les annonces).

## `maxPrice` (type: `integer`):

Facultatif : masque les annonces plus chères.

## `minScore` (type: `integer`):

Facultatif : ne garder que les vraies bonnes affaires, par exemple 65. 50 = prix médian.

## `maxItems` (type: `integer`):

S'arrête après ce nombre d'annonces. Gardez-le bas pour tester à petit prix.

## Actor input object example

```json
{
  "query": "vélo électrique",
  "location": "Lyon",
  "minScore": 0,
  "maxItems": 20
}
```

# Actor output Schema

## `results` (type: `string`):

One dataset item per result, shown in the Overview view.

# 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 électrique",
    "location": "",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("bonpleincapital/leboncoin-deal-score").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 électrique",
    "location": "",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("bonpleincapital/leboncoin-deal-score").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 '{
  "query": "vélo électrique",
  "location": "",
  "maxItems": 20
}' |
apify call bonpleincapital/leboncoin-deal-score --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bonpleincapital/leboncoin-deal-score"
        }
    }
}
```

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/GLTKvRI2rj54VMnKM/builds/BVcACXdsMxFGql38x/openapi.json
