A Python scraper for extracting property listings from Wikicasa.it (Italian real estate portal) using the ScrapingAnt API.
- Scrapes apartments, houses, villas, commercial properties, and more
- Supports sale and rental listings
- Covers all major Italian cities
- Parallel scraping for improved performance
- Extracts 30+ property attributes including price, area, rooms, location, amenities
- Exports data to CSV format
- Rate limiting and retry logic for reliability
- Clone the repository:
git clone https://github.com/kami4ka/WikicasaScraper.git
cd WikicasaScraper- Create a virtual environment and install dependencies:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt# Scrape residential properties for sale in Rome
python main.py --category vendita-case --location roma
# Scrape apartments for rent in Milan
python main.py --category affitto-appartamenti --location milano --limit 100
# Scrape villas for sale in Florence with custom output
python main.py --category vendita-ville --location firenze --output firenze_villas.csv
# Enable verbose logging
python main.py --category vendita-case --location napoli -v| Option | Description |
|---|---|
--category, -c |
Property category (default: vendita-case) |
--location, -l |
City to search in (optional) |
--output, -o |
Output CSV file path (default: properties.csv) |
--limit |
Maximum number of properties to scrape |
--max-pages |
Maximum number of pages to scrape |
--max-workers, -w |
Maximum parallel requests (default: 10) |
--api-key, -k |
ScrapingAnt API key (overrides config) |
--verbose, -v |
Enable verbose logging |
| Category | Description |
|---|---|
vendita-case |
Residential properties for sale |
vendita-appartamenti |
Apartments for sale |
vendita-ville |
Villas for sale |
vendita-ville-a-schiera |
Townhouses for sale |
vendita-attici |
Penthouses/attics for sale |
vendita-case-indipendenti |
Independent houses for sale |
vendita-rustici |
Farmhouses for sale |
vendita-loft |
Lofts for sale |
vendita-nuove-costruzioni |
New construction for sale |
vendita-box |
Garages for sale |
vendita-commerciale |
Commercial properties for sale |
vendita-terreni-edificabili |
Building land for sale |
vendita-terreni-agricoli |
Agricultural land for sale |
vendita-palazzi |
Buildings for sale |
affitto-case |
Residential properties for rent |
affitto-appartamenti |
Apartments for rent |
affitto-ville |
Villas for rent |
affitto-stanze |
Rooms for rent |
affitto-box |
Garages for rent |
affitto-commerciale |
Commercial properties for rent |
Major Cities: Roma, Milano, Napoli, Torino, Palermo, Genova, Bologna, Firenze, Bari, Catania, Venezia, Verona, Messina, Padova, Trieste, Brescia, Parma, Modena, Reggio-Emilia, Perugia, Livorno, Ravenna, Cagliari, Rimini, Salerno, Ferrara, Pescara, Monza, Bergamo, Trento, Vicenza, Como, Pisa, Lucca, Arezzo, Siena, Siracusa, Ragusa, Sassari, Ancona, Lecce, Taranto, Brindisi, Foggia, and many more.
The scraper exports data to CSV with the following fields:
| Field | Description |
|---|---|
| url | Property listing URL |
| title | Property title/description |
| listing_id | Listing ID |
| reference_external | External reference number |
| reference_property | Property reference |
| price | Listed price in EUR |
| price_per_sqm | Price per square meter |
| living_area | Living area in m² |
| rooms | Number of rooms |
| bedrooms | Number of bedrooms |
| bathrooms | Number of bathrooms |
| floor | Floor level |
| total_floors | Total floors in building |
| elevator | Elevator availability |
| year_built | Year of construction |
| property_type | Property type |
| contract_type | Sale or rent |
| condition | Property condition |
| building_condition | Building condition |
| balcony | Balcony availability |
| terrace | Terrace availability |
| garden | Garden availability |
| garage | Garage availability |
| parking | Parking availability |
| heating | Type of heating system |
| air_conditioning | AC availability |
| energy_class | Energy certificate class |
| condominium_expenses | Monthly condominium expenses |
| address | Full address |
| zone | Zone/neighborhood |
| city | City name |
| province | Province |
| region | Region |
| description | Property description |
| other_features | Additional features |
| agency_name | Agent/advertiser name |
| date_updated | Last update date |
This scraper uses the ScrapingAnt API for web scraping. You can provide the API key via:
- Environment variable:
export SCRAPINGANT_API_KEY=your_key - Command line:
--api-key YOUR_KEY
Configuration options in config.py:
SCRAPINGANT_API_KEY: Your API keyDEFAULT_MAX_WORKERS: Parallel request limit (default: 10)DEFAULT_TIMEOUT: Request timeout in seconds (default: 120)MAX_RETRIES: Number of retry attempts (default: 3)
MIT License