Fotocasa Scraper: how to get Spain Homes for Sale and Rent as JSON/CSV (API, Python, no code)
Scrape Fotocasa property listings for sale or to rent across Spain: price, price drop, rooms, bathrooms, surface, floor, features, neighbourhood and city, coordinates, photos, agency and publication date. This guide shows the output fields, a working input, and
Python, JavaScript and cURL code for the Actor v0iddo/fotocasa-scraper on Apify.
Open Fotocasa Scraper on Apify
What data you get
One row per result. Every row can be downloaded as JSON, CSV, Excel or HTML, or read through the API.
| Field | Label | Type | Example |
|---|---|---|---|
propertyId | Property ID | text | 183937099 |
address | Address | text | Barri Gòtic, Ciutat Vella, Barcelona |
price | Price (EUR) | number | 1700 |
rentPeriod | Rent period | text | monthly |
propertyType | Type | text | Flat |
rooms | Rooms | number | 1 |
bathrooms | Bathrooms | number | 1 |
surfaceM2 | Surface (m2) | number | 44 |
sellerType | Seller | text | |
agency | Agency | text | Uniplaces |
publishedAt | Published | date | 2024-07-26T03:27:33Z |
url | Listing | URL | https://www.fotocasa.es/es/alquiler/vivienda/barcelona-capital/aire... |
adId | text | ddfbe7f2-240e-4a4e-9cf2-e09bae224c98 | |
channel | text | rent | |
priceText | text | 1.700 € | |
currency | text | EUR | |
propertySubType | text | Apartment | |
features | list | ["air_conditioner", "furnished", "oven"] | |
neighborhood | text | Barri Gòtic | |
district | text | Ciutat Vella | |
city | text | Barcelona | |
province | text | Barcelona | |
zipCode | text | 08002 | |
latitude | number | 41.383465 | |
longitude | number | 2.177664 | |
isNewConstruction | true/false | false | |
isAuction | true/false | false | |
isOccupied | true/false | false | |
agencyUrl | text | https://www.fotocasa.es/es/pro/uniplaces-2/ | |
images | list | ["https://static.fotocasa.es/images/ads/21fd70d8-6fde-4b36-b8f0-b0c... | |
description | text | TIPO DE ALOJAMIENTO - alojamiento entero TÉRMINOS Y CONDICIONES DE ... |
Input example
This is the input that is pre-filled on the Actor page. Change the values for your own run.
{
"searchUrls": [
"https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
],
"channel": "buy",
"maxItems": 20
}
| Input field | Type | What it does |
|---|---|---|
locations | array | Fotocasa place slugs such as madrid-capital, barcelona-capital or valencia-capital. |
channel | string | Properties for sale or to rent. |
searchUrls | array | Search result pages copied from your browser, for example https://www.fotocasa.es/es/alquiler/viviendas/valencia-capital/todas-las-zonas/l . |
includeZones | boolean | Fotocasa's robots.txt leaves only the first page of each search open to automated clients, about 30 listings. |
maxItems | integer | The run stops after this many result rows. |
Output sample
Real rows from a run of the Actor. Fields that name people are left out of the sample.
[
{
"propertyId": 183937099,
"adId": "ddfbe7f2-240e-4a4e-9cf2-e09bae224c98",
"url": "https://www.fotocasa.es/es/alquiler/vivienda/barcelona-capital/aire-acondicionado-amueblado-internet/183937099/d",
"channel": "rent",
"price": 1700,
"priceText": "1.700 €",
"currency": "EUR",
"rentPeriod": "monthly",
"propertyType": "Flat",
"propertySubType": "Apartment",
"rooms": 1,
"bathrooms": 1,
"surfaceM2": 44,
"features": [
"air_conditioner",
"furnished",
"oven"
],
"address": "Barri Gòtic, Ciutat Vella, Barcelona",
"neighborhood": "Barri Gòtic",
"district": "Ciutat Vella",
"city": "Barcelona",
"province": "Barcelona",
"zipCode": "08002",
"latitude": 41.383465,
"longitude": 2.177664,
"isNewConstruction": false,
"isAuction": false,
"isOccupied": false,
"agency": "Uniplaces",
"agencyUrl": "https://www.fotocasa.es/es/pro/uniplaces-2/",
"images": [
"https://static.fotocasa.es/images/ads/21fd70d8-6fde-4b36-b8f0-b0cee7ddc528?rule=original",
"https://static.fotocasa.es/images/ads/3e6880b7-f377-4466-b62e-f41bebd81dc6?rule=original",
"https://static.fotocasa.es/images/ads/06634193-5e46-41ab-af0d-f143f16690c3?rule=original"
],
"publishedAt": "2024-07-26T03:27:33Z",
"description": "TIPO DE ALOJAMIENTO - alojamiento entero TÉRMINOS Y CONDICIONES DE ALOJAMIENTO: - Fecha de disponibilidad: 26/11/2026 - Duración mínima d..."
},
{
"propertyId": 187103153,
"adId": "c4204e3e-2ab2-48a6-81ee-2ea9cd1ad0b1",
"url": "https://www.fotocasa.es/es/alquiler/vivienda/barcelona-capital/calefaccion-parking-zona-comunitaria-ascensor-piscina/187103153/d",
"channel": "rent",
"price": 4950,
"priceText": "4.950 €",
"currency": "EUR",
"priceReduction": 550,
"rentPeriod": "monthly",
"propertyType": "Flat",
"propertySubType": "Flat",
"rooms": 4,
"bathrooms": 3,
"surfaceM2": 191,
"floor": 2,
"features": [
"heating",
"parking",
"community_zone"
],
"address": "del Doctor Francesc Darder, Pedralbes, Les Corts, Barcelona",
"street": "del Doctor Francesc Darder",
"neighborhood": "Pedralbes",
"district": "Les Corts",
"city": "Barcelona",
"province": "Barcelona",
"zipCode": "08034",
"latitude": 41.395383,
"longitude": 2.115281,
"isNewConstruction": false,
"isAuction": false,
"isOccupied": false,
"agency": "OLLÉ BERTRÁN",
"agencyUrl": "https://www.fotocasa.es/es/pro/olle-bertran/",
"images": [
"https://static.fotocasa.es/images/ads/45fb8909-abf5-485a-ad8b-a35e5b7ca641?rule=original",
"https://static.fotocasa.es/images/ads/d681e530-a084-4c5d-80f9-e95301489659?rule=original",
"https://static.fotocasa.es/images/ads/f51f8bb6-0c8c-4e91-8974-0dee474f519c?rule=original"
],
"publishedAt": "2025-07-18T14:42:59Z",
"description": "Piso en alquiler de 191 m² construidos y 177m² útiles en la calle Dr. Francesc Darder, en Pedralbes. Barcelona. Dispone de cuatro habitac..."
}
]
Code: Python, JavaScript and cURL
Get your API token in Apify Console under Settings, then Integrations. The Actor id is v0iddo/fotocasa-scraper.
Python (apify-client)
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run_input = {'searchUrls': ['https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l'],
'channel': 'buy',
'maxItems': 20}
run = client.actor("v0iddo/fotocasa-scraper").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)
JavaScript (apify-client)
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const input = {
"searchUrls": [
"https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
],
"channel": "buy",
"maxItems": 20
};
const run = await client.actor('v0iddo/fotocasa-scraper').call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
cURL
curl -X POST "https://api.apify.com/v2/acts/v0iddo~fotocasa-scraper/run-sync-get-dataset-items" \
-H "Authorization: Bearer YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchUrls": ["https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"], "channel": "buy", "maxItems": 20}'
Price
$1.50 per 1,000 results. You pay per result row. There is no separate charge per run. Higher Apify plans pay less per result, down to $1.05 per 1,000. See the pricing tab for your plan. A new Apify account gets $5 of platform credit every month.
Good to know
- Coverage: homes for sale and to rent on fotocasa.es. Fotocasa's robots.txt closes every results page after the first, so one search returns the first page, about 30 listings. A search of a whole...
- Large zones are not read to the end. To go deeper, search smaller zones: add place slugs with a zone such as madrid-capital/chamberi, or paste the address of a district or neighbourhood page.
- Telephone numbers and e-mail addresses are never collected, and any found inside an agency description are removed. Descriptions are clipped to about 300 characters.
- Listings from private sellers are reduced to area level (no street, no map point, no description) so no private person can be identified. They carry sellerType private and no agency, name or...
FAQ
What data does the Fotocasa Scraper return?
Each result is one row in an Apify dataset. Fields include propertyId, address, price, rentPeriod, propertyType, rooms, bathrooms, surfaceM2, and more. The table above shows every field with an example value.
How do I use the Fotocasa Scraper from Python?
Install the apify-client package, create a client with your Apify API token, call the Actor v0iddo/fotocasa-scraper with an input like the one above, and read the rows from the run's dataset. The Python snippet above does exactly that.
Can I use it without writing code?
Yes. Open the Actor page on Apify, fill in the input form (an example is already filled in), press Start, and download the results as JSON, CSV, Excel or HTML. You can also schedule runs there.
How much does it cost?
$1.50 per 1,000 results. You pay per result row. There is no separate charge per run. Higher Apify plans pay less per result, down to $1.05 per 1,000. A new Apify account gets $5 of platform credit every month.
How do I limit the number of results?
Set the maxItems input field to the number of results you need; the run stops there, so it also caps the cost of one run. You can also set a maximum cost for a run in the run options on Apify, and the run stops when it is reached.
Can I send the results to Google Sheets, Make, Zapier or n8n?
Yes. Apify datasets connect to Google Sheets, Slack, Make, Zapier and n8n, and a webhook can call your own service when a run finishes. You can also export the dataset as JSON, CSV or Excel.
Open Fotocasa Scraper on Apify
Related guides
- Rightmove Scraper: Scrape Rightmove property listings for sale or to rent across the UK: price, address, bedrooms, bathrooms,...
- Zillow Search Scraper: Scrape Zillow search results for homes for sale, rentals and recently sold properties: price, address, beds...
- Pracuj.pl Scraper: Scrape Polish job postings from pracuj.pl: title, company, workplaces and address, salary per contract type...