DEV Community

Cover image for How to Scrape Bien'ici Listings in Python with Bien'ici Scraper
ReventaData
ReventaData

Posted on Originally published at apify.com

How to Scrape Bien'ici Listings in Python with Bien'ici Scraper

By the end of this tutorial you will have a working Python script that extracts French real estate listings from bienici.com into structured dataset rows: price, surface area, room counts, floor, energy performance ratings, photo links and agency details.

Bien'ici is a French property portal covering real estate across France. Bien'ici Scraper (reventadata/bienici-scraper) is the Apify Actor built for this site to collect its listings. You provide a search by location, property type and price, and the Actor outputs clean dataset rows.

This tutorial runs the Actor using the official Apify API client for Python. Every sample row shown below comes directly from a real run on the live Actor covering listings in Lyon, without invented values or artificial timings. ⏱️ This tutorial takes about 10 minutes to complete from scratch.


Prerequisites

You need three straightforward components to get started:

  1. Python 3.11 or newer installed on your system with pip available.
  2. A free Apify account, created with an email address or GitHub login.
  3. Your Apify API token, found under Settings > API & Integrations in Apify Console.

Install the Apify client and export your token in your terminal:

pip install -U "apify-client~=3.0"
export APIFY_API_TOKEN="your_apify_token_here"
Enter fullscreen mode Exit fullscreen mode

No browser automation or local proxy setup is required. The Actor runs entirely in the cloud.


What you'll achieve

You will run a search for property listings in Lyon, read back the structured rows in Python, and print clean summaries showing each property's asking price, surface area, price per square metre, and official French energy performance class (DPE).

The Actor reads public listings directly, so no login credentials are required. In addition to standard sales, searches on the platform return specialised transactions such as life annuities (lifeAnnuitySale) and new-build programmes (programme). You will see how the Actor labels these categories and handles optional fields.

Whether you are monitoring price trends across French cities, comparing energy efficiency ratings across neighbourhoods, or building a property database, this setup handles the data extraction with minimal code.


Step 1: Access Bien'ici Scraper

Open the Bien'ici Scraper page on Apify Store. Clicking the Try for free button opens the Actor in Apify Console.

Because this guide interacts with the Actor programmatically from Python via the API, you do not need to configure anything in the browser UI. You only need the Actor's technical identifier: reventadata/bienici-scraper.


Step 2: Configure search inputs

The Actor provides several configuration parameters to customize your extraction:

  • transaction: Choose "buy" (default) or "rent". Any unrecognised transaction value is refused before the run starts.
  • locations: A list of French city names or postal codes, such as ["Lyon"] or ["75011"]. Each entry is resolved against the site's place index. An unknown location stops the run with an informative error. Leaving this empty searches all of France.
  • propertyTypes: Property categories to include: "flat" (appartement) and/or "house" (maison). Both are included by default.
  • minPrice and maxPrice: Numeric price boundaries in EUR (or monthly rent for rental searches).
  • sortBy: Order of listings: "relevance" (default), "priceAsc", "priceDesc", or "newest".
  • maxItems: Total number of listings to collect (default is 100).
  • splitLargeSearches: Enabled by default. The site enforces a ceiling of 2,500 ads per individual search; when enabled for searches exceeding this ceiling, the Actor cuts the query into price bands to capture the full volume.
  • fetchContacts: Disabled by default. When enabled, it makes one additional request per listing to populate agency name, contact phone, and professional registration numbers.

The input used for our example run requests 10 listings in Lyon:

{
    "locations": [
        "Lyon"
    ],
    "maxItems": 10
}
Enter fullscreen mode Exit fullscreen mode

Step 3: Run the Actor from Python

The following Python script initializes the Apify client, triggers reventadata/bienici-scraper, waits for execution to complete, and iterates over the dataset items:

import os
from apify_client import ApifyClient

# 1. Initialise the client with your token from the environment
client = ApifyClient(os.environ["APIFY_API_TOKEN"])

# 2. Describe the search: listings in Lyon, up to 10 items
run_input = {
    "locations": [
        "Lyon"
    ],
    "maxItems": 10,
}

# 3. Start the Actor and wait for it to finish
run = client.actor("reventadata/bienici-scraper").call(run_input=run_input)
if run is None or run.status != "SUCCEEDED":
    status = run.status if run else "unknown"
    raise SystemExit(f"Run did not succeed (status: {status}).")

# 4. Read the rows from the run's default dataset
items = client.dataset(run.default_dataset_id).list_items().items
print(f"Retrieved {len(items)} listings.\n")

# 5. Print a summary per listing
for item in items:
    city = item.get("city")
    price = item.get("price")
    area = item.get("surfaceAreaM2")
    per_m2 = item.get("pricePerSquareMeter")
    per_m2_str = f"{per_m2:.1f} EUR/m2" if per_m2 else "no m2 price"
    print(f"{item.get('title')}")
    print(f"  {city} | {price} EUR | {area} m2 | {per_m2_str} | Energy: {item.get('energyClass')}")
Enter fullscreen mode Exit fullscreen mode

Run this script in your terminal using Python. The Actor executes remotely and streams output rows directly to its Apify dataset.


Step 4: View the output

When the script finishes, it prints listing summaries. Here is the output for the first three listings from our real run:

Spécial investisseur - Studio meublé en résidence étudiante
  Lyon 9e | 40000 EUR | 18 m2 | 2222.2 EUR/m2 | Energy: D
Viager occupé - H72 ans - LYON (69005)
  Lyon 5e | 43810 EUR | 60 m2 | no m2 price | Energy: C
STUDIO ETUDIANT LMNP SPECIAL INVEST
  Lyon 9e | 44000 EUR | 17 m2 | 2588.2 EUR/m2 | Energy: C
Enter fullscreen mode Exit fullscreen mode

Notice that the second listing is a life annuity (lifeAnnuitySale). In French viager listings, the initial cash payment (bouquet) is listed as the price, and the site does not report a standard price per square metre, leaving pricePerSquareMeter as null. The Actor preserves missing data accurately without guessing.


Step 5: Add agency contact details (optional)

If your workflow requires professional agency details, set "fetchContacts": true in your input configuration.

When this option is enabled, the Actor performs one additional request per listing to extract public agency data, including agencyName, contactName, contactPhone, agencyRcs, agencyStreet, agencyCity, agencyPostalCode, agencyWebsite, and agencyId. If a contact lookup fails for any individual ad, the listing is still retained in the dataset with those specific contact columns set to null.


Understanding your results

Every row carries 67 fields in the dataset schema. The key attributes you will encounter most:

  • price, pricePerSquareMeter, currency: the financial figures in euros.
  • surfaceAreaM2, rooms, bedrooms, floor: the physical layout.
  • city, postalCode, departmentCode, district: the location breakdown.
  • energyClass, greenhouseGasClass: the official French DPE and GES ratings.
  • photos, photoCount: hosted image links and photo count.

One row from the run (null fields dropped, description shortened, photos cut to first link):

{
    "id": "ag311656-540248687",
    "url": "https://www.bienici.com/annonce/ag311656-540248687",
    "transaction": "buy",
    "propertyType": "flat",
    "title": "Spécial investisseur - Studio meublé en résidence étudiante",
    "description": "Dans la résidence Nexity La Duchère, située dans un quartier calme au nord de Lyon...",
    "price": 40000,
    "currency": "EUR",
    "pricePerSquareMeter": 2222.222222222222,
    "priceWithoutFees": 40000,
    "priceHasDecreased": false,
    "surfaceAreaM2": 18,
    "rooms": 1,
    "bedrooms": 0,
    "floor": 2,
    "floorsInBuilding": 6,
    "city": "Lyon 9e",
    "postalCode": "69009",
    "departmentCode": "69",
    "district": "Lyon 9e Arrondissement - La Duchère",
    "latitude": 45.78734972680843,
    "longitude": 4.794521345968208,
    "locationBlurRadiusM": 125,
    "energyClass": "D",
    "energyValue": 270,
    "greenhouseGasClass": "C",
    "greenhouseGasValue": 24,
    "yearOfConstruction": 2006,
    "annualCondominiumFees": 429.999999999996,
    "modifiedAt": "2026-11-13T01:49:23.903Z",
    "sellerType": "mandatary",
    "reference": "338476",
    "photoCount": 5,
    "photos": [
        "https://file.bienici.com/photo/ag311656-540248687_photos.ubiflow.net_311656_540248687_photos_1.jpg_INSOON_EB_5512801818_20260711122226"
    ]
}
Enter fullscreen mode Exit fullscreen mode

Fields left empty on the site appear as null.


Pro tips

  1. Leverage automatic price-band splitting. Bien'ici limits individual query pagination to 2,500 ads. For large metropolitan areas containing thousands of properties, keep splitLargeSearches: true so the Actor partitions the price spectrum and retrieves listings beyond the 2,500 boundary.
  2. Handle new-build developments properly. New-build programmes (propertyType: "programme") often span a range of prices and living areas. The Actor stores the minimum value in price and surfaceAreaM2, and the upper bound in priceMax and surfaceAreaMaxM2.
  3. Account for map position blurring. Bien'ici displays property locations as blurred circular areas rather than precise street addresses. Use latitude and longitude alongside locationBlurRadiusM for radius calculations.
  4. Filter by transaction type. Rent searches return monthly lease figures, with additional fields like charges, safetyDeposit, and isFurnished populated when provided.
  5. Deduplication is automatic. When traversing adjacent price bands, boundary properties may appear in multiple slices. The Actor deduplicates items by listing identifier, ensuring each ad is pushed only once.
  6. Fetch contact details selectively. Enabling fetchContacts adds an individual network request per row. Keep it disabled for high-volume market research where only property dimensions and prices are needed.

Troubleshooting

  • Zero rows with status SUCCEEDED: The target location returned no matching listings for your filter criteria, or the search returned an empty set. Review your search parameters and check whether loosening price or property type constraints yields results.
  • Run stops with status FAILED: An invalid input value was passed (such as a negative price or an unrecognised location name). The run terminates with an informative message indicating which input parameter must be corrected.
  • Missing contact details: The agency contact fields (agencyName, contactPhone, etc.) remain null unless "fetchContacts": true is explicitly provided in your input.
  • Fewer rows than expected: The run log in Apify Console lists the skipped entries and rejection counts (such as duplicate IDs across price bands).

Always ensure that your automated collection complies with applicable terms of service and French and EU data privacy regulations (GDPR).


Next steps

For current pricing and details, see the Store page.

To automate this workflow on a recurring cadence, you can create an Apify task and configure an Apify schedule with a cron expression. Collected datasets can be exported in formats including JSON, CSV, Excel, XML, or NDJSON (dataset docs). Furthermore, you can attach an Apify webhook to receive automated notifications when a collection run finishes (webhook docs).

Have questions or a specific use case in mind? Share your feedback in the comments! 💬

About the author: reventadata builds and publishes data extraction Actors on the Apify Store.

Top comments (0)