# Fotocasa Listings Scraper (`nice_dev/fotocasa-listings-scraper`) Actor

Scrape Fotocasa.es property listings in Spain for sale and rent by location, filters or search URL: price, size, rooms, GPS, photos, agency and phone, price drops. Export to JSON, CSV or Excel.

- **URL**: https://apify.com/nice_dev/fotocasa-listings-scraper.md
- **Developed by:** [Nice Dev](https://apify.com/nice_dev) (community)
- **Categories:** Real estate, Lead generation, MCP servers
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.17 / 1,000 listings

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### 🏠 What is Fotocasa Listings Scraper?

**Fotocasa Listings Scraper** extracts **property listings from [Fotocasa.es](https://www.fotocasa.es)**, in all of Spain: homes, garages, land, offices, commercial premises, storage rooms and whole buildings, for sale or rent, and new-build projects, with **price, price drop, surface, rooms, address, GPS position, phone number, photos and seller**. It works as a **Fotocasa API alternative**: run it on a schedule, call it from your code, or plug it into Make, Zapier or n8n. Agencies, investors and market analysts use it to follow prices and stock in the Spanish housing market.

**Every listing, not the first 10,000.** Fotocasa shows at most 10,000 listings per search. When your cap and filters need more, the Actor cuts your search into smaller ones by itself and reads on, at no extra charge (its few limits are under **Searches above 10,000 listings**).

Type a **place** (`Madrid`, `Barrio de Salamanca`, `Calle Goya, Madrid`, `28013`), set a **radius** around a point, or paste any Fotocasa link: a search, a listing, a new-build project or an agency page, in any of the site's 5 languages. Click **Start** and download the listings in JSON, CSV or Excel. No login, nothing to set up, no proxy to pay for.

### 📋 What data can you extract from Fotocasa?

One item per listing, 147 fields:

| Category | What you get |
| --- | --- |
| 🏠 **Property** | operation, property type and subtype, surface, rooms, bathrooms, floor, orientation, condition, building age — `Flat for sale in Calle de Tarragona, Madrid` |
| 💰 **Price** | price in euros, price per m², price drop in € and %, price before the drop, rent period — `220000 EUR` |
| 📍 **Location** | street and number when the seller shows them, ZIP code, neighbourhood, district, city, province, region, GPS coordinates, distance from the centre of a radius search |
| 📸 **Text and media** | full description, features, Fotocasa's labels, every photo and the room it shows, floor plans, videos, 3D tours |
| 🕒 **Dates** | first publication, last change, days on Fotocasa |
| 🏢 **Seller** | agency or private seller, name, company name, phone number, logo, agency page, bank or not, quality seal |
| 🏗️ **New-build projects** | one row per project: name, number of listings, ranges of price, rooms and size, typologies, finished or not |
| ⚡ **Listing details** (option) | energy rating and emissions, heating, plot size, contact email on new-build units, agency website and registrations, housing subsidies, counter-offers |
| 📇 **Agency leads** (option) | one row per agency: email, phone, website, address, opening hours, languages, services, team, stock of listings by type |
| 🔔 **Monitoring** | new listing, price drop or rise, listing gone since your last run, with the old price, the change and the prices your runs saw |

Every field, with an example, is listed in the **Output** section below.

The `recordType` column says what a row is:

- `listing`: one Fotocasa listing.
- `promotion`: one new-build project, from **Property type** set to **New developments** or a pasted project link. Each of its units can also be a `listing`.
- `agency`: one professional agency, with **Agency leads** ticked. Never a private seller.
- `removed`: a listing no longer in the results of your search, with **Track changes** ticked.

**Listing details** and **Agency leads** are **unticked by default**: each adds requests and is charged on its own, only when you tick it (see Pricing). Without them, every listing already has its price, price drop, surface, rooms, address, GPS position, description, all photos, phone number and seller.

### ✅ Why use Fotocasa Listings Scraper?

- 🧩 **No limit at 10,000**: large searches are cut automatically by province, city, district and neighbourhood, then by price range, and it costs nothing more. A test run on Apify on the city of Madrid in November 2026 returned all 12,574 listings Fotocasa announced, without duplicates, in about 7 minutes.
- 📍 **Type the place, not a URL**: city, district, neighbourhood, street, ZIP code or point of interest, or a real radius around a point.
- 🔗 **Or paste what you have**: a search, a listing, a new-build project or an agency page, in Spanish, Catalan, English, German or French. The filters in the link are kept.
- 🎯 **Fotocasa's own filters**: price, rooms, bathrooms, surface, subtype, condition, features, labels, occupancy, rental duration, price drops, video, subsidies, bank flats, new build, quality seal. A listing that does not match is never read, never charged.
- 📉 **Price tracking between runs**: new listings, price drops and rises, price history and listings gone from your search. Fotocasa keeps no history, so this one starts at your first run.
- 📇 **Agency leads**: one row per agency with its email, phone, website, address and stock, read from its Fotocasa profile.
- 🧾 **Pay only for what you tick**: details and agency leads are separate options. The proxy is included.
- 🔌 API, scheduling, monitoring, integrations (Make, Zapier, n8n, Google Sheets…), proxy rotation and JSON/CSV/Excel export via the Apify platform.

### 🚀 How to scrape Fotocasa

1. Create a free Apify account.
2. Open **Fotocasa Listings Scraper**, choose the **Operation** and the **Property type**, type a **Location** (e.g. `Madrid`) and, if you want, a **Search keyword** and some **Fotocasa filters**.
3. Or paste your own links into **Fotocasa URLs**: a search page (the filters in the link are kept, pagination is automatic), a listing, a new-build project or an agency page.
4. Set **Max listings** (100 by default, 0 = no limit) — and **Max listings per search** when you run several searches — then click **Start**.
5. Download the dataset in JSON, CSV, Excel or via API.

### 💰 How much does it cost to scrape Fotocasa?

This Actor uses **pay per event** pricing: you pay for each row saved, plus a small fee per run start. The current price of each event is shown in the **Pricing** tab of this page; higher Apify plans pay less per row. Platform usage (compute, proxy) is included in the price.

What can be charged, and when:

- **Listing**: each `listing` or `promotion` row saved in the dataset.
- **Listing details** (`includeDetails`): per listing or project saved with its details, on top of the row.
- **Agency lead** (`includeAgencyLeads`): per `agency` row read from the agency's Fotocasa profile, once per agency and per run.
- **Filter fee**: the filters Fotocasa does not offer are applied by the Actor on every listing it reads (`postedAfter`, `postedBefore`, `excludeKeywords`, `requirePhone`, `withPhotosOnly`, `privateSellersOnly`, `sellerType`, `zipCodes`). A listing you keep costs its normal price; a listing a filter drops is not saved and costs only a filter fee instead.

Free: cutting a large search, **Track changes** itself, `removed` rows, and the row of an agency that has no Fotocasa profile. Cap any run with **Max listings** and, through the API, with the run option `maxTotalChargeUsd`.

### ⚙️ Input

A place, with Fotocasa's filters:

```json
{
    "location": "Madrid",
    "operation": "rent",
    "maxPrice": 1500,
    "minRooms": 2,
    "features": ["elevator", "terrace"],
    "maxItems": 200
}
```

Several searches, a cap per search, only recent listings, only the ones not delivered before:

```json
{
    "searchQueries": ["piscina", "ático"],
    "locations": ["Sevilla", "Málaga"],
    "maxItemsPerQuery": 50,
    "postedAfter": "7 days",
    "onlyNew": true,
    "stateKey": "south-homes"
}
```

A real radius around a point, with the listing details:

```json
{
    "latitude": 40.4168,
    "longitude": -3.7038,
    "distanceKm": 2,
    "includeDetails": true,
    "maxItems": 500
}
```

Or with your own links:

```json
{
    "startUrls": [
        { "url": "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l?maxPrice=300000" },
        { "url": "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/calefaccion/191265249/d" },
        { "url": "https://www.fotocasa.es/es/pro/la-casa-agency-atocha/" }
    ],
    "maxItems": 500
}
```

A daily follow-up of one search, whole, with price changes and removed listings:

```json
{
    "location": "Girona",
    "maxItems": 0,
    "trackChanges": true,
    "stateKey": "girona-homes"
}
```

| Field | Notes |
| --- | --- |
| `location`, `locations` | City, province, district, neighbourhood, street, ZIP code or point of interest, as typed in Fotocasa's search box (`Madrid`, `Barrio de Salamanca`, `Calle Goya, Madrid`, `28013`), or Fotocasa location IDs (`724,14,28,173,0,28079,0,0,0`). The place used is Fotocasa's suggestion of the same name (each part of a double name counts: `San Sebastian` = Donostia - San Sebastián), else the place these words name in a Fotocasa URL, else the first suggestion whose name starts with the text (`Palma` = Palma de Mallorca, never La Palma), one with listings for sale first, a street or a zone only after all of these; none = the run says the place is not found. The place chosen is written in the log. Empty, `España` or `Spain` = the whole of Spain. `locations` adds more places: every keyword is searched in every location (max 500 searches per run). A ZIP code is read as a circle of 3 km around it, then kept by its ZIP code; a street or a zone is read as a circle of 0.5 km around it, not by its name. |
| `query`, `searchQueries` | Free text searched by Fotocasa in the listings (`piscina`, `piscina comunitaria`), case ignored. `searchQueries` adds more keywords, one search each. |
| `latitude`, `longitude`, `distanceKm` | A real radius search, in km around the point: Fotocasa keeps only the listings inside the circle, and each row gets its `distanceKm` from the point. Listings hidden from the map are not found this way. |
| `operation` | `buy` (default), `rent`, `transfer` (business transfer), `share` (room to share), `rent-to-own`. For the search fields, not for pasted links. |
| `propertyType` | `homes` (default), `garages`, `land`, `commercial`, `offices`, `storage`, `buildings`, `newDevelopments` (one promotion row per new-build project; some filters are refused with it, see Known limitations). For the search fields, not for pasted links. |
| `startUrls` | Fotocasa links, mixed, in any of the site's 5 languages: a search page (`https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l`, its filters kept, pagination automatic), a listing (`https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/calefaccion/191265249/d`), a new-build project, or an agency page (`https://www.fotocasa.es/es/pro/la-casa-agency-atocha/`, all its listings). Read as well as the search fields. Max 1,000. |
| `maxItems` | Stop after this many rows for the whole run, after deduplication and filters (`0` = no limit). Agency rows and removed rows do not count. |
| `maxItemsPerQuery` | Cap for EACH search (keyword × location, or search URL). `0` = no per-search cap. |
| `splitLargeSearches` | On by default, free: a large search is cut when what Fotocasa shows of it would not fill **Max listings** once your filters are applied. Off = the first 9,800 of each search only. |
| `minPrice`, `maxPrice`, `minRooms`, `maxRooms`, `minBathrooms`, `maxBathrooms`, `minSurface`, `maxSurface` | Fotocasa's own bounds, in euros, rooms, bathrooms and m². Empty or 0 = no bound. |
| `propertySubtypes` | Only these kinds of property: `flat`, `apartment`, `house`, `penthouse`, `duplex`, `studio`… The land and industrial values go with the land and buildings property types. |
| `conditions` | `new`, `almostNew`, `veryGood`, `good`, `renovated`, `toRenovate`. |
| `features` | Only listings with ALL of these: `elevator`, `terrace`, `communalPool`, `privateGarage`, `airConditioning`, `petsAllowed`… The whole list is in the form. |
| `tags` | Fotocasa's labels: `IS_LUXURY`, `IS_SELLING_URGENT`, `HAS_VIEW_TO_BEACH`, `VPO`… The whole list is in the form. |
| `occupancy` | Sale listings only: `AVAILABLE`, `IS_RENTED`, `OCCUPIED`, `IS_AUCTIONED`, `BARE_OWNERSHIP`. |
| `rentalDuration` | Rent listings only: `LONG_TERM`, `TEMPORARY`. |
| `publicationDate` | Fotocasa's own date filter: `ANY` (default), `ONE_DAY`, `TWO_DAYS`, `ONE_WEEK`, `ONE_MONTH`. |
| `priceDropOnly`, `withVideoOnly`, `subsidizedOnly`, `bankFlatsOnly`, `newConstructionOnly`, `qualitySealOnly` | Only the listings with a price drop, a video, housing subsidies, sold by a bank, new-build, or from an agency with Fotocasa's quality seal. |
| `agencyIds` | Only the listings of these agencies: the publisher ID (`35f092c1-422d-40ae-82d9-ed3076014024`) or the client ID (`9202770222405`) of an earlier run. Each agency multiplies the searches (keyword × location × agency), in the whole of Spain unless a location is set. |
| `sortBy` | `newest` (default), `oldest`, `relevance`, `priceAsc`, `priceDesc`, `surfaceAsc`, `surfaceDesc`, `roomsAsc`, `roomsDesc`. New-build projects keep Fotocasa's own order, see Known limitations. |
| `includeDetails` | **Listing details**: 1 extra request per listing for the energy certificate, heating, plot size, contact email on new-build units, agency website and registrations, subsidies. Charged per listing. Off = these columns are null. |
| `includeAgencyLeads`, `maxAgencyLeads` | **Agency leads**: one agency row per professional agency met, once per run. `maxAgencyLeads` caps the profiles read, 0 = no limit. |
| `postedAfter`, `postedBefore` | Publication date range: `2026-09-01`, or a period before now (`7 days`, `2 weeks`, `1 month`, `24 hours`). |
| `excludeKeywords` | Drop the listings whose title or description contains one of these WHOLE words (case and accents ignored): `art` drops "Art deco", not "Smart home". Several words in one entry (`hand made`) must appear together. Chinese, Japanese, Korean, Thai, Lao, Khmer and Burmese words are found anywhere in the title or description (no spaces there). |
| `requirePhone`, `withPhotosOnly` | Drop the listings without a phone number, or without a photo. |
| `sellerType`, `privateSellersOnly` | `all` (default), `private` or `professional`. `privateSellersOnly` is the same as `private`. Fotocasa has no such filter: listings are read, then sorted out, until **Max listings** is filled. |
| `zipCodes` | Keep only these 5-digit ZIP codes (`28013`). Fotocasa has no such filter: set the matching `location` too, or the whole of Spain is read. |
| `onlyNew`, `trackChanges`, `onlyChanges`, `stateKey`, `resetState` | Monitoring, see Tips: `onlyNew` skips what was delivered before; `trackChanges` says what moved since the last run; `onlyChanges` keeps only what moved. `onlyNew` cannot be used with the other two. `stateKey` names the memory (`madrid-rentals`); `resetState` forgets it. |
| Advanced | `proxyConfiguration` (Apify proxy by default, included in the price; the residential proxy is not available), `maxConcurrency`, `maxRequestsPerMinute`, `minRequestIntervalMs`, `maxRequestRetries`, `debugLog`. |

### 📦 Output

One real row, shortened: its empty columns and some others are left out, the text is cut and the phone number replaced.

```json
{
    "recordType": "listing",
    "id": "1_191265249",
    "url": "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/calefaccion/191265249/d",
    "title": "Flat for sale in Calle de Tarragona, Madrid",
    "propertyId": "191265249",
    "operation": "buy",
    "propertyType": "homes",
    "propertySubtype": "Flat",
    "isNewConstruction": false,
    "price": 220000,
    "currency": "EUR",
    "pricePerSqm": 5500,
    "priceDrop": null,
    "surface": 40,
    "rooms": 1,
    "bathrooms": 1,
    "floor": "2nd",
    "floorNumber": 2,
    "condition": "Good",
    "buildingAge": "> 100",
    "description": "LA CASA AGENCY VENDE: PISO LUMINOSO JUNTO A LA PLAZA DE LUCA DE TENA…",
    "features": ["Central heating"],
    "tags": ["IS_EXTERIOR"],
    "street": "Calle de Tarragona",
    "addressVisibility": "street",
    "zipCode": "28045",
    "address": "Calle de Tarragona, 28045 Madrid",
    "neighborhood": "Palos de Moguer",
    "district": "Arganzuela",
    "city": "Madrid",
    "province": "Madrid",
    "region": "Madrid",
    "country": "España",
    "latitude": 40.40141894303192,
    "longitude": -3.6947726804946424,
    "images": ["https://static.fotocasa.es/images/ads/40df3930-b01b-4077-97de-5c9c442b7dda?rule=original"],
    "imageCount": 30,
    "virtualTourUrls": ["https://my.matterport.com/show/?m=krnjt5guTq9"],
    "hasVideo": false,
    "hasVirtualTour": true,
    "publishedAt": "2026-10-31T12:57:01.790Z",
    "updatedAt": "2026-10-31T12:57:01.913Z",
    "daysOnPortal": 0,
    "agencyReference": "LCM45566",
    "sellerType": "professional",
    "sellerName": "La Casa Agency Atocha",
    "sellerUrl": "https://www.fotocasa.es/es/pro/la-casa-agency-atocha/",
    "phone": "+34910000000",
    "searchQuery": "Madrid, Madrid",
    "searchUrl": "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l?sortOrderDesc=true&sortType=publicationDate",
    "scrapedAt": "2026-10-31T23:03:41.849Z"
}
```

An `agency` row, shortened, the names and contacts replaced:

```json
{
    "recordType": "agency",
    "agencyWebsite": "https://www.example.org/",
    "agencyName": "Example Homes",
    "agencyUrl": "https://www.fotocasa.es/es/pro/example-homes/",
    "agencyPhone": "+34910000000",
    "agencyEmail": "agency@example.org",
    "agencyAddress": "Calle de Ejemplo, 10",
    "agencyZipCode": "28001",
    "activeListingCount": 520,
    "listingsByType": { "buy": { "homes": 433, "garages": 12, "land": 5, "commercial": 66, "storage": 4 } },
    "promotionsCount": 0
}
```

You can download the dataset in various formats such as JSON, HTML, CSV or Excel.

#### All 147 fields

Every row has all the columns: a column that does not apply to the row is `null`.

| Fields | What you get |
| --- | --- |
| `recordType` | `listing`, `promotion`, `agency` or `removed` |
| `id`, `url`, `title`, `realEstateAdId`, `propertyId` | `1_191265249`, the public page, a title built from the subtype, the operation and the street or city (Fotocasa listings have none), Fotocasa's IDs |
| `operation`, `propertyType`, `propertySubtype`, `isNewConstruction` | `buy`, `homes`, `Flat`, new-build unit or used market |
| `price`, `currency`, `pricePerSqm`, `pricePeriod` | `220000`, `EUR`, `5500`, `month` for rents and shares |
| `priceDrop`, `previousListedPrice`, `priceDropPercent` | **The drop Fotocasa shows**: amount, price before it, share of the former price |
| `surface`, `rooms`, `bathrooms`, `orientation`, `condition`, `buildingAge`, `hotWater` | `40`, `1`, `1`, `South`, `Good`, `> 100`, `Natural gas` |
| `floor`, `floorCode`, `floorNumber`, `floorType` | `2nd`, Fotocasa's code, `2`, `INTERMEDIATE_FLOOR` |
| `description`, `features`, `featureIds`, `tags` | full text, features in English, their IDs, Fotocasa's labels (`IS_LUXURY`, `IS_AUCTIONED`…) |
| `rentalDuration`, `occupancyStatus` | `LONG_TERM` or `TEMPORARY` on rented homes, null where Fotocasa shows no term (premises, shared flats); from the search alone, about 3 rents in 100 show `LONG_TERM` where their page says temporary: **Listing details** or the **Rental duration** filter gives the exact term; `occupied`, `rented`, `auctioned` or `bare_ownership` when Fotocasa says so |
| `street`, `streetType`, `streetNumber`, `addressVisibility`, `address` | **Address**, as far as the seller shows it: `exact`, `street` or `area` |
| `zipCode`, `zone`, `neighborhood`, `district`, `locality`, `city`, `county`, `province`, `region`, `country` | `28045`, `Palos de Moguer`, `Arganzuela`, `Madrid`… |
| `locationIds`, `latitude`, `longitude`, `distanceKm` | Fotocasa's location IDs (usable as `location`), GPS position, distance from the point of a radius search |
| `images`, `imageCount`, `imageRooms`, `imageUrl` | every photo, how many, the room on each (`bedroom`, `kitchen`…), the first one |
| `floorPlanUrls`, `videoUrls`, `virtualTourUrls`, `energyCertificateUrl`, `qualityMemoryUrl`, `hasVideo`, `hasVirtualTour` | **Files**: floor plans, videos, 3D tours, documents uploaded by the seller |
| `publishedAt`, `updatedAt`, `bumpedAt`, `daysOnPortal` | first publication (what the date filters read), last change, last paid raise of the listing, days since publication |
| `agencyReference`, `sellerType`, `sellerName`, `sellerLegalName`, `sellerId`, `sellerPublisherId`, `sellerUrl`, `sellerLogo` | **Seller**: its own reference, `professional` or `private`, names (no company name for a private seller), IDs (usable in `agencyIds`), agency page, logo |
| `isBank`, `phone`, `isTop`, `qualitySeal`, `externalContactUrl` | sold by a bank, contact phone of the listing, paid top placement, quality seal, link where Fotocasa sends the contact |
| `promotionId`, `promotionName`, `promotionUrl` | the new-build project of the listing |
| `hasSubsidies` | the listing qualifies for housing subsidies |
| `energyRating`, `energyConsumption`, `emissionsRating`, `emissionsValue`, `energyCertificateStatus`, `heating` | **Listing details**: classes A to G, kWh/m² and kg CO₂/m² a year as Fotocasa shows them (999 = no figure declared), `certified`, `in_progress` or `exempt`, heating energy. The energy columns stay empty on garages, land, storage rooms and industrial premises: Fotocasa shows no certificate there |
| `plotSurface`, `qualityRate`, `contactEmail`, `agencyWebsite`, `agencyRegistrations`, `subsidies`, `counterOfferAllowed`, `promotionUnits`, `rentReferenceIndex`, `touristOfficeCode` | **Listing details**: plot size, Fotocasa's quality rate, email given on the listing (units of a new-build project only), agency website (also on agency rows), official registrations, housing aid, counter-offers, typologies of the project, official rent reference and tourist office code (both very rare) |
| `agencyName`, `publisherId`, `clientId`, `agencyUrl`, `agencyPhone`, `agencyEmail`, `logo` | **Agency rows**: name, Fotocasa IDs, page, phone, email of the profile, logo |
| `agencyAddress`, `agencyZipCode`, `agencyTown`, `agencyProvince`, `agencyLatitude`, `agencyLongitude` | **Agency rows**: office address and position |
| `agencySince`, `agentsCount`, `agentNames`, `franchiseesCount`, `businessHours`, `languages`, `services`, `officialRegistrations` | **Agency rows**: creation date of the profile, team, franchisees, opening hours, languages, services, registrations |
| `activeListingCount`, `listingsByType`, `promotionsCount` | **Agency rows**: the agency's whole stock on Fotocasa today, not only this run, by operation and property type; its new-build projects |
| `name`, `adsCount`, `minPrice`, `maxPrice`, `minRooms`, `maxRooms`, `minBathrooms`, `maxBathrooms`, `minSurface`, `maxSurface` | **Promotion rows**: project name, number of listings, ranges of price, rooms, bathrooms and size |
| `isFinished`, `units`, `keyDeliveryDate` | **Promotion rows**: construction finished, typologies with price and surface, handover date (with **Listing details**) |
| `changeType`, `previousPrice`, `priceChange`, `priceHistory`, `firstSeenAt`, `lastSeenAt` | **Track changes**: `new`, `price_drop`, `price_rise`, `unchanged` or `removed`, price of the last run, difference, prices your runs saw, first run that saw it, last run that saw a listing now gone |
| `searchQuery`, `searchUrl`, `scrapedAt` | the search that found the row, its Fotocasa page, ISO timestamp |

### 💡 Tips

#### How to get more results

Set **Max listings** to `0`. A search above 10,000 listings is then cut for you (see below). To follow the market, keep **Sort by** on **Newest first**, tick **Only new listings** or **Track changes**, and schedule the Actor.

#### How to reduce costs

The price is per row, so the levers are `maxItems`, `maxItemsPerQuery`, Fotocasa's own filters (a listing that does not match is never read, never charged), and `onlyNew` or `onlyChanges` for recurring runs (you never pay twice for the same listing). Tick an option only when you need its fields.

#### What each option adds

| Option | Requests in addition | Charged |
| --- | --- | --- |
| **Listing details** | 1 per listing | per listing or project saved with its details |
| **Agency leads** | 1 per agency met, once per run | per agency with a profile; an agency with none gets a free row |
| **Split large searches** | a few for each cut | free |
| **Track changes** | none | free; the rows cost what they cost without it, `removed` rows are free |

#### Searches above 10,000 listings

With **Split large searches** on (the default), a large search is cut when your filters would not leave enough rows to fill **Max listings** from what Fotocasa shows of it. That means **Max listings** at `0` or above 9,800, or a smaller cap with a filter Fotocasa does not have: **Seller type** on `Private` counts about 18 listings for each row, **ZIP codes**, **Only changed listings** and **Posted before** (unless sorted oldest first) count the whole search. If a search left whole still does not fill the cap, the end of the run says so. A search is cut by province, city, district and neighbourhood, then by price range where no smaller place is left. Each listing is returned once and its `searchUrl` stays the one of your search. The log says how the search was cut.

- A search read in pieces keeps **Sort by** inside each piece only: sort the dataset yourself if you need one order.
- A last-resort cut by price cannot reach the listings without a price: the log counts them (149 of 20,158 on a circle of 30 km around Madrid).
- A price range that still holds more than 9,800 listings is read up to 9,800: the log says how many stay out of reach.
- With **Only new listings**, a search is cut only on a first run with no cap and an empty memory. Later runs read the search itself, newest first: the new listings are at the top, and the log says how many older ones stay out of reach.

#### Several searches in one run

Fill `searchQueries` and / or `locations`: the Actor runs one search per keyword × location × agency of `agencyIds` (3 keywords × 4 cities = 12 searches, × 2 agencies = 24, up to 500 per run). The single `query` and `location` fields still work and are added to the lists. A listing found by several searches is saved — and charged — once. Set `maxItemsPerQuery` to give every search its own cap: without it the first searches can use up the whole `maxItems` budget. You can also paste several search URLs into `startUrls`: each one is a search of its own, with the same cap.

#### Monitoring: only the new listings

Tick **Only new listings** (`onlyNew`) and schedule the Actor. The first run returns everything; each later run skips the listings already delivered: they are not saved and not charged. The memory lives in a named key-value store of your account (`fotocasa-listings-scraper-seen`, up to 150,000 listings per key) and is only updated with listings that really reached the dataset, so a failed run never hides anything. Give each schedule its own `stateKey` (two schedules sharing a key would hide each other's listings), and tick `resetState` once to start over. With **Sort by** on **Newest first** (the default), a search stops early once it meets 1,000 listings in a row you already have, sooner under a cap. New-build projects are the exception: Fotocasa sorts them by its own score, so a project search is read to its end, the projects already delivered skipped and not charged.

#### Track changes: price changes and removed listings

Fotocasa keeps no price history: it starts at your first run. Tick **Track changes** (`trackChanges`) and schedule the same search under the same `stateKey`. Every row then says what moved since the run before:

- `changeType`: `new`, `price_drop`, `price_rise` or `unchanged`;
- `previousPrice` and `priceChange`: the price of the last run and the difference;
- `priceHistory`: the prices your runs saw, oldest first, last 20 changes;
- `firstSeenAt`: the first run that saw the listing.

Tick **Only changed listings** (`onlyChanges`) as well to save only the new listings and the price changes: an unchanged listing is not saved and not charged.

A listing no longer in the results of your search comes back once as a free `removed` row, with `id`, `url`, `previousPrice` and `lastSeenAt`. **`removed` means no longer in the results of your search**: it can be sold or withdrawn, and it can also have left your filters (a price now above your **Max price**, for example).

A `removed` row is only said when every search was read to the end. A run stopped by **Max listings** or **Max listings per search**, a run with a date filter, a run with a failed request, a stopped or resumed run says none, and its log gives the reason: keep **Max listings** at `0` or above the size of your search. If more than half of the listings remembered for your searches are missing, the run also says none: a failure of the site is more likely than an empty market. Keep the same `stateKey` for the same search: another search under the same key is followed apart, and never reports the first one's listings as removed.

This memory lives in the same store and holds up to 139,810 listings per key with the default run memory (512 MB), 559,240 with 2 GB. Past that, the oldest listing is forgotten and the log says so.

#### Agency leads

Tick **Agency leads** (`includeAgencyLeads`): the run adds one `agency` row per professional agency it meets, once per run, read from the agency's Fotocasa profile. `activeListingCount` and `listingsByType` give its whole stock on Fotocasa today, not only what this run saw. **Max agency leads** caps the profiles read: the first agencies met. Agency rows do not count in **Max listings**, and a private seller never gets one. An agency with no Fotocasa profile gets a free row taken from its listing. Agencies fill their profile as they wish: a column they left empty is `null`, and opening hours and languages were filled on only 1 or 2 agencies in 10 in our tests.

For all the listings of one agency, paste its page into **Fotocasa URLs** or give its ID in `agencyIds`.

#### Filter by publication date

`postedAfter` and `postedBefore` take a date (`2026-09-01`, the whole day is included, Spanish time) or a period before now (`7 days`, `2 weeks`, `1 month`; via the API also `24 hours` or a full ISO date-time). The filter reads `publishedAt`; a listing without a publication date is dropped as soon as a date bound is set. Filtered-out listings are not saved and do not count in `maxItems` (each listing dropped costs the filter fee, see Pricing); the run summary tells how many were filtered. With **Sort by** on **Newest first**, searches stop at the first page that is entirely too old. **Published within** is Fotocasa's own filter on the last 24 hours, 48 hours, week or month.

### 🔌 Integrations and API

Call the Actor via the Apify API, the JavaScript or Python clients, or connect it with integrations and webhooks (Make, Zapier, n8n, Google Sheets, Slack, Airtable…). The dataset can be fetched as JSON or CSV from any tool.

### 🤖 Use with AI agents (MCP)

AI agents (Claude, ChatGPT, Cursor…) can find and run this Actor through the [Apify MCP server](https://mcp.apify.com), billed to their Apify account like any run. It returns one item per Fotocasa listing. Actor id: `nice_dev/fotocasa-listings-scraper`; MCP server with this Actor only: `https://mcp.apify.com/?tools=fetch-actor-details,nice_dev/fotocasa-listings-scraper`.

Smallest input, for a cheap first call:

```json
{
    "location": "Madrid",
    "maxItems": 10
}
```

Key output fields: `url`, `title`, `price`, `priceDrop`, `surface`, `rooms`, `city`, `publishedAt`, `phone` and `sellerName`.

Cost: per row saved plus a small fee per run start, the options on top; the current prices are in the Pricing tab, see the pricing section above. Cap each call with `maxItems` and, through the API, with the run option `maxTotalChargeUsd`.

### ❓ FAQ

#### Is it legal to scrape Fotocasa?

The Actor only reads what Fotocasa shows publicly to any anonymous visitor. It logs in to nothing. Results can contain personal data: a private seller's first name and phone number, which Fotocasa publishes on the listing, or an email address a private seller typed as a name. Personal data is protected by GDPR: do not store it or contact these people without a legitimate reason. To leave private sellers out, set **Seller type** to **Professional**. You are responsible for using the data in compliance with Fotocasa's Terms of Use and applicable law; when in doubt, ask a lawyer. This Actor is not affiliated with Fotocasa.

#### Does it need a login or a proxy?

No login. The proxy is included in the price: leave the default setting (the residential proxy is not available). A request the site turns away is retried at once on a new proxy session, up to 10 times on top of the retries (without a proxy, after a pause of 5 seconds, doubled at each retry up to 150 seconds).

#### Is the data safe to open in Excel or to show on a web page?

Descriptions and seller names are the sellers' own words, copied as they are. A text can begin with `-`, `+`, `=` or `@`, and most phone numbers begin with `+`: Excel and Google Sheets may read such a cell of a CSV file as a formula or as a number. The Actor leaves the text as it is, so that the JSON and the API give the real value: when you open a CSV, import these columns as text. On a web page, escape every field like any text written by a stranger.

#### Known limitations

- **Sort by** on **Newest first** does not sort new-build projects by date: Fotocasa sorts them by its own score, and a project search is read to its end. Project searches are not cut either: the whole of Spain lists fewer projects than one search can show.
- The fields of an option are empty when the option is off: `energyRating` or `contactEmail` without **Listing details**, for example.
- Fotocasa has no filter for ZIP codes or seller type: these read the listings one by one and drop the others until the cap is filled (about 1 listing in 18 is from a private seller).
- A link pasted past its first page starts there and is not cut. Paste the first page of a search.
- A filter written in a pasted link that the Actor does not read is named in the log, never dropped in silence.
- With **Listing details**, rows arrive in the order their details come back, not in the order of **Sort by**: in our tests up to 12 pairs of neighbouring rows in 49 were swapped, up to 18 hours apart, and none without details. Sort the dataset yourself if you need one order.
- On **New developments**, Fotocasa filters projects by price, rooms and surface only, besides the keyword, the place and the publisher ID. Bathrooms, subtypes, condition, features, labels, occupancy, rental duration, **Published within**, price drops, video, subsidies, bank flats, new build, quality seal and a numeric client ID do nothing there: they are refused at the start, or named in the log when they come from a pasted link.
- `contactEmail` is only on the units of a new-build project: 2 to 4% of the listings read with details. `rentReferenceIndex` and `touristOfficeCode` are very rare: 1 and 0 listings in 799 in our tests.
- `street` and `streetNumber` are `null` when the seller hides them: `addressVisibility` says how much is shown.
- `onlyNew` remembers listing ids, not their content: a listing whose price changed is not returned again. Use **Track changes** for that.
- Two runs sharing the same `stateKey` at the same time may both return the same new listing.

**A run that reaches its timeout** stops itself about 45 seconds before it: no new page is asked, what it read is saved and, with `onlyNew`, remembered, and the run ends *Succeeded* with "Stopped before the run's timeout". Resurrect it to go on from there, or give the next run a longer timeout (Run options).

**A run the platform stops without warning** (out of memory)

- Resurrect it: it goes on from where it stood at most a minute before the stop. What it had read since is read again, and the listings already saved are skipped: none is delivered or charged twice, and `maxItems` still counts them.
- With `onlyNew`, the memory is saved after each write (at most once every 2 seconds): resurrect the stopped run and the listings it had saved meanwhile join the memory; leave it stopped for good, and the next run may return the listings of its last 2 seconds once more.
- With **Track changes**, the memory is saved at most every 5 minutes: after such a stop, the next run may report those changes once more.

#### Something doesn't work?

The last line of the log counts the listings saved, filtered out and no longer on Fotocasa (removed while the run was reading them), and the requests that failed after every retry. Those requests and the removed listings are listed, with the reason, in the `FAILED_REQUESTS` record of the run's key-value store. A run that saved nothing and had failed requests fails, and its last message gives the cause (a search URL that does not exist says so, instead of "run it again").

If Fotocasa changes its pages, you are told instead of paying for blank rows. A results page that counts listings but gives none the Actor can read is an error (listed in `FAILED_REQUESTS`), never a quiet "No listings found". If the first 20 listings read all lack their title, link, publication date, price, surface, phone number, seller type, ZIP code, GPS position or photos, the run saves nothing more, stops and fails, and its last message names the missing field: at most those first listings are charged. The phone number is left out of this check when all those listings come from one seller: some sellers give none. A listing that `postedAfter` / `postedBefore` drops because it has no date at all counts among those 20. A run of fewer listings (a scheduled `onlyNew` run that finds a few new ones, a small **Max listings**) is checked at its end, from 5 listings: its listings are already saved, and the run fails with the missing field instead of ending green.

### 🛟 Support

Open an issue in the **Issues** tab with a link to your run: the run log and the `FAILED_REQUESTS` record of the key-value store show exactly which URLs failed and why.

# Actor input Schema

## `startUrls` (type: `array`):

Any of these, mixed and in any site language: a search page (`https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l`, the filters in the link are kept, pagination is automatic), a listing page (`https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/calefaccion/191265249/d`), a new-build project page or an agency page (`https://www.fotocasa.es/es/pro/la-casa-agency-atocha/`, all its listings). URLs are read as well as the search fields below. Max 1 000 URLs.

## `operation` (type: `string`):

What the listings offer. Applies to the search fields below, not to pasted URLs.

## `propertyType` (type: `string`):

**New developments** lists Fotocasa's new-build projects: one `promotion` row per project with its units, price and size ranges. Fotocasa filters projects by price, rooms, surface, keyword and publisher ID only: any other filter is refused with this type. Applies to the search fields below, not to pasted URLs.

## `location` (type: `string`):

City, province, district, neighborhood, street, ZIP code or point of interest, as typed in Fotocasa's search box (e.g. `Madrid`, `Sevilla`, `Barrio de Salamanca`, `Calle Goya, Madrid`, `28013`). The place used is Fotocasa's suggestion of the same name (each part of a double name counts: `San Sebastian` = Donostia - San Sebastián), else the place these words name in a Fotocasa URL, else the first suggestion whose name starts with the text (`Palma` = Palma de Mallorca, never La Palma), one with listings for sale first, a street or a zone only after all of these; none = the run says the place is not found. The place chosen is written in the log. Fotocasa location IDs (`724,14,28,173,0,28079,0,0,0`) work too. Empty, `España` or `Spain` = the whole of Spain.

## `locations` (type: `array`):

Several locations in one run: every keyword is searched in every location (3 keywords × 4 locations = 12 searches, max 500). Added to **Location**; a listing found by several searches is saved once.

## `query` (type: `string`):

Free text searched by Fotocasa in the listings (e.g. `piscina`, `piscina comunitaria`). Case is ignored.

## `searchQueries` (type: `array`):

Several keywords in one run: one search per keyword (times each location). Added to **Search keyword**.

## `latitude` (type: `number`):

Centre of a real radius search, with **Longitude** (e.g. `40.4168`). Fotocasa keeps only the listings inside the circle, and each row gets its `distanceKm` from this point. Listings hidden from the map are not found this way.

## `longitude` (type: `number`):

Centre of the radius search, with **Latitude** (e.g. `-3.7038`).

## `distanceKm` (type: `number`):

Size of the circle around **Latitude** and **Longitude**. Ignored without them.

## `maxItems` (type: `integer`):

Maximum number of rows to save for the whole run (after deduplication and filters). 0 = no limit. Agency rows and `removed` rows do not count.

## `maxItemsPerQuery` (type: `integer`):

Cap for EACH search (keyword × location, or search URL), so that the first search cannot use up the whole **Max listings** budget. 0 = no per-search cap.

## `splitLargeSearches` (type: `boolean`):

Fotocasa shows at most 10,000 listings per search. A larger search is cut by province, city, district and neighbourhood, then by price range, when what Fotocasa shows of it would not fill **Max listings** once your filters are applied (free, no extra charge). Off = the first 9,800 of each search only. A last-resort price split loses the listings without a price: the log says so.

## `minPrice` (type: `integer`):

Lowest price in euros. Empty or 0 = no minimum.

## `maxPrice` (type: `integer`):

Highest price in euros. Empty or 0 = no maximum.

## `minRooms` (type: `integer`):

Empty or 0 = any.

## `maxRooms` (type: `integer`):

Empty or 0 = any.

## `minBathrooms` (type: `integer`):

Empty or 0 = any.

## `maxBathrooms` (type: `integer`):

Empty or 0 = any.

## `minSurface` (type: `integer`):

Empty or 0 = any.

## `maxSurface` (type: `integer`):

Empty or 0 = any.

## `propertySubtypes` (type: `array`):

Only these kinds of property (one of them). The land and industrial values go with the **Land** and **Whole buildings** property types. Empty = all.

## `conditions` (type: `array`):

Only these states of repair. Empty = all.

## `features` (type: `array`):

Only listings with ALL of these. Empty = all.

## `tags` (type: `array`):

Only listings with these Fotocasa labels. Empty = all.

## `occupancy` (type: `array`):

Sale listings only: vacant, rented out, occupied, auction, bare ownership. Empty = all.

## `rentalDuration` (type: `array`):

Rent listings only. Empty = all.

## `publicationDate` (type: `string`):

Fotocasa's own date filter. For any other period use **Posted after** below.

## `priceDropOnly` (type: `boolean`):

Only listings whose price was lowered.

## `withVideoOnly` (type: `boolean`):

Only listings with a video.

## `subsidizedOnly` (type: `boolean`):

Only listings eligible for housing subsidies.

## `bankFlatsOnly` (type: `boolean`):

Only flats sold by banks.

## `newConstructionOnly` (type: `boolean`):

Only new-build listings (not the used market).

## `qualitySealOnly` (type: `boolean`):

Only listings from agencies with Fotocasa's quality seal.

## `agencyIds` (type: `array`):

Only the listings of these agencies: `sellerPublisherId` (`fa292226-6f00-4e3d-bede-0b5e7968f6d8`) or `sellerId` (`9202775531783`) from an earlier run. Each agency multiplies the searches (keyword × location × agency, max 500), in the whole of Spain unless a location is set. Pasting the agency page in **Fotocasa URLs** does the same.

## `sortBy` (type: `string`):

**Newest first** is the only order Fotocasa keeps strictly, the best one with **Only new listings** and **Posted after**: reading stops as soon as older listings start. New-build projects are the exception: Fotocasa sorts them by its own score, so a project search is read to its end, the projects already delivered skipped and not charged.

## `includeDetails` (type: `boolean`):

Open each listing's detail record (1 extra request per listing) for the energy certificate (rating, consumption, emissions), heating, plot size, contact email on new-build units, agency website and registrations, subsidies. Charged per listing delivered with details (see Pricing). Off = these columns are null.

## `includeAgencyLeads` (type: `boolean`):

Add one `agency` row per professional agency met, once per run, from the agency's Fotocasa profile: email, phone, website, address, opening hours, languages, agents, stock of listings by type. Charged per agency delivered with a profile; an agency with no profile gets a free row taken from its listing. Private sellers never get an agency row.

## `maxAgencyLeads` (type: `integer`):

Cap on the agency profiles read in the run (the first agencies met). 0 = no limit.

## `postedAfter` (type: `string`):

Only listings published on or after this date (the `publishedAt` column): `2026-09-01`, or a period before now such as `7 days`, `2 weeks`, `1 month` (API: `24 hours` and full ISO date-times work too). Listings without a publication date are dropped.

## `postedBefore` (type: `string`):

Only listings published on or before this date (the whole day is included), or older than a period such as `30 days`.

## `excludeKeywords` (type: `array`):

Drop the listings whose title or description contains one of these WHOLE words (case and accents ignored): `art` drops "Art deco" but keeps "Smart home". Several words in one entry (`hand made`) must appear together, in that order. Chinese, Japanese, Korean, Thai, Lao, Khmer and Burmese words are found anywhere in the title or description (no spaces there).

## `requirePhone` (type: `boolean`):

Drop the listings without a phone number.

## `withPhotosOnly` (type: `boolean`):

Drop the listings without a photo.

## `privateSellersOnly` (type: `boolean`):

Keep only the listings of private individuals (about 1 listing in 18). Same as **Seller type** set to `Private`.

## `sellerType` (type: `string`):

Keep only private sellers or only professionals. Fotocasa has no such filter: listings are read, then sorted out, until **Max listings** is filled. A large search is cut if what Fotocasa shows of it would not fill it (about 1 listing in 18 is from a private seller).

## `zipCodes` (type: `array`):

Keep only the listings with one of these 5-digit Spanish ZIP codes (e.g. `28013`). Fotocasa has no such filter: set the matching **Location** too, or the whole of Spain is read.

## `onlyNew` (type: `boolean`):

Skip the listings that a previous run (same **Memory key**) already delivered: they are not saved and not charged. First run = everything is new.

## `trackChanges` (type: `boolean`):

Compare each listing with the last run (same **Memory key**): every row gets `changeType` (`new`, `price_drop`, `price_rise`, `unchanged`), `previousPrice`, `priceChange` and `firstSeenAt`. A listing gone from the results gets a free `removed` row, only when every search was read to the end. Cannot be used with **Only new listings**.

## `onlyChanges` (type: `boolean`):

With **Track changes**: save only new listings and price changes. Unchanged listings are not saved and not charged.

## `stateKey` (type: `string`):

Name of the memory used by **Only new listings** and **Track changes**. Give each schedule / task its own key (e.g. `madrid-rentals`) so that they do not share their memory. Letters, digits, `-` and `_`.

## `resetState` (type: `boolean`):

Forget everything remembered under this **Memory key** before the run: this run returns (and charges) every listing again. Untick it afterwards.

## `proxyConfiguration` (type: `object`):

Apify Proxy or your own proxies. Keep the default: it is included in the price. The residential Apify proxy is not available in this Actor.

## `maxConcurrency` (type: `integer`):

Maximum number of requests processed in parallel.

## `maxRequestsPerMinute` (type: `integer`):

Most requests to the site in any 60 seconds, all of them counted: search pages, listing details, agency profiles. A budget, not an even pace: up to this many can leave at once when the minute starts (spread them with the minimum delay below). Lower it if the log shows HTTP 403.

## `minRequestIntervalMs` (type: `integer`):

Smallest gap between two requests, in milliseconds. Unlike the per-minute rate, this spreads the requests evenly instead of letting them go out in a burst. 0 = no gap.

## `maxRequestRetries` (type: `integer`):

Retries per request before it is marked as failed. Behind a proxy, a request the site turns away is also retried on a new proxy session up to 10 times without using up these retries.

## `debugLog` (type: `boolean`):

Include debug messages in the run log.

## Actor input object example

```json
{
  "startUrls": [],
  "operation": "buy",
  "propertyType": "homes",
  "location": "Madrid",
  "locations": [],
  "searchQueries": [],
  "distanceKm": 5,
  "maxItems": 100,
  "maxItemsPerQuery": 0,
  "splitLargeSearches": true,
  "propertySubtypes": [],
  "conditions": [],
  "features": [],
  "tags": [],
  "occupancy": [],
  "rentalDuration": [],
  "publicationDate": "ANY",
  "priceDropOnly": false,
  "withVideoOnly": false,
  "subsidizedOnly": false,
  "bankFlatsOnly": false,
  "newConstructionOnly": false,
  "qualitySealOnly": false,
  "agencyIds": [],
  "sortBy": "newest",
  "includeDetails": false,
  "includeAgencyLeads": false,
  "maxAgencyLeads": 0,
  "excludeKeywords": [],
  "requirePhone": false,
  "withPhotosOnly": false,
  "privateSellersOnly": false,
  "sellerType": "all",
  "zipCodes": [],
  "onlyNew": false,
  "trackChanges": false,
  "onlyChanges": false,
  "stateKey": "default",
  "resetState": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxConcurrency": 8,
  "maxRequestsPerMinute": 240,
  "minRequestIntervalMs": 0,
  "maxRequestRetries": 5,
  "debugLog": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "location": "Madrid",
    "maxItems": 100,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("nice_dev/fotocasa-listings-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "location": "Madrid",
    "maxItems": 100,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("nice_dev/fotocasa-listings-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "location": "Madrid",
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call nice_dev/fotocasa-listings-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nice_dev/fotocasa-listings-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/9xNMwruZLFkRtGicI/builds/D3WAWUYqfctj4osE9/openapi.json
