Skip to content
/ lbc Public
forked from etienne-hd/lbc

Unofficial client for Leboncoin API

License

Notifications You must be signed in to change notification settings

Rovis91/lbc

 
 

Repository files navigation

lbc - Leboncoin API Client

This project is a fork of etienne-hd/lbc.

Key Features

  • Datadome Bypass: This version includes enhancements to help bypass Datadome protection mechanisms, allowing for more reliable requests.
  • Simple API: Easy-to-use Python wrapper for Leboncoin's API.

⚠️ Legal Disclaimer

I am not legally responsible for any use made of this software.

This tool is provided strictly for educational and research purposes. By using this software, you agree that you are solely responsible for compliance with all applicable laws and regulations, including Leboncoin's Terms of Service. The author assumes no liability for any bans, blocks, or legal consequences resulting from the use of this tool.

Usage

Here is a basic example of how to initialize the client and perform a search:

import lbc

client = lbc.Client()

# Define a location (e.g., Paris with a 10km radius)
location = lbc.City( 
    lat=48.85994982004764,
    lng=2.33801967847424,
    radius=10_000, 
    city="Paris"
)

# Perform a search
result = client.search(
    text="maison",
    locations=[location],
    page=1,
    limit=35,
    sort=lbc.Sort.NEWEST,
    ad_type=lbc.AdType.OFFER,
    category=lbc.Category.IMMOBILIER,
    square=[200, 400],
    price=[300_000, 700_000]
)

# Display results
for ad in result.ads:
    print(ad.url, ad.subject, ad.price)

Using a Proxy

To further reduce the risk of detection, you can configure the client with a proxy:

proxy = lbc.Proxy(
    host="your.proxy.host",
    port=1234,
    username="user",
    password="password"
)
client = lbc.Client(proxy=proxy)

Advanced Search

You can customize your search with specific filters (category, real estate type, etc.) or even use a full Leboncoin URL:

# Search using specific parameters
client.search(
    text="maison",
    locations=[location],
    page=1,
    limit=35,
    sort=lbc.Sort.NEWEST,
    # ... other filters
)

# Search using a direct URL
client.search(
    url="https://www.leboncoin.fr/recherche?category=9&text=maison...",
    page=1,
    limit=35
)

License

See the LICENSE file for details.

About

Unofficial client for Leboncoin API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%