PHPackages                             rfussien/leboncoin-crawler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. rfussien/leboncoin-crawler

AbandonedArchivedLibrary

rfussien/leboncoin-crawler
==========================

Makes data extraction from leboncoin.fr easy

2.3.0(9y ago)4136015MITHTMLPHP &gt;=7.0

Since Jan 9Pushed 8y ago3 watchersCompare

[ Source](https://github.com/rfussien/leboncoin-crawler)[ Packagist](https://packagist.org/packages/rfussien/leboncoin-crawler)[ Docs](https://github.com/rfussien/leboncoin-crawler)[ RSS](/packages/rfussien-leboncoin-crawler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (14)Used By (0)

Crawler for leboncoin.fr
========================

[](#crawler-for-leboncoinfr)

[![Latest Version on Packagist](https://camo.githubusercontent.com/90755bc113325d12377db46f448c7a70e8248016745ca97c91367e665091d629/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726675737369656e2f6c65626f6e636f696e2d637261776c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rfussien/leboncoin-crawler)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/376daca06a7d225e1229dbee60883e3ea1f8d5c6a18002c6f901c127bec5339c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f726675737369656e2f6c65626f6e636f696e2d637261776c65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/rfussien/leboncoin-crawler)[![Coverage Status](https://camo.githubusercontent.com/5b6fb35eb08de54a3a95779847f2131f5c25d4d7cde5a56065bf75411b71dbd6/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f726675737369656e2f6c65626f6e636f696e2d637261776c65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/rfussien/leboncoin-crawler/code-structure)[![Quality Score](https://camo.githubusercontent.com/c8474d0d9c5a104104d1ff58482e3cb4128d7324f2c6209b508493d4b5603770/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f726675737369656e2f6c65626f6e636f696e2d637261776c65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/rfussien/leboncoin-crawler)[![Total Downloads](https://camo.githubusercontent.com/2256c93ed46fada9da0b63aff0193b04cf2e78471622d0baa803e724b0a8158a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726675737369656e2f6c65626f6e636f696e2d637261776c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rfussien/leboncoin-crawler)

This is a small crawler package for the site [leboncoin.fr](http://www.leboncoin.fr).

Why ?
-----

[](#why-)

[leboncoin.fr](http://www.leboncoin.fr) is one of the most famous classified ads website in france. Whatever what you're looking for, it is probably there. It has a lots of ads and is very fast and simple to use.

However, the first problem comes when you need to exploit the search results in a way that the site can't help you. In fact, the search results page is pretty poor in terms of data. For exemple, it'd be so cool to get the mileage when I'm looking for a car or the surface when I'm looking for a flat.

The second problem is that saving a search is really a pain on the actual site. All the searches you want to save give one single result page. That's pretty dumb, but anyway.

And the third and last problem is that you are forced to use selected values with some criterias. For example, when I was looking for a motorcycle, I was looking for those with a bigger engine than 1200cc. The fact that the biggest value available in the input is 1000cc and because there are tons of ads with 1000cc motorcycle, it made search much more complicated. I did send an email to ask for an additional value, but I didn't get any answer (which I didn't expect anyway). So I had to change the value in the query string every single request... What a waste of time...

So for all those little reasons, I decided to write my good old web scraper to be able to extract the data from the site to anywhere (a DB, an array, a json, an api, who knows...).

Requirements
------------

[](#requirements)

- PHP 7
- \[optional\] PHPUnit to execute the test suite

Install
-------

[](#install)

```
$ composer require rfussien/leboncoin-crawler
```

Usage
-----

[](#usage)

**Super easy !!!**

### Get the structured data from a search result page

[](#get-the-structured-data-from-a-search-result-page)

```
(new Lbc\GetFrom)->search('');
// or with detailed ads
(new Lbc\GetFrom)->search('', true);
```

*example of output*:

```
[
  'page' => 2,
  'links' => [
    'current' => 'https://www.leboncoin.fr/ventes_immobilieres/offres/basse_normandie/?o=2&sqs=12&ret=1&location=Caen%2014000',
    'previous' => 'https://www.leboncoin.fr/ventes_immobilieres/offres/basse_normandie/?o=1&sqs=12&ret=1&location=Caen%2014000',
    'next' => 'https://www.leboncoin.fr/ventes_immobilieres/offres/basse_normandie/?o=3&sqs=12&ret=1&location=Caen%2014000',
  ],
  'total_ads' => 466,
  'total_page' => 14,
  'ads_per_page' => 35,
  'category' => 'ventes_immobilieres',
  'location' => 'Caen 14000',
  'search_area' => 'basse_normandie',
  'sort_by' => 'date',
  'type' => 'all',
  'ads' => [
    1117890265 => [
      'id' => '1117890265',
      'titre' => 'Maison 7 pièces 243 m²',
      'is_pro' => true,
      'prix' => 490000,
      'url' => 'https://www.leboncoin.fr/ventes_immobilieres/1117890265.htm',
      'created_at' => '2017-04-06',
      'images_thumbs' => 'https://img1.leboncoin.fr/ad-thumb/fdf29ab66506b52f5768c509cbd4c9940035b220.jpg',
      'nb_image' => '10',
      'placement' => 'Caen / Calvados',
    ],
    [...],
    1116940130 => [
      'id' => '1116940130',
      'titre' => 'Maison de ville 5 pièces 121 m²',
      'is_pro' => true,
      'prix' => 338000,
      'url' => 'https://www.leboncoin.fr/ventes_immobilieres/1116940130.htm',
      'created_at' => '2017-04-04',
      'images_thumbs' => 'https://img2.leboncoin.fr/ad-thumb/2bb09136b010d9009f0d5542c8699ede3f6bedfd.jpg',
      'nb_image' => '4',
      'placement' => 'Caen / Calvados',
    ],
  ],
]
```

### Get the structured data from an ad

[](#get-the-structured-data-from-an-ad)

```
(new Lbc\GetFrom)->ad('');
// or
(new Lbc\GetFrom)->ad('', '');
```

*example of output*:

```
[
    'id'            => '1072097995',
    'category'      => 'ventes_immobilieres',
    'images_thumbs' => [
        0 => 'https://img0.leboncoin.fr/ad-thumb/6c3962c95d1be2367d8b30f8cc1c04317be61cae.jpg',
        1 => 'https://img5.leboncoin.fr/ad-thumb/9346546557dc1cf9eafc0249c8f80e27530ec36f.jpg',
        2 => 'https://img6.leboncoin.fr/ad-thumb/f0e61ab47f008ae101c0ed03e3023d34ee37df5f.jpg',
        3 => 'https://img4.leboncoin.fr/ad-thumb/60a4a187064407bc792b421189e66f87e1a2425c.jpg',
        4 => 'https://img5.leboncoin.fr/ad-thumb/d34a4ef9545e60ae88169acbe4858608ba01e8a9.jpg',
    ],
    'images'        => [
        0 => 'https://img0.leboncoin.fr/ad-image/6c3962c95d1be2367d8b30f8cc1c04317be61cae.jpg',
        1 => 'https://img5.leboncoin.fr/ad-image/9346546557dc1cf9eafc0249c8f80e27530ec36f.jpg',
        2 => 'https://img6.leboncoin.fr/ad-large/f0e61ab47f008ae101c0ed03e3023d34ee37df5f.jpg',
        3 => 'https://img4.leboncoin.fr/ad-image/60a4a187064407bc792b421189e66f87e1a2425c.jpg',
        4 => 'https://img5.leboncoin.fr/ad-image/d34a4ef9545e60ae88169acbe4858608ba01e8a9.jpg',
    ],
    'properties'    => [
        'titre'          => 'Maison 11 pièces 450 m²',
        'created_at'     => '2017-02-18',
        'is_pro'         => 1,
        'prix'           => 1185000,
        'ville'          => 'Bayeux',
        'cp'             => '14400',
        'type_de_bien'   => 'Maison',
        'pieces'         => 11,
        'surface'        => 450,
        'reference'      => '394348',
        'ges'            => 'C (de 11 à 20)',
        'classe_energie' => 'C (de 91 à 150)',
    ],
    'description'   => 'Vente Maison/villa 11 piècesI@D France - [...]3562178Référence annonce : 394348',
]
```

There are a bunch of features if you digg a bit in the sources.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email me () instead of using the issue tracker.

Credits
-------

[](#credits)

- [Rémi FUSSIEN](https://github.com/:author_username)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~71 days

Recently: every ~42 days

Total

13

Last Release

3286d ago

Major Versions

1.0.6 → 2.0.02016-11-08

PHP version history (3 changes)1.0.0PHP &gt;=5.4

1.0.6PHP &gt;=5.6

2.3.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/488c93e63cb2701a038be750682c86b97ef3ddf63f6ad0397471e38dc77e7c4a?d=identicon)[rfussien](/maintainers/rfussien)

---

Top Contributors

[![rfussien](https://avatars.githubusercontent.com/u/3856033?v=4)](https://github.com/rfussien "rfussien (14 commits)")[![pitpit](https://avatars.githubusercontent.com/u/283481?v=4)](https://github.com/pitpit "pitpit (9 commits)")[![ptondereau](https://avatars.githubusercontent.com/u/4287777?v=4)](https://github.com/ptondereau "ptondereau (6 commits)")[![ninsuo](https://avatars.githubusercontent.com/u/4152132?v=4)](https://github.com/ninsuo "ninsuo (2 commits)")

---

Tags

crawlerleboncoinphp

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/rfussien-leboncoin-crawler/health.svg)

```
[![Health](https://phpackages.com/badges/rfussien-leboncoin-crawler/health.svg)](https://phpackages.com/packages/rfussien-leboncoin-crawler)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[spatie/laravel-sitemap

Create and generate sitemaps with ease

2.6k14.6M107](/packages/spatie-laravel-sitemap)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[ashallendesign/favicon-fetcher

A Laravel package for fetching website's favicons.

190272.4k3](/packages/ashallendesign-favicon-fetcher)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
