
Idealista Scraper (Spain)
Pricing
Pay per event

Idealista Scraper (Spain)
Need to search for apartments to rent or buy? Use this API to automate scraping Idealista.com search results, the number one apartment website in Spain. Soon we will add support for Italy and Portugal as well, but for now, only Spain is supported.
0.0 (0)
Pricing
Pay per event
0
Total users
2
Monthly users
2
Runs succeeded
0%
Last modified
3 days ago
🏠 Idealista Apartment Scraper - Apify Actor
A powerful Apify actor that scrapes apartment listings from Idealista.com. Perfect for real estate monitoring, market research, and data collection.
✨ Features
- 🔍 Flexible scraping: Search by locations or provide direct URLs
- 📊 Rich data extraction: Price, bedrooms, area, floor, amenities (elevator, parking)
- 🛡️ Robust handling: Retry logic with exponential backoff for failed requests
- 🌐 Multi-location support: Scrape multiple neighborhoods simultaneously
- 📱 Structured output: Clean JSON data ready for analysis
- 🔧 Easy configuration: Simple input schema with URL validation
- 🚀 Pagination support: Automatically handles multiple pages of listings
- ⚡ Performance optimized: Reduced API calls with intelligent page reuse
📋 Input Configuration
Search Method (Choose One)
You must provide either locations
OR targetUrls
(not both):
Option 1: Location-Based Search
locations
(array): List of location paths to scrape- Format:
["district/neighborhood", "district/neighborhood"]
- Example:
["sarria-sant-gervasi/sant-gervasi-galvany", "eixample/la-dreta-de-l-eixample"]
- Format:
baseCity
(string): Base city for location-based searches (default: "barcelona")- Used to construct URLs as:
https://www.idealista.com/en/{operation}/{baseCity}/{location}
- Used to construct URLs as:
Option 2: Direct URL Search
targetUrls
(array): Direct URLs to scrape (overrides locations if provided)- Must be from idealista.com domain
- Will automatically add
/en/
if not present - Example:
["https://www.idealista.com/en/venta-viviendas/barcelona/..."]
Optional Filters
operationType
(string): Type of property search (default: "buy")- Options:
"buy"
(venta-viviendas),"rent"
(alquiler-viviendas)
- Options:
minPrice
(integer): Minimum price filter in eurosmaxPrice
(integer): Maximum price filter in eurosminArea
(integer): Minimum area filter in square metersmaxArea
(integer): Maximum area filter in square meterstimeFilter
(string): Time filter for listings (default: "publicado_ultimas-48-horas")- Options:
"publicado_ultimas-24-horas"
,"publicado_ultimas-48-horas"
,"publicado_ultima-semana"
,"publicado_ultimo-mes"
- Options:
sortOrder
(string): Sort order for listings (default: "fecha-publicacion-desc")- Options:
"fecha-publicacion-desc"
,"fecha-publicacion-asc"
,"precio-desc"
,"precio-asc"
,"metros-desc"
,"metros-asc"
- Options:
🚀 Usage Examples
Example 1: Location-Based Search (Barcelona)
{"locations": ["sarria-sant-gervasi/sant-gervasi-galvany","eixample/la-dreta-de-l-eixample"],"baseCity": "barcelona","minPrice": 300000,"maxPrice": 500000,"minArea": 60,"maxArea": 120,"timeFilter": "publicado_ultimas-48-horas"}
Example 2: Rental Properties Search
{"locations": ["sarria-sant-gervasi/sant-gervasi-galvany"],"baseCity": "barcelona","operationType": "rent","minPrice": 1200,"maxPrice": 2500,"minArea": 60,"timeFilter": "publicado_ultimas-48-horas"}
Example 3: Direct URLs (Advanced)
{"targetUrls": ["https://www.idealista.com/en/venta-viviendas/barcelona/sarria-sant-gervasi/sant-gervasi-galvany/con-precio-hasta_500000,precio-desde_300000,metros-cuadrados-mas-de_60,publicado_ultimas-48-horas/?ordenado-por=fecha-publicacion-desc"]}
Example 4: Minimal Configuration
{"locations": ["gracia/gracia"],"baseCity": "barcelona"}
Example 5: Multiple Filters
{"locations": ["eixample/la-dreta-de-l-eixample"],"baseCity": "barcelona","operationType": "buy","minPrice": 400000,"maxPrice": 600000,"minArea": 70,"maxArea": 100,"timeFilter": "publicado_ultima-semana","sortOrder": "precio-asc"}
📊 Output Data
Each apartment listing includes these fields:
{"title": "Apartment for sale in Carrer de Muntaner, Sant Gervasi Galvany, Barcelona","price": "450000","bedrooms": "2","area": "75 m²","floor": "3","elevator": "Yes","parking": "No","location": "Sant Gervasi Galvany","address": "Carrer de Muntaner","description": "Bright apartment with natural light and modern finishes...","tags": "exterior, renovated, balcony","image_urls": "https://img3.idealista.com/blur/WEB_LISTING-M/0s60:2560x1707/...","listing_url": "https://www.idealista.com/inmueble/98765432/","search_area": "Sarria Sant Gervasi - Sant Gervasi Galvany"}
Field Descriptions
title
: Full apartment title from listingprice
: Price in euros (numeric string, no formatting)bedrooms
: Number of bedrooms (string) or "N/A" if not foundarea
: Area with unit (e.g., "75 m²")floor
: Floor number (string) or "N/A" if not foundelevator
: "Yes" or "No" based on listing detailsparking
: "Yes" or "No" based on listing detailslocation
: Neighborhood name extracted from titleaddress
: Street address extracted from titledescription
: Property description texttags
: Comma-separated property featuresimage_urls
: Comma-separated list of image URLslisting_url
: Direct URL to the apartment listingsearch_area
: Formatted search area name for grouping
🔧 Setup & Deployment
Deploy to Apify
- Fork this repository
- Connect to Apify Console
- Set up your actor
- Configure and run with your desired input parameters
Local Development
# Install dependenciespip install -r requirements.txt# Run locallypython main.py
🏗️ Architecture
main.py # Apify entry point├── Gets input parameters├── Validates configuration├── Initializes scraper└── Saves results to datasetidealista_scraper.py # Core scraping logic├── URL generation and validation├── Web scraping integration├── Data extraction and parsing├── Pagination handling└── Error handling with retries
📍 Supported Locations
The actor supports neighborhoods following the format:
{district}/{neighborhood}
- Example:
sarria-sant-gervasi/sant-gervasi-galvany
Common Barcelona Locations
sarria-sant-gervasi/sant-gervasi-galvany
eixample/la-dreta-de-l-eixample
eixample/l-antiga-esquerra-de-l-eixample
gracia/gracia
ciutat-vella/el-born
sants-montjuic/sants
horta-guinardo/horta
sant-marti/poblenou
Note: When using locations
, you must also specify baseCity
(defaults to "barcelona").
🔄 Rate Limits & Costs
- Apify: Compute units based on runtime
- Pagination: Each page requires a separate API call
- Recommendation: Start with small batches to estimate costs
Cost Optimization
- Use specific time filters (
publicado_ultimas-24-horas
vspublicado_ultimo-mes
) - Apply price and area filters to reduce result volume
- Target specific neighborhoods rather than broad searches
🛠️ Troubleshooting
Common Issues
-
No results found:
- Check if location paths are correct
- Verify baseCity matches the location format
- Try broader search criteria
-
Scraping errors:
- Check for temporary site issues
- Verify URLs are properly formatted
-
Timeout issues:
- Reduce batch size
- Try fewer concurrent requests
-
Invalid URLs:
- Ensure targetUrls are from idealista.com
- URLs will automatically get
/en/
added if missing
Debugging
- Check actor logs for detailed error messages
- Verify input parameters match expected format
- Test with a single location first
- Use the Actor's run detail page to inspect logs
📈 Performance Tips
- Batch processing: Process multiple locations in single run
- Time filters: Use recent filters to reduce data volume
- Price ranges: Narrow price ranges for focused results
- Monitoring: Set up regular runs for continuous monitoring
- Pagination: The actor automatically handles multiple pages
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
📝 Recent Updates
Version 0.0.7 (Latest)
- Removed
scraped_at
field: Timestamp field removed from output data - Renamed
apartment_url
tolisting_url
: Field name updated for better clarity - Removed bathroom data: Bathroom information no longer extracted
- Removed furnished data: Furnished status no longer extracted
- Enhanced bedroom extraction: Improved detection of bedroom count from listings
- Optimized pagination: Reduced API calls by reusing first page response
- URL validation: Added validation for targetUrls to ensure they're from idealista.com
- Auto-add /en/: Automatically adds
/en/
to URLs if not present
Previous Versions
- 0.0.6: Fixed page URL generation for correct query parameter handling
- 0.0.5: Pagination optimization for reduced API calls
- 0.0.4: URL validation implementation
📄 License
This project is open source and available under the LICENSE.
🆘 Support
For issues and questions:
- Check the Apify Documentation
- Open an issue in this repository
- Check the Actor's run logs for detailed error information
Note: This actor is for educational and research purposes. Please respect Idealista's terms of service and use responsibly.