This project is a fork of etienne-hd/lbc.
- 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.
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.
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)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)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
)See the LICENSE file for details.