npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

leboncoin-api

v0.0.45

Published

leboncoin.fr API

Downloads

81

Readme

leboncoin-api Build Status Coverage Status

NPM

/!\ leboncoin.fr is using DataDome to protect his API from library likes this one, it is library is not reliable in production anymore /!\

Documentation

The documentation of the library is available here: https://durieux.me/projects/leboncoin.html.

Install

npm install leboncoin-api

Features

  • Search on leboncoin.fr with all functionality available leboncoin.fr
  • Get the detailed page of an item
  • Get the phone number of the seller (convert the image to string) /!\ This API have an unknown usage limit

Usage

const leboncoin = require('leboncoin-api');
var search = new leboncoin.Search()
    .setPage(1)
    .setQuery("renove")
    .setFilter(leboncoin.FILTERS.PARTICULIER)
    .setCategory("locations")
    .setRegion("ile_de_france")
    .setDepartment("yvelines")
    .setLocation([
                 {"zipcode": "78100"},
                 {"zipcode": "78000"},
                 ])
//Search around you with latitude and longitude of your position and a radius in meters. Doing so you don't need to set Region, Department and Location
//Exemple for 30km around Lyon
//.setArea({"lat": 45.7679705, "lng": 4.8637901999999995, "radius": 30000})

    //Add sort, two kind date or price and two ways asc or desc
    //Exemple for a sort by date asc (older the first)
    //.setSort({sort_by:"date",sort_order:"asc"})

    .addSearchExtra("price", {min: 1500, max: 2000}) // will add a range of price
    .addSearchExtra('furnished', ["1", "Non meublé"]); // will add enums for Meublé and Non meublé

// Please check into categories & sub categories constants to know which are the sub categories to add into "addSearchExtra"

search.run().then(function (data) {
    console.log(data.page); // the current page
    console.log(data.pages); // the number of pages
    console.log(data.nbResult); // the number of results for this search
    console.log(data.results); // the array of results
    data.results[0].getDetails().then(function (details) {
        console.log(details); // the item 0 with more data such as description, all images, author, ...
    }, function (err) {
        console.error(err);
    });
    data.results[0].getPhoneNumber().then(function (phoneNumer) {
        console.log(phoneNumer); // the phone number of the author if available
    }, function (err) {
        console.error(err); // if the phone number is not available or not parsable (image -> string) 
    });
}, function (err) {
    console.error(err);
});

License MIT